LEFT | RIGHT |
(no file at all) | |
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) 2012 University of Washington | 3 * Copyright (c) 2012 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 |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
15 * along with this program; if not, write to the Free Software | 15 * along with this program; if not, write to the Free Software |
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 * | 17 * |
18 * Author: Mitch Watrous (watrous@u.washington.edu) | 18 * Author: Mitch Watrous (watrous@u.washington.edu) |
19 */ | 19 */ |
20 | 20 |
21 #include "ns3/test.h" | 21 #include "ns3/test.h" |
22 #include "ns3/config.h" | 22 #include "ns3/config.h" |
23 #include "ns3/double.h" | 23 #include "ns3/double.h" |
24 #include "ns3/random-variable-stream.h" | 24 #include "ns3/random-variable-stream.h" |
25 #include <vector> | 25 #include <vector> |
26 | 26 |
27 using namespace ns3; | 27 using namespace ns3; |
28 | 28 |
29 | 29 |
30 // =========================================================================== | 30 /** |
31 // Test case for one uniform distribution random variable stream generator | 31 * \ingroup core-test |
32 // =========================================================================== | 32 * \ingroup tests |
33 | 33 * |
| 34 * \brief Test case for one uniform distribution random variable stream generato
r |
| 35 */ |
34 class OneUniformRandomVariableManyGetValueCallsTestCase : public TestCase | 36 class OneUniformRandomVariableManyGetValueCallsTestCase : public TestCase |
35 { | 37 { |
36 public: | 38 public: |
37 OneUniformRandomVariableManyGetValueCallsTestCase (); | 39 OneUniformRandomVariableManyGetValueCallsTestCase (); |
38 virtual ~OneUniformRandomVariableManyGetValueCallsTestCase (); | 40 virtual ~OneUniformRandomVariableManyGetValueCallsTestCase (); |
39 | 41 |
40 private: | 42 private: |
41 virtual void DoRun (void); | 43 virtual void DoRun (void); |
42 }; | 44 }; |
43 | 45 |
(...skipping 22 matching lines...) Expand all Loading... |
66 int count = 100000000; | 68 int count = 100000000; |
67 for (int i = 0; i < count; i++) | 69 for (int i = 0; i < count; i++) |
68 { | 70 { |
69 value = uniform->GetValue (); | 71 value = uniform->GetValue (); |
70 | 72 |
71 NS_TEST_ASSERT_MSG_GT (value, min, "Value less than minimum."); | 73 NS_TEST_ASSERT_MSG_GT (value, min, "Value less than minimum."); |
72 NS_TEST_ASSERT_MSG_LT (value, max, "Value greater than maximum."); | 74 NS_TEST_ASSERT_MSG_LT (value, max, "Value greater than maximum."); |
73 } | 75 } |
74 } | 76 } |
75 | 77 |
| 78 /** |
| 79 * \ingroup core-test |
| 80 * \ingroup tests |
| 81 * |
| 82 * \brief Test suite for one uniform distribution random variable stream generat
or |
| 83 */ |
76 class OneUniformRandomVariableManyGetValueCallsTestSuite : public TestSuite | 84 class OneUniformRandomVariableManyGetValueCallsTestSuite : public TestSuite |
77 { | 85 { |
78 public: | 86 public: |
79 OneUniformRandomVariableManyGetValueCallsTestSuite (); | 87 OneUniformRandomVariableManyGetValueCallsTestSuite (); |
80 }; | 88 }; |
81 | 89 |
82 OneUniformRandomVariableManyGetValueCallsTestSuite::OneUniformRandomVariableMany
GetValueCallsTestSuite () | 90 OneUniformRandomVariableManyGetValueCallsTestSuite::OneUniformRandomVariableMany
GetValueCallsTestSuite () |
83 : TestSuite ("one-uniform-random-variable-many-get-value-calls", PERFORMANCE) | 91 : TestSuite ("one-uniform-random-variable-many-get-value-calls", PERFORMANCE) |
84 { | 92 { |
85 AddTestCase (new OneUniformRandomVariableManyGetValueCallsTestCase, TestCase::
QUICK); | 93 AddTestCase (new OneUniformRandomVariableManyGetValueCallsTestCase, TestCase::
QUICK); |
86 } | 94 } |
87 | 95 |
88 static OneUniformRandomVariableManyGetValueCallsTestSuite oneUniformRandomVariab
leManyGetValueCallsTestSuite; | 96 static OneUniformRandomVariableManyGetValueCallsTestSuite oneUniformRandomVariab
leManyGetValueCallsTestSuite; |
LEFT | RIGHT |