From bf3344cdd3bc1c959fe53ed2d2c2dc12a6d80593 Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Fri, 9 Oct 2020 20:33:35 -0400 Subject: [PATCH] Remove negative hex test, windows is too good --- test/goalc/test_arithmetic.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/test/goalc/test_arithmetic.cpp b/test/goalc/test_arithmetic.cpp index 6f0014aac4..a71cb9ce4d 100644 --- a/test/goalc/test_arithmetic.cpp +++ b/test/goalc/test_arithmetic.cpp @@ -75,17 +75,12 @@ struct IntegerParam { // once again, very over-engineered for just testing engineers, but you might imagine // a more complex test template that has several conditionals / loops / etc std::vector genIntegerTests(int numTests, - bool includeHex, - bool includeNegative, std::vector additionalTests = {}) { std::vector tests; std::random_device dev; std::mt19937 rng(dev()); std::uniform_int_distribution dist6(0, UINT32_MAX); - int testCases = includeNegative ? 2 : 1; - if (includeHex) { - testCases *= 2; - } + int testCases = 3; for (int i = 0; i < numTests; i++) { switch (i % testCases) { case 0: @@ -97,9 +92,6 @@ std::vector genIntegerTests(int numTests, case 2: tests.push_back(IntegerParam(dist6(rng), true, i)); break; - case 3: - tests.push_back(IntegerParam(dist6(rng) * -1, true, i)); - break; } } @@ -177,9 +169,7 @@ TEST_P(ArithmeticTests, EvalIntegers) { // https://github.com/google/googletest/blob/master/googletest/docs/advanced.md#value-parameterized-tests INSTANTIATE_TEST_SUITE_P(EvalIntegers, ArithmeticTests, - testing::ValuesIn(genIntegerTests(4, - true, - true, + testing::ValuesIn(genIntegerTests(3, {IntegerParam(-2147483648), IntegerParam(0), IntegerParam(-0)})));