From 30192b2917d9a947c08fdac371349f2a1d2d6851 Mon Sep 17 00:00:00 2001 From: Peter Urban Date: Thu, 7 Dec 2023 21:31:07 +0100 Subject: [PATCH] test hashing ? --- .../datastructures/cwsignalparameters.test.cpp | 3 +++ .../datastructures/fmsignalparameters.test.cpp | 3 +++ .../datastructures/genericsignalparameters.test.cpp | 13 ++++++++----- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/tests/signalprocessing/datastructures/cwsignalparameters.test.cpp b/src/tests/signalprocessing/datastructures/cwsignalparameters.test.cpp index a0c972c..0e3ace7 100644 --- a/src/tests/signalprocessing/datastructures/cwsignalparameters.test.cpp +++ b/src/tests/signalprocessing/datastructures/cwsignalparameters.test.cpp @@ -46,4 +46,7 @@ TEST_CASE("CWSignalParameters should support common functions", TESTTAG) REQUIRE(txs.bandwidth == Approx(789.012f)); REQUIRE(txs.effective_pulse_duration == Approx(0.00234)); REQUIRE(txs.get_tx_signal_type() == t_TxSignalType::CW); + + // test hash + REQUIRE(txs.binary_hash() == 2912944253744273239); } diff --git a/src/tests/signalprocessing/datastructures/fmsignalparameters.test.cpp b/src/tests/signalprocessing/datastructures/fmsignalparameters.test.cpp index 6b7f072..c8dd4fa 100644 --- a/src/tests/signalprocessing/datastructures/fmsignalparameters.test.cpp +++ b/src/tests/signalprocessing/datastructures/fmsignalparameters.test.cpp @@ -48,4 +48,7 @@ TEST_CASE("FMSignalParameters should support common functions", TESTTAG) REQUIRE(txs.bandwidth == Approx(789.012f)); REQUIRE(txs.effective_pulse_duration == Approx(0.00234)); REQUIRE(txs.get_tx_signal_type() == t_TxSignalType::FM_UP_SWEEP); + + // test hash + REQUIRE(txs.binary_hash() == 4636758341217930380); } diff --git a/src/tests/signalprocessing/datastructures/genericsignalparameters.test.cpp b/src/tests/signalprocessing/datastructures/genericsignalparameters.test.cpp index 2b79be9..7ae6fb2 100644 --- a/src/tests/signalprocessing/datastructures/genericsignalparameters.test.cpp +++ b/src/tests/signalprocessing/datastructures/genericsignalparameters.test.cpp @@ -20,9 +20,9 @@ using Catch::Approx; TEST_CASE("GenericSignalParameters should support common functions", TESTTAG) { // initialize location - auto txs = GenericSignalParameters(123567.891f, // center_frequency - 789.012f, // bandwidth - 0.00234f, // effective_pulse_duration + auto txs = GenericSignalParameters(123567.891f, // center_frequency + 0.00223f, // bandwidth + 0.0023f, // effective_pulse_duration t_TxSignalType::UNKNOWN // up_sweep ); @@ -45,7 +45,10 @@ TEST_CASE("GenericSignalParameters should support common functions", TESTTAG) // test individual variables REQUIRE(txs.center_frequency == Approx(123567.891f)); - REQUIRE(txs.bandwidth == Approx(789.012f)); - REQUIRE(txs.effective_pulse_duration == Approx(0.00234)); + REQUIRE(txs.bandwidth == Approx(0.00223f)); + REQUIRE(txs.effective_pulse_duration == Approx(0.0023f)); REQUIRE(txs.get_tx_signal_type() == t_TxSignalType::UNKNOWN); + + // test hash + REQUIRE(txs.binary_hash() == 5014453207090090244); }