Skip to content

Commit

Permalink
test hashing ?
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-urban committed Dec 7, 2023
1 parent de36ae0 commit 30192b2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
);

Expand All @@ -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);
}

0 comments on commit 30192b2

Please sign in to comment.