238 { |
238 { |
239 bool result = true; |
239 bool result = true; |
240 |
240 |
241 AttributeList params; |
241 AttributeList params; |
242 Ptr<AttributeObjectTest> p; |
242 Ptr<AttributeObjectTest> p; |
243 NS_TEST_ASSERT (params.Set ("AttributeObjectTest::TestBoolName", String ("false"))); |
243 NS_TEST_ASSERT (params.SetFailSafe ("AttributeObjectTest::TestBoolName", String ("false"))); |
244 p = CreateObject<AttributeObjectTest> (params); |
244 p = CreateObject<AttributeObjectTest> (params); |
245 CHECK_GET_STR (p, "TestBoolName", "false"); |
245 CHECK_GET_STR (p, "TestBoolName", "false"); |
246 CHECK_GET_PARAM (p, "TestBoolName", Boolean, false); |
246 CHECK_GET_PARAM (p, "TestBoolName", Boolean, false); |
247 |
247 |
248 NS_TEST_ASSERT (p->SetAttribute("TestBoolName", String ("true"))); |
248 NS_TEST_ASSERT (p->SetAttribute("TestBoolName", String ("true"))); |
406 NS_TEST_ASSERT_EQUAL (vector.GetN (), 1); |
406 NS_TEST_ASSERT_EQUAL (vector.GetN (), 1); |
407 vector = p->GetAttribute ("TestVector2"); |
407 vector = p->GetAttribute ("TestVector2"); |
408 NS_TEST_ASSERT_EQUAL (vector.GetN (), 2); |
408 NS_TEST_ASSERT_EQUAL (vector.GetN (), 2); |
409 } |
409 } |
410 |
410 |
411 NS_TEST_ASSERT (AttributeList::GetGlobal ()->Set ("AttributeObjectTest::TestBoolName", String ("true"))); |
411 NS_TEST_ASSERT (AttributeList::GetGlobal ()->SetFailSafe ("AttributeObjectTest::TestBoolName", String ("true"))); |
412 p = CreateObjectWith<AttributeObjectTest> (); |
412 p = CreateObjectWith<AttributeObjectTest> (); |
413 Boolean boolV = p->GetAttribute ("TestBoolName"); |
413 Boolean boolV = p->GetAttribute ("TestBoolName"); |
414 NS_TEST_ASSERT_EQUAL (boolV, Boolean (true)); |
414 NS_TEST_ASSERT_EQUAL (boolV, Boolean (true)); |
415 |
415 |
416 NS_TEST_ASSERT (AttributeList::GetGlobal ()->Set ("AttributeObjectTest::TestBoolName", String ("false"))); |
416 NS_TEST_ASSERT (AttributeList::GetGlobal ()->SetFailSafe ("AttributeObjectTest::TestBoolName", String ("false"))); |
417 p = CreateObjectWith<AttributeObjectTest> (); |
417 p = CreateObjectWith<AttributeObjectTest> (); |
418 boolV = p->GetAttribute ("TestBoolName"); |
418 boolV = p->GetAttribute ("TestBoolName"); |
419 NS_TEST_ASSERT_EQUAL (boolV, Boolean (false)); |
419 NS_TEST_ASSERT_EQUAL (boolV, Boolean (false)); |
420 |
420 |
421 Integer i = p->GetAttribute ("IntegerTraceSource1"); |
421 Integer i = p->GetAttribute ("IntegerTraceSource1"); |