144 std::string priomap(
"0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3");
146 std::array<std::queue<uint64_t>, 4> uids;
154 for (uint8_t i = 0; i < 4; i++)
159 c->SetQueueDisc(child);
160 qdisc->AddQueueDiscClass(c);
166 "Verify that the queue disc has 4 child queue discs");
170 "Verify that we can actually set the attribute Priomap");
175 "Verify that we can actually get the attribute Priomap");
184 for (uint16_t i = 0; i < 4; i++)
188 "There should be no packets in the child queue disc " << i);
191 qdisc->Enqueue(item);
193 uids[i].push(item->GetPacket()->GetUid());
197 "There should be one packet in the child queue disc " << i);
206 qdisc->AddPacketFilter(pf1);
209 for (uint16_t i = 0; i < 4; i++)
213 "There should be one packet in the child queue disc " << i);
216 qdisc->Enqueue(item);
218 uids[i].push(item->GetPacket()->GetUid());
222 "There should be two packets in the child queue disc " << i);
230 qdisc->AddPacketFilter(pf2);
233 for (uint16_t i = 0; i < 4; i++)
235 pf2->SetReturnValue(i);
238 "There should be two packets in the child queue disc " << i);
241 qdisc->Enqueue(item);
243 uids[i].push(item->GetPacket()->GetUid());
247 "There should be three packets in the child queue disc " << i);
257 for (uint16_t i = 0; i < 4; i++)
259 pf2->SetReturnValue(4 + i);
262 "The band for priority 0 must be band 0");
265 "There should be " << i + 3 <<
" packets in the child queue disc "
266 << qdisc->GetBandForPriority(0));
269 qdisc->Enqueue(item);
271 uids[0].push(item->GetPacket()->GetUid());
275 "There should be " << i + 4 <<
" packets in the child queue disc "
276 << qdisc->GetBandForPriority(0));
283 while ((item = qdisc->Dequeue()))
285 for (uint16_t i = 0; i < 4; i++)
291 "Band " << i <<
" should be empty");
295 item->GetPacket()->GetUid(),
296 "The dequeued packet is not the one we expected");
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.