test: Add conditional check for debug_assertions
Adding debug_assertions where the test case panics allows the test suite to run in release mode successfully.
This commit is contained in:
parent
53461f71c9
commit
1d13020129
|
@ -489,6 +489,7 @@ mod test {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(debug_assertions)]
|
||||||
#[should_panic] // 'attempt to add with overflow' in consensus_encode()
|
#[should_panic] // 'attempt to add with overflow' in consensus_encode()
|
||||||
fn test_getblocktx_panic_when_encoding_u64_max() {
|
fn test_getblocktx_panic_when_encoding_u64_max() {
|
||||||
serialize(&BlockTransactionsRequest {
|
serialize(&BlockTransactionsRequest {
|
||||||
|
|
|
@ -190,6 +190,7 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(debug_assertions)]
|
||||||
#[should_panic]
|
#[should_panic]
|
||||||
fn from_sat_per_vb_unchecked_panic_test() { FeeRate::from_sat_per_vb_unchecked(u64::MAX); }
|
fn from_sat_per_vb_unchecked_panic_test() { FeeRate::from_sat_per_vb_unchecked(u64::MAX); }
|
||||||
|
|
||||||
|
|
|
@ -182,6 +182,7 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(debug_assertions)]
|
||||||
#[should_panic]
|
#[should_panic]
|
||||||
fn from_vb_unchecked_panic() { Weight::from_vb_unchecked(u64::MAX); }
|
fn from_vb_unchecked_panic() { Weight::from_vb_unchecked(u64::MAX); }
|
||||||
|
|
||||||
|
|
|
@ -1692,22 +1692,27 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(debug_assertions)]
|
||||||
#[should_panic]
|
#[should_panic]
|
||||||
fn u256_overflowing_addition_panics() { let _ = U256::MAX + U256::ONE; }
|
fn u256_overflowing_addition_panics() { let _ = U256::MAX + U256::ONE; }
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(debug_assertions)]
|
||||||
#[should_panic]
|
#[should_panic]
|
||||||
fn u256_overflowing_subtraction_panics() { let _ = U256::ZERO - U256::ONE; }
|
fn u256_overflowing_subtraction_panics() { let _ = U256::ZERO - U256::ONE; }
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(debug_assertions)]
|
||||||
#[should_panic]
|
#[should_panic]
|
||||||
fn u256_multiplication_by_max_panics() { let _ = U256::MAX * U256::MAX; }
|
fn u256_multiplication_by_max_panics() { let _ = U256::MAX * U256::MAX; }
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(debug_assertions)]
|
||||||
#[should_panic]
|
#[should_panic]
|
||||||
fn work_overflowing_addition_panics() { let _ = Work(U256::MAX) + Work(U256::ONE); }
|
fn work_overflowing_addition_panics() { let _ = Work(U256::MAX) + Work(U256::ONE); }
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(debug_assertions)]
|
||||||
#[should_panic]
|
#[should_panic]
|
||||||
fn work_overflowing_subtraction_panics() { let _ = Work(U256::ZERO) - Work(U256::ONE); }
|
fn work_overflowing_subtraction_panics() { let _ = Work(U256::ZERO) - Work(U256::ONE); }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue