diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-07-18 08:24:24 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-07-18 08:24:24 +0200 |
commit | fc61780b35af913801d72086456f493f63197da6 (patch) | |
tree | f85891288a7bd988da9f0f15ae64e5c63f00d493 /gfx/angle/src/tests/preprocessor_tests | |
parent | 69f7f9e5f1475891ce11cc4f431692f965b0cd30 (diff) | |
parent | 50d3e596bbe89c95615f96eb71f6bc5be737a1db (diff) | |
download | UXP-2018.07.18.tar UXP-2018.07.18.tar.gz UXP-2018.07.18.tar.lz UXP-2018.07.18.tar.xz UXP-2018.07.18.zip |
Merge commit '50d3e596bbe89c95615f96eb71f6bc5be737a1db' into Basilisk-releasev2018.07.18
# Conflicts:
# browser/app/profile/firefox.js
# browser/components/preferences/jar.mn
Diffstat (limited to 'gfx/angle/src/tests/preprocessor_tests')
-rwxr-xr-x | gfx/angle/src/tests/preprocessor_tests/define_test.cpp | 49 | ||||
-rwxr-xr-x | gfx/angle/src/tests/preprocessor_tests/if_test.cpp | 94 |
2 files changed, 1 insertions, 142 deletions
diff --git a/gfx/angle/src/tests/preprocessor_tests/define_test.cpp b/gfx/angle/src/tests/preprocessor_tests/define_test.cpp index e074d1982..b95a6b4e8 100755 --- a/gfx/angle/src/tests/preprocessor_tests/define_test.cpp +++ b/gfx/angle/src/tests/preprocessor_tests/define_test.cpp @@ -938,51 +938,4 @@ TEST_F(DefineTest, NegativeShiftInLineDirective) EXPECT_CALL(mDiagnostics, print(pp::Diagnostics::PP_UNDEFINED_SHIFT, _, _)).Times(4); EXPECT_CALL(mDiagnostics, print(pp::Diagnostics::PP_INVALID_LINE_NUMBER, _, _)).Times(2); preprocess(input, expected); -} - -// Undefining a macro in its invocation parameters produces and error -TEST_F(DefineTest, UndefineInInvocation) -{ - const char *input = - "#define G(a, b) a b\n" - "G(\n" - "#undef G\n" - "1, 2)\n"; - const char *expected = "\n\n\n1 2\n"; - - EXPECT_CALL(mDiagnostics, print(pp::Diagnostics::PP_MACRO_UNDEFINED_WHILE_INVOKED, - pp::SourceLocation(0, 3), _)); - - preprocess(input, expected); -} - -// Undefining a macro before its invocation parameters produces and error -TEST_F(DefineTest, UndefineInInvocationPreLParen) -{ - const char *input = - "#define G(a, b) a b\n" - "G\n" - "#undef G\n" - "(1, 2)\n"; - const char *expected = "\n\n\n1 2\n"; - - EXPECT_CALL(mDiagnostics, print(pp::Diagnostics::PP_MACRO_UNDEFINED_WHILE_INVOKED, - pp::SourceLocation(0, 3), _)); - - preprocess(input, expected); -} - -// The name of the macro "a" is inside an incomplete macro invocation of macro "m()" in its own -// expansion. This should not result in infinite recursion. -TEST_F(DefineTest, RecursiveMacroNameInsideIncompleteMacroInvocationInMacroExpansion) -{ - const char *input = - "#define m(a)\n" - "#define a m((a)\n" - "a)\n"; - const char *expected = - "\n" - "\n" - "\n"; - preprocess(input, expected); -} +}
\ No newline at end of file diff --git a/gfx/angle/src/tests/preprocessor_tests/if_test.cpp b/gfx/angle/src/tests/preprocessor_tests/if_test.cpp index 7940b564a..27bfbbbb4 100755 --- a/gfx/angle/src/tests/preprocessor_tests/if_test.cpp +++ b/gfx/angle/src/tests/preprocessor_tests/if_test.cpp @@ -952,97 +952,3 @@ TEST_F(IfTest, UnterminatedDefinedInMacro2) pp::Token token; mPreprocessor.lex(&token); } - -// Undefined shift: negative shift offset. -TEST_F(IfTest, BitShiftLeftOperatorNegativeOffset) -{ - const char *str = - "#if 2 << -1 == 1\n" - "foo\n" - "#endif\n"; - ASSERT_TRUE(mPreprocessor.init(1, &str, 0)); - - EXPECT_CALL(mDiagnostics, - print(pp::Diagnostics::PP_UNDEFINED_SHIFT, pp::SourceLocation(0, 1), "2 << -1")); - - pp::Token token; - mPreprocessor.lex(&token); -} - -// Undefined shift: shift offset is out of range. -TEST_F(IfTest, BitShiftLeftOperatorOffset32) -{ - const char *str = - "#if 2 << 32 == 1\n" - "foo\n" - "#endif\n"; - ASSERT_TRUE(mPreprocessor.init(1, &str, 0)); - - EXPECT_CALL(mDiagnostics, - print(pp::Diagnostics::PP_UNDEFINED_SHIFT, pp::SourceLocation(0, 1), "2 << 32")); - - pp::Token token; - mPreprocessor.lex(&token); -} - -// Left hand side of shift is negative. -TEST_F(IfTest, BitShiftLeftOperatorNegativeLHS) -{ - const char *str = - "#if (-2) << 1 == -4\n" - "pass\n" - "#endif\n"; - const char *expected = - "\n" - "pass\n" - "\n"; - - preprocess(str, expected); -} - -// Undefined shift: shift offset is out of range. -TEST_F(IfTest, BitShiftRightOperatorNegativeOffset) -{ - const char *str = - "#if 2 >> -1 == 4\n" - "foo\n" - "#endif\n"; - ASSERT_TRUE(mPreprocessor.init(1, &str, 0)); - - EXPECT_CALL(mDiagnostics, - print(pp::Diagnostics::PP_UNDEFINED_SHIFT, pp::SourceLocation(0, 1), "2 >> -1")); - - pp::Token token; - mPreprocessor.lex(&token); -} - -// Undefined shift: shift offset is out of range. -TEST_F(IfTest, BitShiftRightOperatorOffset32) -{ - const char *str = - "#if 2 >> 32 == 0\n" - "foo\n" - "#endif\n"; - ASSERT_TRUE(mPreprocessor.init(1, &str, 0)); - - EXPECT_CALL(mDiagnostics, - print(pp::Diagnostics::PP_UNDEFINED_SHIFT, pp::SourceLocation(0, 1), "2 >> 32")); - - pp::Token token; - mPreprocessor.lex(&token); -} - -// Left hand side of shift is negative. -TEST_F(IfTest, BitShiftRightOperatorNegativeLHS) -{ - const char *str = - "#if (-2) >> 1 == 0x7fffffff\n" - "pass\n" - "#endif\n"; - const char *expected = - "\n" - "pass\n" - "\n"; - - preprocess(str, expected); -} |