#include <gtest/gtest.h>
#include <utils/common/ValueTimeLine.h>
Go to the source code of this file.
Functions | |
| TEST (ValueTimeLine, test_fill_gaps_nobounds) | |
| TEST (ValueTimeLine, test_fill_gaps_withbounds) | |
| TEST (ValueTimeLine, test_overwrite_collect2) | |
| TEST (ValueTimeLine, test_overwrite_nocollect2) | |
| TEST (ValueTimeLine, test_overwrite_collect) | |
| TEST (ValueTimeLine, test_overwrite_nocollect) | |
| TEST (ValueTimeLine, test_get_multi_collect) | |
| TEST (ValueTimeLine, test_get_single_collect) | |
| TEST (ValueTimeLine, test_get_multi_nocollect) | |
| TEST (ValueTimeLine, test_get_single_nocollect) | |
| TEST | ( | ValueTimeLine | , | |
| test_fill_gaps_nobounds | ||||
| ) |
Definition at line 174 of file ValueTimeLineTest.cpp.
References ValueTimeLine< T >::add(), ValueTimeLine< T >::fillGaps(), and ValueTimeLine< T >::getValue().
00174 { 00175 ValueTimeLine<int> vtl; 00176 vtl.add(50, 250, 2); 00177 vtl.fillGaps(4, false); 00178 EXPECT_EQ(4, vtl.getValue(0)) << "The stored number should be returned when asking within the interval."; 00179 EXPECT_EQ(2, vtl.getValue(99)) << "The stored number should be returned when asking within the interval."; 00180 EXPECT_EQ(2, vtl.getValue(50)) << "The stored number should be returned when asking within the interval."; 00181 EXPECT_EQ(2, vtl.getValue(100)) << "The stored number should be returned when asking within the interval."; 00182 EXPECT_EQ(2, vtl.getValue(199)) << "The stored number should be returned when asking within the interval."; 00183 EXPECT_EQ(2, vtl.getValue(150)) << "The stored number should be returned when asking within the interval."; 00184 EXPECT_EQ(2, vtl.getValue(200)) << "The stored number should be returned when asking within the interval."; 00185 EXPECT_EQ(4, vtl.getValue(299)) << "The stored number should be returned when asking within the interval."; 00186 EXPECT_EQ(4, vtl.getValue(250)) << "The stored number should be returned when asking within the interval."; 00187 }
| TEST | ( | ValueTimeLine | , | |
| test_fill_gaps_withbounds | ||||
| ) |
Definition at line 157 of file ValueTimeLineTest.cpp.
References ValueTimeLine< T >::add(), ValueTimeLine< T >::fillGaps(), and ValueTimeLine< T >::getValue().
00157 { 00158 ValueTimeLine<int> vtl; 00159 vtl.add(50, 250, 2); 00160 vtl.fillGaps(4, true); 00161 EXPECT_EQ(2, vtl.getValue(0)) << "The stored number should be returned when asking within the interval."; 00162 EXPECT_EQ(2, vtl.getValue(99)) << "The stored number should be returned when asking within the interval."; 00163 EXPECT_EQ(2, vtl.getValue(50)) << "The stored number should be returned when asking within the interval."; 00164 EXPECT_EQ(2, vtl.getValue(100)) << "The stored number should be returned when asking within the interval."; 00165 EXPECT_EQ(2, vtl.getValue(199)) << "The stored number should be returned when asking within the interval."; 00166 EXPECT_EQ(2, vtl.getValue(150)) << "The stored number should be returned when asking within the interval."; 00167 EXPECT_EQ(2, vtl.getValue(200)) << "The stored number should be returned when asking within the interval."; 00168 EXPECT_EQ(2, vtl.getValue(299)) << "The stored number should be returned when asking within the interval."; 00169 EXPECT_EQ(2, vtl.getValue(250)) << "The stored number should be returned when asking within the interval."; 00170 }
| TEST | ( | ValueTimeLine | , | |
| test_overwrite_collect2 | ||||
| ) |
Definition at line 134 of file ValueTimeLineTest.cpp.
References ValueTimeLine< T >::add(), ValueTimeLine< T >::fillGaps(), and ValueTimeLine< T >::getValue().
00134 { 00135 ValueTimeLine<int> vtl; 00136 vtl.add(50, 250, 2); 00137 vtl.add(0, 100, 1); 00138 vtl.add(200, 300, 3); 00139 vtl.fillGaps(0); 00140 EXPECT_EQ(1, vtl.getValue(0)) << "The stored number should be returned when asking within the interval."; 00141 EXPECT_EQ(1, vtl.getValue(99)) << "The stored number should be returned when asking within the interval."; 00142 EXPECT_EQ(1, vtl.getValue(50)) << "The stored number should be returned when asking within the interval."; 00143 EXPECT_EQ(2, vtl.getValue(100)) << "The stored number should be returned when asking within the interval."; 00144 EXPECT_EQ(2, vtl.getValue(199)) << "The stored number should be returned when asking within the interval."; 00145 EXPECT_EQ(2, vtl.getValue(150)) << "The stored number should be returned when asking within the interval."; 00146 EXPECT_EQ(3, vtl.getValue(200)) << "The stored number should be returned when asking within the interval."; 00147 EXPECT_EQ(3, vtl.getValue(299)) << "The stored number should be returned when asking within the interval."; 00148 EXPECT_EQ(3, vtl.getValue(250)) << "The stored number should be returned when asking within the interval."; 00149 }
| TEST | ( | ValueTimeLine | , | |
| test_overwrite_nocollect2 | ||||
| ) |
Definition at line 117 of file ValueTimeLineTest.cpp.
References ValueTimeLine< T >::add(), and ValueTimeLine< T >::getValue().
00117 { 00118 ValueTimeLine<int> vtl; 00119 vtl.add(50, 250, 2); 00120 vtl.add(0, 100, 1); 00121 vtl.add(200, 300, 3); 00122 EXPECT_EQ(1, vtl.getValue(0)) << "The stored number should be returned when asking within the interval."; 00123 EXPECT_EQ(1, vtl.getValue(99)) << "The stored number should be returned when asking within the interval."; 00124 EXPECT_EQ(1, vtl.getValue(50)) << "The stored number should be returned when asking within the interval."; 00125 EXPECT_EQ(2, vtl.getValue(100)) << "The stored number should be returned when asking within the interval."; 00126 EXPECT_EQ(2, vtl.getValue(199)) << "The stored number should be returned when asking within the interval."; 00127 EXPECT_EQ(2, vtl.getValue(150)) << "The stored number should be returned when asking within the interval."; 00128 EXPECT_EQ(3, vtl.getValue(200)) << "The stored number should be returned when asking within the interval."; 00129 EXPECT_EQ(3, vtl.getValue(299)) << "The stored number should be returned when asking within the interval."; 00130 EXPECT_EQ(3, vtl.getValue(250)) << "The stored number should be returned when asking within the interval."; 00131 }
| TEST | ( | ValueTimeLine | , | |
| test_overwrite_collect | ||||
| ) |
Definition at line 99 of file ValueTimeLineTest.cpp.
References ValueTimeLine< T >::add(), ValueTimeLine< T >::fillGaps(), and ValueTimeLine< T >::getValue().
00099 { 00100 ValueTimeLine<int> vtl; 00101 vtl.add(0, 100, 1); 00102 vtl.add(200, 300, 3); 00103 vtl.add(50, 250, 2); 00104 vtl.fillGaps(0); 00105 EXPECT_EQ(1, vtl.getValue(0)) << "The stored number should be returned when asking within the interval."; 00106 EXPECT_EQ(2, vtl.getValue(99)) << "The stored number should be returned when asking within the interval."; 00107 EXPECT_EQ(2, vtl.getValue(50)) << "The stored number should be returned when asking within the interval."; 00108 EXPECT_EQ(2, vtl.getValue(100)) << "The stored number should be returned when asking within the interval."; 00109 EXPECT_EQ(2, vtl.getValue(199)) << "The stored number should be returned when asking within the interval."; 00110 EXPECT_EQ(2, vtl.getValue(150)) << "The stored number should be returned when asking within the interval."; 00111 EXPECT_EQ(2, vtl.getValue(200)) << "The stored number should be returned when asking within the interval."; 00112 EXPECT_EQ(3, vtl.getValue(299)) << "The stored number should be returned when asking within the interval."; 00113 EXPECT_EQ(3, vtl.getValue(250)) << "The stored number should be returned when asking within the interval."; 00114 }
| TEST | ( | ValueTimeLine | , | |
| test_overwrite_nocollect | ||||
| ) |
Definition at line 82 of file ValueTimeLineTest.cpp.
References ValueTimeLine< T >::add(), and ValueTimeLine< T >::getValue().
00082 { 00083 ValueTimeLine<int> vtl; 00084 vtl.add(0, 100, 1); 00085 vtl.add(200, 300, 3); 00086 vtl.add(50, 250, 2); 00087 EXPECT_EQ(1, vtl.getValue(0)) << "The stored number should be returned when asking within the interval."; 00088 EXPECT_EQ(2, vtl.getValue(99)) << "The stored number should be returned when asking within the interval."; 00089 EXPECT_EQ(2, vtl.getValue(50)) << "The stored number should be returned when asking within the interval."; 00090 EXPECT_EQ(2, vtl.getValue(100)) << "The stored number should be returned when asking within the interval."; 00091 EXPECT_EQ(2, vtl.getValue(199)) << "The stored number should be returned when asking within the interval."; 00092 EXPECT_EQ(2, vtl.getValue(150)) << "The stored number should be returned when asking within the interval."; 00093 EXPECT_EQ(2, vtl.getValue(200)) << "The stored number should be returned when asking within the interval."; 00094 EXPECT_EQ(3, vtl.getValue(299)) << "The stored number should be returned when asking within the interval."; 00095 EXPECT_EQ(3, vtl.getValue(250)) << "The stored number should be returned when asking within the interval."; 00096 }
| TEST | ( | ValueTimeLine | , | |
| test_get_multi_collect | ||||
| ) |
Definition at line 60 of file ValueTimeLineTest.cpp.
References ValueTimeLine< T >::add(), ValueTimeLine< T >::fillGaps(), and ValueTimeLine< T >::getValue().
00060 { 00061 ValueTimeLine<int> vtl; 00062 vtl.add(0, 100, 1); 00063 vtl.add(100, 200, 2); 00064 vtl.add(200, 300, 3); 00065 vtl.fillGaps(0); 00066 EXPECT_EQ(1, vtl.getValue(0)) << "The stored number should be returned when asking within the interval."; 00067 EXPECT_EQ(1, vtl.getValue(99)) << "The stored number should be returned when asking within the interval."; 00068 EXPECT_EQ(1, vtl.getValue(50)) << "The stored number should be returned when asking within the interval."; 00069 EXPECT_EQ(2, vtl.getValue(100)) << "The stored number should be returned when asking within the interval."; 00070 EXPECT_EQ(2, vtl.getValue(199)) << "The stored number should be returned when asking within the interval."; 00071 EXPECT_EQ(2, vtl.getValue(150)) << "The stored number should be returned when asking within the interval."; 00072 EXPECT_EQ(3, vtl.getValue(200)) << "The stored number should be returned when asking within the interval."; 00073 EXPECT_EQ(3, vtl.getValue(299)) << "The stored number should be returned when asking within the interval."; 00074 EXPECT_EQ(3, vtl.getValue(250)) << "The stored number should be returned when asking within the interval."; 00075 }
| TEST | ( | ValueTimeLine | , | |
| test_get_single_collect | ||||
| ) |
Definition at line 50 of file ValueTimeLineTest.cpp.
References ValueTimeLine< T >::add(), ValueTimeLine< T >::fillGaps(), and ValueTimeLine< T >::getValue().
00050 { 00051 ValueTimeLine<int> vtl; 00052 vtl.add(0, 100, 2); 00053 vtl.fillGaps(0); 00054 EXPECT_EQ(2, vtl.getValue(0)) << "The stored number should be returned when asking within the interval."; 00055 EXPECT_EQ(2, vtl.getValue(99)) << "The stored number should be returned when asking within the interval."; 00056 EXPECT_EQ(2, vtl.getValue(50)) << "The stored number should be returned when asking within the interval."; 00057 }
| TEST | ( | ValueTimeLine | , | |
| test_get_multi_nocollect | ||||
| ) |
Definition at line 33 of file ValueTimeLineTest.cpp.
References ValueTimeLine< T >::add(), and ValueTimeLine< T >::getValue().
00033 { 00034 ValueTimeLine<int> vtl; 00035 vtl.add(0, 100, 1); 00036 vtl.add(100, 200, 2); 00037 vtl.add(200, 300, 3); 00038 EXPECT_EQ(1, vtl.getValue(0)) << "The stored number should be returned when asking within the interval."; 00039 EXPECT_EQ(1, vtl.getValue(99)) << "The stored number should be returned when asking within the interval."; 00040 EXPECT_EQ(1, vtl.getValue(50)) << "The stored number should be returned when asking within the interval."; 00041 EXPECT_EQ(2, vtl.getValue(100)) << "The stored number should be returned when asking within the interval."; 00042 EXPECT_EQ(2, vtl.getValue(199)) << "The stored number should be returned when asking within the interval."; 00043 EXPECT_EQ(2, vtl.getValue(150)) << "The stored number should be returned when asking within the interval."; 00044 EXPECT_EQ(3, vtl.getValue(200)) << "The stored number should be returned when asking within the interval."; 00045 EXPECT_EQ(3, vtl.getValue(299)) << "The stored number should be returned when asking within the interval."; 00046 EXPECT_EQ(3, vtl.getValue(250)) << "The stored number should be returned when asking within the interval."; 00047 }
| TEST | ( | ValueTimeLine | , | |
| test_get_single_nocollect | ||||
| ) |
Definition at line 24 of file ValueTimeLineTest.cpp.
References ValueTimeLine< T >::add(), and ValueTimeLine< T >::getValue().
00024 { 00025 ValueTimeLine<int> vtl; 00026 vtl.add(0, 100, 2); 00027 EXPECT_EQ(2, vtl.getValue(0)) << "The stored number should be returned when asking within the interval."; 00028 EXPECT_EQ(2, vtl.getValue(99)) << "The stored number should be returned when asking within the interval."; 00029 EXPECT_EQ(2, vtl.getValue(50)) << "The stored number should be returned when asking within the interval."; 00030 }
1.5.6