summaryrefslogtreecommitdiff
path: root/tests/preprocessor_tests/identifier_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/preprocessor_tests/identifier_test.cpp')
-rw-r--r--tests/preprocessor_tests/identifier_test.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/preprocessor_tests/identifier_test.cpp b/tests/preprocessor_tests/identifier_test.cpp
index 107cd919..0c30288c 100644
--- a/tests/preprocessor_tests/identifier_test.cpp
+++ b/tests/preprocessor_tests/identifier_test.cpp
@@ -5,15 +5,19 @@
//
#include "gtest/gtest.h"
+
+#include "MockDiagnostics.h"
#include "Preprocessor.h"
#include "Token.h"
static void PreprocessAndVerifyIdentifier(const char* str)
{
- pp::Token token;
- pp::Preprocessor preprocessor;
+ MockDiagnostics diagnostics;
+ pp::Preprocessor preprocessor(&diagnostics);
ASSERT_TRUE(preprocessor.init(1, &str, 0));
- EXPECT_EQ(pp::Token::IDENTIFIER, preprocessor.lex(&token));
+
+ pp::Token token;
+ preprocessor.lex(&token);
EXPECT_EQ(pp::Token::IDENTIFIER, token.type);
EXPECT_STREQ(str, token.value.c_str());
}