Skip to content

Commit

Permalink
Increase test log level and change comparison code
Browse files Browse the repository at this point in the history
  • Loading branch information
non-det-alle committed Mar 21, 2024
1 parent 056b6a3 commit 14b751e
Showing 1 changed file with 2 additions and 23 deletions.
25 changes: 2 additions & 23 deletions test/lorawan-test-suite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1265,28 +1265,7 @@ PhyConnectivityTest::WrongFrequency(Ptr<const Packet> packet, uint32_t node)
bool
PhyConnectivityTest::HaveSamePacketContents(Ptr<Packet> packet1, Ptr<Packet> packet2)
{
uint32_t size1 = packet1->GetSerializedSize();
uint8_t buffer1[size1];
packet1->Serialize(buffer1, size1);

uint32_t size2 = packet2->GetSerializedSize();
uint8_t buffer2[size2];
packet2->Serialize(buffer2, size2);

NS_ASSERT(size1 == size2);

bool foundADifference = false;
for (uint32_t i = 0; i < size1; i++)
{
NS_LOG_DEBUG(unsigned(buffer1[i]) << " " << unsigned(buffer2[i]));
if (buffer1[i] != buffer2[i])
{
foundADifference = true;
break;
}
}

return !foundADifference;
return packet1->GetUid() == packet2->GetUid();
}

void
Expand Down Expand Up @@ -1680,7 +1659,7 @@ class LorawanTestSuite : public TestSuite
LorawanTestSuite::LorawanTestSuite()
: TestSuite("lorawan", UNIT)
{
LogComponentEnable("LorawanTestSuite", LOG_LEVEL_DEBUG);
LogComponentEnable("LorawanTestSuite", LOG_LEVEL_ALL);
// TestDuration for TestCase can be QUICK, EXTENSIVE or TAKES_FOREVER
AddTestCase(new InterferenceTest, TestCase::QUICK);
AddTestCase(new AddressTest, TestCase::QUICK);
Expand Down

0 comments on commit 14b751e

Please sign in to comment.