Lines 391-423
PacketTest::DoRun (void)
|
Link Here
|
---|
|
391 |
|
391 |
|
392 |
{ |
392 |
{ |
393 |
Packet p; |
393 |
Packet p; |
394 |
ATestTag<10> a; |
394 |
Ptr< ATestTag<10> > a = CreateObject< ATestTag<10> > (); |
395 |
p.AddPacketTag (a); |
395 |
p.AddPacketTag (a); |
396 |
NS_TEST_EXPECT_MSG_EQ (p.PeekPacketTag (a), true, "trivial"); |
396 |
NS_TEST_EXPECT_MSG_NE (p.PeekPacketTag< ATestTag<10> > (), 0, "trivial"); |
397 |
ATestTag<11> b; |
397 |
Ptr< ATestTag<11> > b = CreateObject< ATestTag<11> > (); |
398 |
p.AddPacketTag (b); |
398 |
p.AddPacketTag (b); |
399 |
NS_TEST_EXPECT_MSG_EQ (p.PeekPacketTag (b), true, "trivial"); |
399 |
NS_TEST_EXPECT_MSG_NE (p.PeekPacketTag< ATestTag<11> > (), 0, "trivial"); |
400 |
NS_TEST_EXPECT_MSG_EQ (p.PeekPacketTag (a), true, "trivial"); |
400 |
NS_TEST_EXPECT_MSG_NE (p.PeekPacketTag< ATestTag<10> > (), 0, "trivial"); |
401 |
Packet copy = p; |
401 |
Packet copy = p; |
402 |
NS_TEST_EXPECT_MSG_EQ (copy.PeekPacketTag (b), true, "trivial"); |
402 |
NS_TEST_EXPECT_MSG_NE (copy.PeekPacketTag< ATestTag<11> > (), 0, "trivial"); |
403 |
NS_TEST_EXPECT_MSG_EQ (copy.PeekPacketTag (a), true, "trivial"); |
403 |
NS_TEST_EXPECT_MSG_NE (copy.PeekPacketTag< ATestTag<10> > (), 0, "trivial"); |
404 |
ATestTag<12> c; |
404 |
Ptr< ATestTag<12> > c = CreateObject< ATestTag<12> > (); |
405 |
NS_TEST_EXPECT_MSG_EQ (copy.PeekPacketTag (c), false, "trivial"); |
405 |
NS_TEST_EXPECT_MSG_EQ (copy.PeekPacketTag< ATestTag<12> > (), 0, "trivial"); |
406 |
copy.AddPacketTag (c); |
406 |
copy.AddPacketTag (c); |
407 |
NS_TEST_EXPECT_MSG_EQ (copy.PeekPacketTag (c), true, "trivial"); |
407 |
NS_TEST_EXPECT_MSG_NE (copy.PeekPacketTag< ATestTag<12> > (), 0, "trivial"); |
408 |
NS_TEST_EXPECT_MSG_EQ (copy.PeekPacketTag (b), true, "trivial"); |
408 |
NS_TEST_EXPECT_MSG_NE (copy.PeekPacketTag< ATestTag<11> > (), 0, "trivial"); |
409 |
NS_TEST_EXPECT_MSG_EQ (copy.PeekPacketTag (a), true, "trivial"); |
409 |
NS_TEST_EXPECT_MSG_NE (copy.PeekPacketTag< ATestTag<10> > (), 0, "trivial"); |
410 |
NS_TEST_EXPECT_MSG_EQ (p.PeekPacketTag (c), false, "trivial"); |
410 |
NS_TEST_EXPECT_MSG_EQ (p.PeekPacketTag< ATestTag<12> > (), 0, "trivial"); |
411 |
copy.RemovePacketTag (b); |
411 |
copy.RemovePacketTag< ATestTag<11> > (); |
412 |
NS_TEST_EXPECT_MSG_EQ (copy.PeekPacketTag (b), false, "trivial"); |
412 |
NS_TEST_EXPECT_MSG_EQ (copy.PeekPacketTag< ATestTag<11> > (), 0, "trivial"); |
413 |
NS_TEST_EXPECT_MSG_EQ (p.PeekPacketTag (b), true, "trivial"); |
413 |
NS_TEST_EXPECT_MSG_NE (p.PeekPacketTag< ATestTag<11> > (), 0, "trivial"); |
414 |
p.RemovePacketTag (a); |
414 |
p.RemovePacketTag< ATestTag<10> > (); |
415 |
NS_TEST_EXPECT_MSG_EQ (p.PeekPacketTag (a), false, "trivial"); |
415 |
NS_TEST_EXPECT_MSG_EQ (p.PeekPacketTag< ATestTag<10> > (), 0, "trivial"); |
416 |
NS_TEST_EXPECT_MSG_EQ (copy.PeekPacketTag (a), true, "trivial"); |
416 |
NS_TEST_EXPECT_MSG_NE (copy.PeekPacketTag< ATestTag<10> > (), 0, "trivial"); |
417 |
NS_TEST_EXPECT_MSG_EQ (p.PeekPacketTag (c), false, "trivial"); |
417 |
NS_TEST_EXPECT_MSG_EQ (p.PeekPacketTag< ATestTag<12> > (), 0, "trivial"); |
418 |
NS_TEST_EXPECT_MSG_EQ (copy.PeekPacketTag (c), true, "trivial"); |
418 |
NS_TEST_EXPECT_MSG_NE (copy.PeekPacketTag< ATestTag<12> > (), 0, "trivial"); |
419 |
p.RemoveAllPacketTags (); |
419 |
p.RemoveAllPacketTags (); |
420 |
NS_TEST_EXPECT_MSG_EQ (p.PeekPacketTag (b), false, "trivial"); |
420 |
NS_TEST_EXPECT_MSG_EQ (p.PeekPacketTag< ATestTag<11> > (), 0, "trivial"); |
421 |
} |
421 |
} |
422 |
|
422 |
|
423 |
{ |
423 |
{ |