Skip to content

Commit 1071dca

Browse files
committed
fixed unused variables, added small test
1 parent 0a7879f commit 1071dca

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

tests/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
set (CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic -std=c++11")
1+
set (CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic")
22

33
add_executable(
44
basics

tests/badData.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ TEST(BadDataTest, BadData) {
4040

4141
unsigned int nhits;
4242

43-
for (int i = 0; i < rects.size(); i++) {
43+
for (unsigned int i = 0; i < rects.size(); i++) {
4444
tree.Insert(rects[i].min, rects[i].max, i);
4545
values.push_back(i);
4646
}
@@ -55,9 +55,9 @@ TEST(BadDataTest, BadData) {
5555
EXPECT_EQ(nhits, 0);
5656

5757
std::vector<Rect> collectedRects = std::vector<Rect>();
58+
std::vector<ValueType> collectedValues = std::vector<ValueType>();
5859

5960
// Iterator test
60-
int itIndex = 0;
6161
MyTree::Iterator it;
6262
for (tree.GetFirst(it); !tree.IsNull(it); tree.GetNext(it)) {
6363
int value = tree.GetAt(it);
@@ -67,13 +67,14 @@ TEST(BadDataTest, BadData) {
6767
it.GetBounds(boundsMin, boundsMax);
6868
collectedRects.push_back(
6969
Rect(boundsMin[0], boundsMin[1], boundsMax[0], boundsMax[1]));
70+
collectedValues.push_back(value);
7071
}
7172

7273
EXPECT_THAT(rects, UnorderedElementsAreArray(collectedRects));
74+
EXPECT_THAT(values, UnorderedElementsAreArray(collectedValues));
75+
collectedValues.clear();
7376

7477
// Iterator test, alternate syntax
75-
std::vector<ValueType> collectedValues = std::vector<ValueType>();
76-
7778
tree.GetFirst(it);
7879
while (!it.IsNull()) {
7980
CoordType value = *it;

0 commit comments

Comments
 (0)