24 #include "cheetah/rcpt/test/BeamFormerPacketTest.h" 25 #include "cheetah/rcpt/BeamFormerPacket.h" 34 BeamFormerPacketTest::BeamFormerPacketTest()
39 BeamFormerPacketTest::~BeamFormerPacketTest()
43 void BeamFormerPacketTest::SetUp()
47 void BeamFormerPacketTest::TearDown()
51 TEST_F(BeamFormerPacketTest, test_number_of_samples)
53 ASSERT_EQ(BeamFormerPacketMid::payload_size()/
sizeof(Sample), BeamFormerPacketMid::number_of_samples());
56 TEST_F(BeamFormerPacketTest, test_packet_count)
58 BeamFormerPacketMid packet;
61 packet.packet_count(0);
62 ASSERT_EQ(0x0000000000000000U, packet.packet_count());
64 packet.packet_count(1);
65 ASSERT_EQ(0x0000000000000001U, packet.packet_count());
68 packet.packet_count(0xFFFFFFFFFFFFFFFF);
69 ASSERT_EQ(0xFFFFFFFFFFFFFFFFU, packet.packet_count());
72 packet.packet_count(0x0001000000000000);
73 ASSERT_EQ(0x0001000000000000U, packet.packet_count());
76 for(uint64_t i=2; i<0xFFFF; ++i) {
77 packet.packet_count(i);
78 ASSERT_EQ(i, packet.packet_count());
82 TEST_F(BeamFormerPacketTest, test_insert)
84 BeamFormerPacketMid packet;
85 packet.packet_count(1);
86 for(std::size_t i=0; i< packet.number_of_samples(); ++i) {
87 packet.insert(i, Sample(i, 2*i, 3*i, 4*i));
88 Sample
const& sample = packet.sample(i);
89 ASSERT_EQ(static_cast<short>(i),sample.xx());
90 ASSERT_EQ(static_cast<short>(i*2),sample.yy());
91 ASSERT_EQ(static_cast<short>(i*3),sample.xy().first);
92 ASSERT_EQ(static_cast<short>(i*4),sample.xy().second);
94 ASSERT_EQ(0x0000000000000001U, packet.packet_count()) << i;
Some limits and constants for FLDO.