LEFT | RIGHT |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 | 2 |
3 // Include a header file from your module to test. | 3 // Include a header file from your module to test. |
4 #include "ns3/double-probe.h" | 4 #include "ns3/double-probe.h" |
5 #include "ns3/test.h" | 5 #include "ns3/test.h" |
6 #include "ns3/random-variable-stream.h" | 6 #include "ns3/random-variable-stream.h" |
7 #include "ns3/trace-source-accessor.h" | 7 #include "ns3/trace-source-accessor.h" |
8 #include "ns3/traced-value.h" | 8 #include "ns3/traced-value.h" |
9 #include "ns3/nstime.h" | 9 #include "ns3/nstime.h" |
10 #include "ns3/simulator.h" | 10 #include "ns3/simulator.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 { | 90 { |
91 } | 91 } |
92 | 92 |
93 ProbeTestCase1::~ProbeTestCase1 () | 93 ProbeTestCase1::~ProbeTestCase1 () |
94 { | 94 { |
95 } | 95 } |
96 | 96 |
97 void | 97 void |
98 ProbeTestCase1::TraceSink (std::string context, double oldValue, double newValue
) | 98 ProbeTestCase1::TraceSink (std::string context, double oldValue, double newValue
) |
99 { | 99 { |
100 NS_UNUSED(oldValue); | 100 NS_UNUSED (oldValue); |
101 NS_TEST_ASSERT_MSG_GT (Simulator::Now (), Seconds (100), "Probed a value outsi
de of the time window"); | 101 NS_TEST_ASSERT_MSG_GT (Simulator::Now (), Seconds (100), "Probed a value outsi
de of the time window"); |
102 NS_TEST_ASSERT_MSG_LT (Simulator::Now (), Seconds (200), "Probed a value outsi
de of the time window"); | 102 NS_TEST_ASSERT_MSG_LT (Simulator::Now (), Seconds (200), "Probed a value outsi
de of the time window"); |
103 | 103 |
104 NS_TEST_ASSERT_MSG_EQ_TOL (m_s->GetValue (), newValue, 0.00001, "Value probed
different than value in the variable"); | 104 NS_TEST_ASSERT_MSG_EQ_TOL (m_s->GetValue (), newValue, 0.00001, "Value probed
different than value in the variable"); |
105 | 105 |
106 if (context == "testProbe") | 106 if (context == "testProbe") |
107 { | 107 { |
108 m_objectProbed++; | 108 m_objectProbed++; |
109 } | 109 } |
110 else if (context == "testProbe2") | 110 else if (context == "testProbe2") |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 169 |
170 ProbeTestSuite::ProbeTestSuite () | 170 ProbeTestSuite::ProbeTestSuite () |
171 : TestSuite ("double-probe", UNIT) | 171 : TestSuite ("double-probe", UNIT) |
172 { | 172 { |
173 AddTestCase (new ProbeTestCase1, TestCase::QUICK); | 173 AddTestCase (new ProbeTestCase1, TestCase::QUICK); |
174 } | 174 } |
175 | 175 |
176 // Do not forget to allocate an instance of this TestSuite | 176 // Do not forget to allocate an instance of this TestSuite |
177 static ProbeTestSuite probeTestSuite; | 177 static ProbeTestSuite probeTestSuite; |
178 | 178 |
LEFT | RIGHT |