Commit 484730bc by alokp@chromium.org

Removed the unnecessary usage of GTEST_HAS_PARAM_TEST and GTEST_HAS_COMBINE. I…

Removed the unnecessary usage of GTEST_HAS_PARAM_TEST and GTEST_HAS_COMBINE. I would rather have tests fail to compile than be silently ignored. git-svn-id: https://angleproject.googlecode.com/svn/trunk@1098 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent fc8b7200
......@@ -10,8 +10,6 @@
#include "PreprocessorTest.h"
#include "Token.h"
#if GTEST_HAS_PARAM_TEST
class CharTest : public PreprocessorTest,
public testing::WithParamInterface<int>
{
......@@ -98,4 +96,3 @@ TEST_P(CharTest, Identified)
INSTANTIATE_TEST_CASE_P(All, CharTest,
testing::Range(CHAR_MIN, CHAR_MAX + 1));
#endif // GTEST_HAS_PARAM_TEST
......@@ -7,8 +7,6 @@
#include "PreprocessorTest.h"
#include "Token.h"
#if GTEST_HAS_PARAM_TEST
class CommentTest : public PreprocessorTest,
public testing::WithParamInterface<const char*>
{
......@@ -40,8 +38,6 @@ INSTANTIATE_TEST_CASE_P(BlockComment, CommentTest,
"/***/", // With lone '*'.
"/*\"*/")); // Invalid character.
#endif // GTEST_HAS_PARAM_TEST
class BlockCommentTest : public PreprocessorTest
{
};
......
......@@ -73,8 +73,6 @@ TEST_F(ExtensionTest, MissingNewline)
preprocess(str);
}
#if GTEST_HAS_PARAM_TEST
struct ExtensionTestParam
{
const char* str;
......@@ -109,5 +107,3 @@ static const ExtensionTestParam kParams[] = {
{"#extension foo : bar baz\n", pp::Diagnostics::UNEXPECTED_TOKEN}
};
INSTANTIATE_TEST_CASE_P(All, InvalidExtensionTest, testing::ValuesIn(kParams));
#endif // GTEST_HAS_PARAM_TEST
\ No newline at end of file
......@@ -7,6 +7,8 @@
#include "PreprocessorTest.h"
#include "Token.h"
#define CLOSED_RANGE(x, y) testing::Range(x, static_cast<char>((y) + 1))
class IdentifierTest : public PreprocessorTest
{
protected:
......@@ -22,10 +24,6 @@ protected:
}
};
#if GTEST_HAS_PARAM_TEST
#define CLOSED_RANGE(x, y) testing::Range(x, static_cast<char>((y) + 1))
class SingleLetterIdentifierTest : public IdentifierTest,
public testing::WithParamInterface<char>
{
......@@ -53,10 +51,6 @@ INSTANTIATE_TEST_CASE_P(A_Z,
SingleLetterIdentifierTest,
CLOSED_RANGE('A', 'Z'));
#endif // GTEST_HAS_PARAM_TEST
#if GTEST_HAS_COMBINE
typedef std::tr1::tuple<char, char> IdentifierParams;
class DoubleLetterIdentifierTest :
public IdentifierTest,
......@@ -146,8 +140,6 @@ INSTANTIATE_TEST_CASE_P(A_Z_0_9,
testing::Combine(CLOSED_RANGE('A', 'Z'),
CLOSED_RANGE('0', '9')));
#endif // GTEST_HAS_COMBINE
// The tests above cover one-letter and various combinations of two-letter
// identifier names. This test covers all characters in a single string.
TEST_F(IdentifierTest, AllLetters)
......
......@@ -7,7 +7,7 @@
#include "PreprocessorTest.h"
#include "Token.h"
#if GTEST_HAS_PARAM_TEST
#define CLOSED_RANGE(x, y) testing::Range(x, static_cast<char>((y) + 1))
class InvalidNumberTest : public PreprocessorTest,
public testing::WithParamInterface<const char*>
......@@ -33,10 +33,6 @@ INSTANTIATE_TEST_CASE_P(InvalidIntegers, InvalidNumberTest,
INSTANTIATE_TEST_CASE_P(InvalidFloats, InvalidNumberTest,
testing::Values("1eg", "0.a", "0.1.2", ".0a", ".0.1"));
#endif // GTEST_HAS_PARAM_TEST
#if GTEST_HAS_COMBINE
typedef std::tr1::tuple<const char*, char> IntegerParams;
class IntegerTest : public PreprocessorTest,
public testing::WithParamInterface<IntegerParams>
......@@ -57,8 +53,6 @@ TEST_P(IntegerTest, Identified)
EXPECT_EQ(str, token.value);
}
#define CLOSED_RANGE(x, y) testing::Range(x, static_cast<char>((y) + 1))
INSTANTIATE_TEST_CASE_P(DecimalInteger,
IntegerTest,
testing::Combine(testing::Values(""),
......@@ -167,8 +161,6 @@ INSTANTIATE_TEST_CASE_P(FloatFraction_X_0,
testing::Combine(CLOSED_RANGE('0', '9'),
testing::Values('\0')));
#endif // GTEST_HAS_COMBINE
// In the tests above we have tested individual parts of a float separately.
// This test has all parts of a float.
TEST_F(FloatTest, FractionScientific)
......
......@@ -7,8 +7,6 @@
#include "PreprocessorTest.h"
#include "Token.h"
#if GTEST_HAS_PARAM_TEST
struct OperatorTestParam
{
const char* str;
......@@ -80,4 +78,3 @@ static const OperatorTestParam kOperators[] = {
INSTANTIATE_TEST_CASE_P(All, OperatorTest,
testing::ValuesIn(kOperators));
#endif // GTEST_HAS_PARAM_TEST
......@@ -101,8 +101,6 @@ TEST_F(PragmaTest, MissingNewline)
preprocess(str);
}
#if GTEST_HAS_PARAM_TEST
class InvalidPragmaTest : public PragmaTest,
public testing::WithParamInterface<const char*>
{
......@@ -130,5 +128,3 @@ INSTANTIATE_TEST_CASE_P(All, InvalidPragmaTest, testing::Values(
"#pragma foo(bar\n", // Missing right paren.
"#pragma foo bar\n", // Missing parens.
"#pragma foo(bar) baz\n")); // Extra tokens.
#endif // GTEST_HAS_PARAM_TEST
\ No newline at end of file
......@@ -29,8 +29,6 @@ class SpaceTest : public PreprocessorTest
// Note that newline characters (\n) will be tested separately.
static const char kSpaceChars[] = {' ', '\t', '\v', '\f'};
#if GTEST_HAS_PARAM_TEST
// This test fixture tests the processing of a single whitespace character.
// All tests in this fixture are ran with all possible whitespace character
// allowed in GLSL.
......@@ -52,10 +50,6 @@ INSTANTIATE_TEST_CASE_P(SingleSpaceChar,
SpaceCharTest,
testing::ValuesIn(kSpaceChars));
#endif // GTEST_HAS_PARAM_TEST
#if GTEST_HAS_COMBINE
// This test fixture tests the processing of a string containing consecutive
// whitespace characters. All tests in this fixture are ran with all possible
// combinations of whitespace characters allowed in GLSL.
......@@ -83,8 +77,6 @@ INSTANTIATE_TEST_CASE_P(SpaceCharCombination,
testing::ValuesIn(kSpaceChars),
testing::ValuesIn(kSpaceChars)));
#endif // GTEST_HAS_COMBINE
// The tests above make sure that the space char is recorded in the
// next token. This test makes sure that a token is not incorrectly marked
// to have leading space.
......
......@@ -70,8 +70,6 @@ TEST_F(VersionTest, MissingNewline)
lex();
}
#if GTEST_HAS_PARAM_TEST
struct VersionTestParam
{
const char* str;
......@@ -104,5 +102,3 @@ static const VersionTestParam kParams[] = {
};
INSTANTIATE_TEST_CASE_P(All, InvalidVersionTest, testing::ValuesIn(kParams));
#endif // GTEST_HAS_PARAM_TEST
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment