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 * Copyright (c) 2009 University of Washington | 3 * Copyright (c) 2009 University of Washington |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 typedef void (* TracedValueCallback)(const ValueClassTest oldValue, | 55 typedef void (* TracedValueCallback)(const ValueClassTest oldValue, |
56 const ValueClassTest newValue); | 56 const ValueClassTest newValue); |
57 | 57 |
58 private: | 58 private: |
59 int m_v; | 59 int m_v; |
60 }; | 60 }; |
61 | 61 |
62 | 62 |
63 bool operator != (const ValueClassTest &a, const ValueClassTest &b) | 63 bool operator != (const ValueClassTest &a, const ValueClassTest &b) |
64 { | 64 { |
65 NS_UNUSED(a); | 65 NS_UNUSED (a); |
66 NS_UNUSED(b); | 66 NS_UNUSED (b); |
67 return true; | 67 return true; |
68 } | 68 } |
69 std::ostream & operator << (std::ostream &os, ValueClassTest v) | 69 std::ostream & operator << (std::ostream &os, ValueClassTest v) |
70 { | 70 { |
71 NS_UNUSED(v); | 71 NS_UNUSED (v); |
72 return os; | 72 return os; |
73 } | 73 } |
74 std::istream & operator >> (std::istream &is, ValueClassTest &v) | 74 std::istream & operator >> (std::istream &is, ValueClassTest &v) |
75 { | 75 { |
76 NS_UNUSED(v); | 76 NS_UNUSED (v); |
77 return is; | 77 return is; |
78 } | 78 } |
79 | 79 |
80 ATTRIBUTE_HELPER_HEADER (ValueClassTest); | 80 ATTRIBUTE_HELPER_HEADER (ValueClassTest); |
81 ATTRIBUTE_HELPER_CPP (ValueClassTest); | 81 ATTRIBUTE_HELPER_CPP (ValueClassTest); |
82 | 82 |
83 class Derived : public Object | 83 class Derived : public Object |
84 { | 84 { |
85 public: | 85 public: |
86 static TypeId GetTypeId (void) { | 86 static TypeId GetTypeId (void) { |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 if (!m_cbValue.IsNull ()) { | 256 if (!m_cbValue.IsNull ()) { |
257 m_cbValue (a); | 257 m_cbValue (a); |
258 } | 258 } |
259 } | 259 } |
260 | 260 |
261 private: | 261 private: |
262 void DoSetTestB (bool v) { m_boolTestA = v; } | 262 void DoSetTestB (bool v) { m_boolTestA = v; } |
263 bool DoGetTestB (void) const { return m_boolTestA; } | 263 bool DoGetTestB (void) const { return m_boolTestA; } |
264 int16_t DoGetInt16 (void) const { return m_int16SetGet; } | 264 int16_t DoGetInt16 (void) const { return m_int16SetGet; } |
265 void DoSetInt16 (int16_t v) { m_int16SetGet = v; } | 265 void DoSetInt16 (int16_t v) { m_int16SetGet = v; } |
266 uint32_t DoGetVectorN (void) const { return m_vector2.size (); } | 266 std::size_t DoGetVectorN (void) const { return m_vector2.size (); } |
267 Ptr<Derived> DoGetVector (uint32_t i) const { return m_vector2[i]; } | 267 Ptr<Derived> DoGetVector (std::size_t i) const { return m_vector2[i]; } |
268 bool DoSetIntSrc (int8_t v) { m_intSrc2 = v; return true; } | 268 bool DoSetIntSrc (int8_t v) { m_intSrc2 = v; return true; } |
269 int8_t DoGetIntSrc (void) const { return m_intSrc2; } | 269 int8_t DoGetIntSrc (void) const { return m_intSrc2; } |
270 bool DoSetEnum (Test_e v) { m_enumSetGet = v; return true; } | 270 bool DoSetEnum (Test_e v) { m_enumSetGet = v; return true; } |
271 Test_e DoGetEnum (void) const { return m_enumSetGet; } | 271 Test_e DoGetEnum (void) const { return m_enumSetGet; } |
272 | 272 |
273 bool m_boolTestA; | 273 bool m_boolTestA; |
274 bool m_boolTest; | 274 bool m_boolTest; |
275 int16_t m_int16; | 275 int16_t m_int16; |
276 int16_t m_int16WithBounds; | 276 int16_t m_int16WithBounds; |
277 int16_t m_int16SetGet; | 277 int16_t m_int16SetGet; |
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1066 // =========================================================================== | 1066 // =========================================================================== |
1067 class IntegerTraceSourceTestCase : public TestCase | 1067 class IntegerTraceSourceTestCase : public TestCase |
1068 { | 1068 { |
1069 public: | 1069 public: |
1070 IntegerTraceSourceTestCase (std::string description); | 1070 IntegerTraceSourceTestCase (std::string description); |
1071 virtual ~IntegerTraceSourceTestCase () {} | 1071 virtual ~IntegerTraceSourceTestCase () {} |
1072 | 1072 |
1073 private: | 1073 private: |
1074 virtual void DoRun (void); | 1074 virtual void DoRun (void); |
1075 | 1075 |
1076 void NotifySource1 (int8_t old, int8_t n) { NS_UNUSED(old); m_got1 = n; } | 1076 void NotifySource1 (int8_t old, int8_t n) |
| 1077 {· |
| 1078 NS_UNUSED (old);· |
| 1079 m_got1 = n; |
| 1080 } |
1077 int64_t m_got1; | 1081 int64_t m_got1; |
1078 }; | 1082 }; |
1079 | 1083 |
1080 IntegerTraceSourceTestCase::IntegerTraceSourceTestCase (std::string description) | 1084 IntegerTraceSourceTestCase::IntegerTraceSourceTestCase (std::string description) |
1081 : TestCase (description) | 1085 : TestCase (description) |
1082 { | 1086 { |
1083 } | 1087 } |
1084 | 1088 |
1085 void | 1089 void |
1086 IntegerTraceSourceTestCase::DoRun (void) | 1090 IntegerTraceSourceTestCase::DoRun (void) |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1138 // =========================================================================== | 1142 // =========================================================================== |
1139 class TracedCallbackTestCase : public TestCase | 1143 class TracedCallbackTestCase : public TestCase |
1140 { | 1144 { |
1141 public: | 1145 public: |
1142 TracedCallbackTestCase (std::string description); | 1146 TracedCallbackTestCase (std::string description); |
1143 virtual ~TracedCallbackTestCase () {} | 1147 virtual ~TracedCallbackTestCase () {} |
1144 | 1148 |
1145 private: | 1149 private: |
1146 virtual void DoRun (void); | 1150 virtual void DoRun (void); |
1147 | 1151 |
1148 void NotifySource2 (double a, int b, float c) { NS_UNUSED(b); NS_UNUSED(c); m_
got2 = a; } | 1152 void NotifySource2 (double a, int b, float c) |
| 1153 {· |
| 1154 NS_UNUSED (b); |
| 1155 NS_UNUSED (c);· |
| 1156 m_got2 = a; |
| 1157 } |
1149 | 1158 |
1150 double m_got2; | 1159 double m_got2; |
1151 }; | 1160 }; |
1152 | 1161 |
1153 TracedCallbackTestCase::TracedCallbackTestCase (std::string description) | 1162 TracedCallbackTestCase::TracedCallbackTestCase (std::string description) |
1154 : TestCase (description) | 1163 : TestCase (description) |
1155 { | 1164 { |
1156 } | 1165 } |
1157 | 1166 |
1158 void | 1167 void |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1212 // =========================================================================== | 1221 // =========================================================================== |
1213 class PointerAttributeTestCase : public TestCase | 1222 class PointerAttributeTestCase : public TestCase |
1214 { | 1223 { |
1215 public: | 1224 public: |
1216 PointerAttributeTestCase (std::string description); | 1225 PointerAttributeTestCase (std::string description); |
1217 virtual ~PointerAttributeTestCase () {} | 1226 virtual ~PointerAttributeTestCase () {} |
1218 | 1227 |
1219 private: | 1228 private: |
1220 virtual void DoRun (void); | 1229 virtual void DoRun (void); |
1221 | 1230 |
1222 void NotifySource2 (double a, int b, float c) { NS_UNUSED(b); NS_UNUSED(c); m_
got2 = a; } | 1231 void NotifySource2 (double a, int b, float c) |
| 1232 {· |
| 1233 NS_UNUSED (b); |
| 1234 NS_UNUSED (c); |
| 1235 m_got2 = a; |
| 1236 } |
1223 | 1237 |
1224 double m_got2; | 1238 double m_got2; |
1225 }; | 1239 }; |
1226 | 1240 |
1227 PointerAttributeTestCase::PointerAttributeTestCase (std::string description) | 1241 PointerAttributeTestCase::PointerAttributeTestCase (std::string description) |
1228 : TestCase (description) | 1242 : TestCase (description) |
1229 { | 1243 { |
1230 } | 1244 } |
1231 | 1245 |
1232 void | 1246 void |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1421 AddTestCase (new ObjectVectorAttributeTestCase ("Check Attributes of type Obje
ctVectorValue"), TestCase::QUICK); | 1435 AddTestCase (new ObjectVectorAttributeTestCase ("Check Attributes of type Obje
ctVectorValue"), TestCase::QUICK); |
1422 AddTestCase (new ObjectMapAttributeTestCase ("Check Attributes of type ObjectM
apValue"), TestCase::QUICK); | 1436 AddTestCase (new ObjectMapAttributeTestCase ("Check Attributes of type ObjectM
apValue"), TestCase::QUICK); |
1423 AddTestCase (new PointerAttributeTestCase ("Check Attributes of type PointerVa
lue"), TestCase::QUICK); | 1437 AddTestCase (new PointerAttributeTestCase ("Check Attributes of type PointerVa
lue"), TestCase::QUICK); |
1424 AddTestCase (new CallbackValueTestCase ("Check Attributes of type CallbackValu
e"), TestCase::QUICK); | 1438 AddTestCase (new CallbackValueTestCase ("Check Attributes of type CallbackValu
e"), TestCase::QUICK); |
1425 AddTestCase (new IntegerTraceSourceAttributeTestCase ("Ensure TracedValue<uint
8_t> can be set like IntegerValue"), TestCase::QUICK); | 1439 AddTestCase (new IntegerTraceSourceAttributeTestCase ("Ensure TracedValue<uint
8_t> can be set like IntegerValue"), TestCase::QUICK); |
1426 AddTestCase (new IntegerTraceSourceTestCase ("Ensure TracedValue<uint8_t> also
works as trace source"), TestCase::QUICK); | 1440 AddTestCase (new IntegerTraceSourceTestCase ("Ensure TracedValue<uint8_t> also
works as trace source"), TestCase::QUICK); |
1427 AddTestCase (new TracedCallbackTestCase ("Ensure TracedCallback<double, int, f
loat> works as trace source"), TestCase::QUICK); | 1441 AddTestCase (new TracedCallbackTestCase ("Ensure TracedCallback<double, int, f
loat> works as trace source"), TestCase::QUICK); |
1428 } | 1442 } |
1429 | 1443 |
1430 static AttributesTestSuite attributesTestSuite; | 1444 static AttributesTestSuite attributesTestSuite; |
LEFT | RIGHT |