Skip to content

Commit 7640fed

Browse files
committed
Made parameter generation not use testing::Combine
1 parent d5426b9 commit 7640fed

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

tests/testRenderer.cpp

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
11
#include <iostream>
2-
#include <tuple>
3-
4-
#define GTEST_USE_OWN_TR1_TUPLE 0
5-
#define GTEST_ENV_HAS_STD_TUPLE_ 1
2+
#include <vector>
63

74
#include "gtest/gtest.h"
85

96
#include "Renderer.h"
107

8+
using std::vector;
119
using std::make_pair;
1210

13-
using std::tuple;
14-
using std::get;
15-
16-
class CoordinateConversionTest : public ::testing::TestWithParam<tuple<int, int>> {
11+
class CoordinateConversionTest : public ::testing::TestWithParam<Coordinate> {
1712

1813
};
1914

2015
TEST_P(CoordinateConversionTest, IsReversable) {
21-
auto pair = make_pair(get<0>(GetParam()), get<1>(GetParam()));
22-
ASSERT_EQ(pair, screenToCoord(coordToScreen(pair)));
16+
ASSERT_EQ(GetParam(), screenToCoord(coordToScreen(GetParam())));
17+
}
18+
19+
vector<Coordinate> makeInputs() {
20+
vector<Coordinate> ret;
21+
for(int x = -5; x < 5; x++) {
22+
for(int y = -5; y < 5; y++) {
23+
ret.push_back(Coordinate{x, y});
24+
}
25+
}
26+
return std::move(ret);
2327
}
2428

25-
INSTANTIATE_TEST_CASE_P(LargeSquare, CoordinateConversionTest, ::testing::Combine(::testing::Range(-10, 10), ::testing::Range(-10, 10)));
29+
INSTANTIATE_TEST_CASE_P(LargeSquare, CoordinateConversionTest, ::testing::ValuesIn(makeInputs()));

0 commit comments

Comments
 (0)