From fda0d0ab33e7347575b2779f290d3f94dbbedf10 Mon Sep 17 00:00:00 2001 From: Philip Robinson Date: Wed, 18 Aug 2021 09:18:30 +0200 Subject: [PATCH] fix: Fix or remove ignored tests in pow_data.rs This PR aimed to remove the ignore from the tests in pow_data.rs. These tests are failing tests so two of them that panicked with updated with the `should_panic` flag but the out of memory test aborts and cannot be handled in a test so it was removed. --- .../core/src/proof_of_work/monero_rx/pow_data.rs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/base_layer/core/src/proof_of_work/monero_rx/pow_data.rs b/base_layer/core/src/proof_of_work/monero_rx/pow_data.rs index 80ab870c18..47691482e8 100644 --- a/base_layer/core/src/proof_of_work/monero_rx/pow_data.rs +++ b/base_layer/core/src/proof_of_work/monero_rx/pow_data.rs @@ -150,27 +150,15 @@ mod test { use super::*; use monero::TxIn; - #[ignore] #[test] + #[should_panic(expected = "capacity overflow")] fn simple_capacity_overflow_panic() { let data = &[0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f]; let _ = deserialize::>(data); } - #[ignore] - #[test] - fn oom_moneroblock_deserialize() { - let data = [ - 0x09, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x95, 0x95, 0x95, - 0x95, 0x01, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, - ]; - let _ = deserialize::(&data); - } - - #[ignore] #[test] + #[should_panic(expected = "capacity overflow")] fn panic_alloc_capacity_overflow_moneroblock_deserialize() { let data = [ 0x0f, 0x9e, 0xa5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,