Commit 36124de8 by alokp@chromium.org

Implemented #error and #pragma directives. Added new tests and updated old ones…

Implemented #error and #pragma directives. Added new tests and updated old ones for the new preprocessor API. Review URL: https://codereview.appspot.com/6213066 git-svn-id: https://angleproject.googlecode.com/svn/trunk@1094 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 07d921de
......@@ -18,6 +18,8 @@
'sources': [
'compiler/preprocessor/new/Diagnostics.cpp',
'compiler/preprocessor/new/Diagnostics.h',
'compiler/preprocessor/new/DirectiveHandler.cpp',
'compiler/preprocessor/new/DirectiveHandler.h',
'compiler/preprocessor/new/DirectiveParser.cpp',
'compiler/preprocessor/new/DirectiveParser.h',
'compiler/preprocessor/new/ExpressionParser.cpp',
......
......@@ -36,6 +36,7 @@ class Diagnostics
ERROR_END,
WARNING_BEGIN,
UNRECOGNIZED_PRAGMA,
WARNING_END
};
......
//
// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "DirectiveHandler.h"
namespace pp
{
DirectiveHandler::~DirectiveHandler()
{
}
} // namespace pp
//
// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#ifndef COMPILER_PREPROCESSOR_DIRECTIVE_HANDLER_H_
#define COMPILER_PREPROCESSOR_DIRECTIVE_HANDLER_H_
#include <string>
namespace pp
{
struct SourceLocation;
// Base class for handling directives.
// Preprocessor uses this class to notify the clients about certain
// preprocessor directives. Derived classes are responsible for
// handling them in an appropriate manner.
class DirectiveHandler
{
public:
virtual ~DirectiveHandler();
virtual void handleError(const SourceLocation& loc,
const std::string& msg) = 0;
// Handle pragma of form: #pragma name[(value)]
virtual void handlePragma(const SourceLocation& loc,
const std::string& name,
const std::string& value) = 0;
};
} // namespace pp
#endif // COMPILER_PREPROCESSOR_DIRECTIVE_HANDLER_H_
......@@ -7,8 +7,10 @@
#include "DirectiveParser.h"
#include <cassert>
#include <sstream>
#include "Diagnostics.h"
#include "DirectiveHandler.h"
#include "ExpressionParser.h"
#include "MacroExpander.h"
#include "Token.h"
......@@ -64,10 +66,12 @@ class DefinedParser : public Lexer
DirectiveParser::DirectiveParser(Tokenizer* tokenizer,
MacroSet* macroSet,
Diagnostics* diagnostics) :
Diagnostics* diagnostics,
DirectiveHandler* directiveHandler) :
mTokenizer(tokenizer),
mMacroSet(macroSet),
mDiagnostics(diagnostics)
mDiagnostics(diagnostics),
mDirectiveHandler(directiveHandler)
{
}
......@@ -279,16 +283,73 @@ void DirectiveParser::parseEndif(Token* token)
void DirectiveParser::parseError(Token* token)
{
// TODO(alokp): Implement me.
assert(token->value == kDirectiveError);
std::stringstream stream;
mTokenizer->lex(token);
while ((token->type != '\n') && (token->type != pp::Token::LAST))
{
stream << *token;
mTokenizer->lex(token);
}
mDirectiveHandler->handleError(token->location, stream.str());
}
// Parses pragma of form: #pragma name[(value)].
void DirectiveParser::parsePragma(Token* token)
{
// TODO(alokp): Implement me.
assert(token->value == kDirectivePragma);
enum State
{
PRAGMA_NAME,
LEFT_PAREN,
PRAGMA_VALUE,
RIGHT_PAREN
};
bool valid = true;
std::string name, value;
int state = PRAGMA_NAME;
mTokenizer->lex(token);
while ((token->type != '\n') && (token->type != pp::Token::LAST))
{
switch(state++)
{
case PRAGMA_NAME:
name = token->value;
valid = valid && (token->type == pp::Token::IDENTIFIER);
break;
case LEFT_PAREN:
valid = valid && (token->type == '(');
break;
case PRAGMA_VALUE:
value = token->value;
valid = valid && (token->type == pp::Token::IDENTIFIER);
break;
case RIGHT_PAREN:
valid = valid && (token->type == ')');
break;
default:
valid = false;
break;
}
mTokenizer->lex(token);
}
valid = valid && ((state == PRAGMA_NAME) || // Empty pragma.
(state == LEFT_PAREN) || // Without value.
(state == RIGHT_PAREN + 1)); // With value.
if (!valid)
{
mDiagnostics->report(Diagnostics::UNRECOGNIZED_PRAGMA,
token->location, name);
}
else if (state > PRAGMA_NAME) // Do not notify for empty pragma.
{
mDirectiveHandler->handlePragma(token->location, name, value);
}
}
void DirectiveParser::parseExtension(Token* token)
......
......@@ -15,6 +15,7 @@ namespace pp
{
class Diagnostics;
class DirectiveHandler;
class Tokenizer;
class DirectiveParser : public Lexer
......@@ -22,7 +23,8 @@ class DirectiveParser : public Lexer
public:
DirectiveParser(Tokenizer* tokenizer,
MacroSet* macroSet,
Diagnostics* diagnostics);
Diagnostics* diagnostics,
DirectiveHandler* directiveHandler);
virtual void lex(Token* token);
......@@ -47,6 +49,7 @@ class DirectiveParser : public Lexer
Tokenizer* mTokenizer;
MacroSet* mMacroSet;
Diagnostics* mDiagnostics;
DirectiveHandler* mDirectiveHandler;
};
} // namespace pp
......
......@@ -11,11 +11,11 @@
namespace pp
{
Preprocessor::Preprocessor(Diagnostics* diagnostics) :
mDiagnostics(diagnostics),
mTokenizer(mDiagnostics),
mDirectiveParser(&mTokenizer, &mMacroSet, mDiagnostics),
mMacroExpander(&mDirectiveParser, &mMacroSet, mDiagnostics)
Preprocessor::Preprocessor(Diagnostics* diagnostics,
DirectiveHandler* directiveHandler) :
mTokenizer(diagnostics),
mDirectiveParser(&mTokenizer, &mMacroSet, diagnostics, directiveHandler),
mMacroExpander(&mDirectiveParser, &mMacroSet, diagnostics)
{
}
......
......@@ -16,11 +16,12 @@ namespace pp
{
class Diagnostics;
class DirectiveHandler;
class Preprocessor
{
public:
Preprocessor(Diagnostics* diagnostics);
Preprocessor(Diagnostics* diagnostics, DirectiveHandler* directiveHandler);
// count: specifies the number of elements in the string and length arrays.
// string: specifies an array of pointers to strings.
......@@ -38,8 +39,6 @@ class Preprocessor
private:
PP_DISALLOW_COPY_AND_ASSIGN(Preprocessor);
Diagnostics* mDiagnostics;
MacroSet mMacroSet;
Tokenizer mTokenizer;
DirectiveParser mDirectiveParser;
......
......@@ -44,12 +44,15 @@
'../third_party/googlemock/src/gmock_main.cc',
'preprocessor_tests/char_test.cpp',
'preprocessor_tests/comment_test.cpp',
'preprocessor_tests/error_test.cpp',
'preprocessor_tests/identifier_test.cpp',
'preprocessor_tests/input_test.cpp',
'preprocessor_tests/location_test.cpp',
'preprocessor_tests/MockDiagnostics.h',
'preprocessor_tests/MockDirectiveHandler.h',
'preprocessor_tests/number_test.cpp',
'preprocessor_tests/operator_test.cpp',
'preprocessor_tests/pragma_test.cpp',
'preprocessor_tests/token_test.cpp',
'preprocessor_tests/space_test.cpp',
],
......
//
// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#ifndef PREPROCESSOR_TESTS_MOCK_DIRECTIVE_HANDLER_H_
#define PREPROCESSOR_TESTS_MOCK_DIRECTIVE_HANDLER_H_
#include "gmock/gmock.h"
#include "DirectiveHandler.h"
class MockDirectiveHandler : public pp::DirectiveHandler
{
public:
MOCK_METHOD2(handleError,
void(const pp::SourceLocation& loc, const std::string& msg));
MOCK_METHOD3(handlePragma,
void(const pp::SourceLocation& loc,
const std::string& name,
const std::string& value));
};
#endif // PREPROCESSOR_TESTS_MOCK_DIRECTIVE_HANDLER_H_
......@@ -10,6 +10,7 @@
#include "gtest/gtest.h"
#include "MockDiagnostics.h"
#include "MockDirectiveHandler.h"
#include "Preprocessor.h"
#include "Token.h"
......@@ -50,7 +51,8 @@ TEST_P(CharTest, Identified)
int length = 1;
MockDiagnostics diagnostics;
pp::Preprocessor preprocessor(&diagnostics);
MockDirectiveHandler directiveHandler;
pp::Preprocessor preprocessor(&diagnostics, &directiveHandler);
// Note that we pass the length param as well because the invalid
// string may contain the null character.
ASSERT_TRUE(preprocessor.init(1, &cstr, &length));
......
......@@ -7,6 +7,7 @@
#include "gtest/gtest.h"
#include "MockDiagnostics.h"
#include "MockDirectiveHandler.h"
#include "Preprocessor.h"
#include "Token.h"
......@@ -19,7 +20,8 @@ TEST_P(CommentTest, CommentIgnored)
const char* str = GetParam();
MockDiagnostics diagnostics;
pp::Preprocessor preprocessor(&diagnostics);
MockDirectiveHandler directiveHandler;
pp::Preprocessor preprocessor(&diagnostics, &directiveHandler);
ASSERT_TRUE(preprocessor.init(1, &str, 0));
pp::Token token;
......@@ -47,7 +49,8 @@ TEST(BlockComment, CommentReplacedWithSpace)
const char* str = "/*foo*/bar";
MockDiagnostics diagnostics;
pp::Preprocessor preprocessor(&diagnostics);
MockDirectiveHandler directiveHandler;
pp::Preprocessor preprocessor(&diagnostics, &directiveHandler);
ASSERT_TRUE(preprocessor.init(1, &str, 0));
pp::Token token;
......@@ -62,7 +65,8 @@ TEST(BlockComment, UnterminatedComment)
const char* str = "/*foo";
MockDiagnostics diagnostics;
pp::Preprocessor preprocessor(&diagnostics);
MockDirectiveHandler directiveHandler;
pp::Preprocessor preprocessor(&diagnostics, &directiveHandler);
ASSERT_TRUE(preprocessor.init(1, &str, 0));
using testing::_;
......
//
// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "gtest/gtest.h"
#include "MockDiagnostics.h"
#include "MockDirectiveHandler.h"
#include "Preprocessor.h"
#include "Token.h"
class ErrorTest : public testing::Test
{
protected:
ErrorTest() : mPreprocessor(&mDiagnostics, &mDirectiveHandler) { }
void lex()
{
pp::Token token;
mPreprocessor.lex(&token);
EXPECT_EQ(pp::Token::LAST, token.type);
EXPECT_EQ("", token.value);
}
MockDiagnostics mDiagnostics;
MockDirectiveHandler mDirectiveHandler;
pp::Preprocessor mPreprocessor;
};
TEST_F(ErrorTest, Empty)
{
const char* str = "#error\n";
ASSERT_TRUE(mPreprocessor.init(1, &str, NULL));
using testing::_;
EXPECT_CALL(mDirectiveHandler, handleError(pp::SourceLocation(0, 1), ""));
// No error or warning.
EXPECT_CALL(mDiagnostics, print(_, _, _)).Times(0);
lex();
}
TEST_F(ErrorTest, OneTokenMessage)
{
const char* str = "#error foo\n";
ASSERT_TRUE(mPreprocessor.init(1, &str, NULL));
using testing::_;
EXPECT_CALL(mDirectiveHandler,
handleError(pp::SourceLocation(0, 1), " foo"));
// No error or warning.
EXPECT_CALL(mDiagnostics, print(_, _, _)).Times(0);
lex();
}
TEST_F(ErrorTest, TwoTokenMessage)
{
const char* str = "#error foo bar\n";
ASSERT_TRUE(mPreprocessor.init(1, &str, NULL));
using testing::_;
EXPECT_CALL(mDirectiveHandler,
handleError(pp::SourceLocation(0, 1), " foo bar"));
// No error or warning.
EXPECT_CALL(mDiagnostics, print(_, _, _)).Times(0);
lex();
}
TEST_F(ErrorTest, Comments)
{
const char* str = "/*foo*/"
"#"
"/*foo*/"
"error"
"/*foo*/"
"foo"
"/*foo*/"
"bar"
"/*foo*/"
"//foo"
"\n";
ASSERT_TRUE(mPreprocessor.init(1, &str, NULL));
using testing::_;
EXPECT_CALL(mDirectiveHandler,
handleError(pp::SourceLocation(0, 1), " foo bar"));
// No error or warning.
EXPECT_CALL(mDiagnostics, print(_, _, _)).Times(0);
lex();
}
TEST_F(ErrorTest, MissingNewline)
{
const char* str = "#error foo";
ASSERT_TRUE(mPreprocessor.init(1, &str, NULL));
using testing::_;
// Directive successfully parsed.
EXPECT_CALL(mDirectiveHandler,
handleError(pp::SourceLocation(0, 1), " foo"));
// Error reported about EOF.
EXPECT_CALL(mDiagnostics, print(pp::Diagnostics::EOF_IN_DIRECTIVE, _, _));
lex();
}
......@@ -7,13 +7,15 @@
#include "gtest/gtest.h"
#include "MockDiagnostics.h"
#include "MockDirectiveHandler.h"
#include "Preprocessor.h"
#include "Token.h"
static void PreprocessAndVerifyIdentifier(const char* str)
{
MockDiagnostics diagnostics;
pp::Preprocessor preprocessor(&diagnostics);
MockDirectiveHandler directiveHandler;
pp::Preprocessor preprocessor(&diagnostics, &directiveHandler);
ASSERT_TRUE(preprocessor.init(1, &str, 0));
pp::Token token;
......
......@@ -7,20 +7,23 @@
#include "gtest/gtest.h"
#include "MockDiagnostics.h"
#include "MockDirectiveHandler.h"
#include "Preprocessor.h"
#include "Token.h"
TEST(InputTest, NegativeCount)
{
MockDiagnostics diagnostics;
pp::Preprocessor preprocessor(&diagnostics);
MockDirectiveHandler directiveHandler;
pp::Preprocessor preprocessor(&diagnostics, &directiveHandler);
EXPECT_FALSE(preprocessor.init(-1, NULL, NULL));
}
TEST(InputTest, ZeroCount)
{
MockDiagnostics diagnostics;
pp::Preprocessor preprocessor(&diagnostics);
MockDirectiveHandler directiveHandler;
pp::Preprocessor preprocessor(&diagnostics, &directiveHandler);
EXPECT_TRUE(preprocessor.init(0, NULL, NULL));
pp::Token token;
......@@ -31,7 +34,8 @@ TEST(InputTest, ZeroCount)
TEST(InputTest, NullString)
{
MockDiagnostics diagnostics;
pp::Preprocessor preprocessor(&diagnostics);
MockDirectiveHandler directiveHandler;
pp::Preprocessor preprocessor(&diagnostics, &directiveHandler);
EXPECT_FALSE(preprocessor.init(1, NULL, NULL));
}
......
......@@ -5,7 +5,9 @@
//
#include "gtest/gtest.h"
#include "MockDiagnostics.h"
#include "MockDirectiveHandler.h"
#include "Preprocessor.h"
#include "Token.h"
......@@ -15,7 +17,8 @@ static void PreprocessAndVerifyLocation(int count,
const pp::SourceLocation& location)
{
MockDiagnostics diagnostics;
pp::Preprocessor preprocessor(&diagnostics);
MockDirectiveHandler directiveHandler;
pp::Preprocessor preprocessor(&diagnostics, &directiveHandler);
ASSERT_TRUE(preprocessor.init(count, string, length));
pp::Token token;
......@@ -87,7 +90,8 @@ TEST(LocationTest, ErrorLocationAfterComment)
const char* str = "/*\n\n*/@";
MockDiagnostics diagnostics;
pp::Preprocessor preprocessor(&diagnostics);
MockDirectiveHandler directiveHandler;
pp::Preprocessor preprocessor(&diagnostics, &directiveHandler);
ASSERT_TRUE(preprocessor.init(1, &str, 0));
pp::Diagnostics::ID id(pp::Diagnostics::INVALID_CHARACTER);
......
......@@ -7,6 +7,7 @@
#include "gtest/gtest.h"
#include "MockDiagnostics.h"
#include "MockDirectiveHandler.h"
#include "Preprocessor.h"
#include "Token.h"
......@@ -21,7 +22,8 @@ TEST_P(InvalidNumberTest, InvalidNumberIdentified)
const char* str = GetParam();
MockDiagnostics diagnostics;
pp::Preprocessor preprocessor(&diagnostics);
MockDirectiveHandler directiveHandler;
pp::Preprocessor preprocessor(&diagnostics, &directiveHandler);
ASSERT_TRUE(preprocessor.init(1, &str, 0));
using testing::_;
......@@ -54,7 +56,8 @@ TEST_P(IntegerTest, IntegerIdentified)
const char* cstr = str.c_str();
MockDiagnostics diagnostics;
pp::Preprocessor preprocessor(&diagnostics);
MockDirectiveHandler directiveHandler;
pp::Preprocessor preprocessor(&diagnostics, &directiveHandler);
ASSERT_TRUE(preprocessor.init(1, &cstr, 0));
pp::Token token;
......@@ -93,7 +96,8 @@ INSTANTIATE_TEST_CASE_P(HexadecimalInteger_A_F,
static void PreprocessAndVerifyFloat(const char* str)
{
MockDiagnostics diagnostics;
pp::Preprocessor preprocessor(&diagnostics);
MockDirectiveHandler directiveHandler;
pp::Preprocessor preprocessor(&diagnostics, &directiveHandler);
ASSERT_TRUE(preprocessor.init(1, &str, 0));
pp::Token token;
......
......@@ -7,6 +7,7 @@
#include "gtest/gtest.h"
#include "MockDiagnostics.h"
#include "MockDirectiveHandler.h"
#include "Preprocessor.h"
#include "Token.h"
......@@ -27,7 +28,8 @@ TEST_P(OperatorTest, Identified)
OperatorTestParam param = GetParam();
MockDiagnostics diagnostics;
pp::Preprocessor preprocessor(&diagnostics);
MockDirectiveHandler directiveHandler;
pp::Preprocessor preprocessor(&diagnostics, &directiveHandler);
ASSERT_TRUE(preprocessor.init(1, &param.str, 0));
pp::Token token;
......
//
// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "gtest/gtest.h"
#include "MockDiagnostics.h"
#include "MockDirectiveHandler.h"
#include "Preprocessor.h"
#include "Token.h"
class PragmaTest : public testing::Test
{
protected:
PragmaTest() : mPreprocessor(&mDiagnostics, &mDirectiveHandler) { }
void lex()
{
pp::Token token;
mPreprocessor.lex(&token);
EXPECT_EQ(pp::Token::LAST, token.type);
EXPECT_EQ("", token.value);
}
MockDiagnostics mDiagnostics;
MockDirectiveHandler mDirectiveHandler;
pp::Preprocessor mPreprocessor;
};
TEST_F(PragmaTest, EmptyName)
{
const char* str = "#pragma\n";
ASSERT_TRUE(mPreprocessor.init(1, &str, NULL));
using testing::_;
// No handlePragma calls.
EXPECT_CALL(mDirectiveHandler, handlePragma(_, _, _)).Times(0);
// No error or warning.
EXPECT_CALL(mDiagnostics, print(_, _, _)).Times(0);
lex();
}
TEST_F(PragmaTest, EmptyValue)
{
const char* str = "#pragma foo\n";
ASSERT_TRUE(mPreprocessor.init(1, &str, NULL));
using testing::_;
EXPECT_CALL(mDirectiveHandler,
handlePragma(pp::SourceLocation(0, 1), "foo", ""));
// No error or warning.
EXPECT_CALL(mDiagnostics, print(_, _, _)).Times(0);
lex();
}
TEST_F(PragmaTest, NameValue)
{
const char* str = "#pragma foo(bar)\n";
ASSERT_TRUE(mPreprocessor.init(1, &str, NULL));
using testing::_;
EXPECT_CALL(mDirectiveHandler,
handlePragma(pp::SourceLocation(0, 1), "foo", "bar"));
// No error or warning.
EXPECT_CALL(mDiagnostics, print(_, _, _)).Times(0);
lex();
}
TEST_F(PragmaTest, Comments)
{
const char* str = "/*foo*/"
"#"
"/*foo*/"
"pragma"
"/*foo*/"
"foo"
"/*foo*/"
"("
"/*foo*/"
"bar"
"/*foo*/"
")"
"/*foo*/"
"//foo"
"\n";
ASSERT_TRUE(mPreprocessor.init(1, &str, NULL));
using testing::_;
EXPECT_CALL(mDirectiveHandler,
handlePragma(pp::SourceLocation(0, 1), "foo", "bar"));
// No error or warning.
EXPECT_CALL(mDiagnostics, print(_, _, _)).Times(0);
lex();
}
TEST_F(PragmaTest, MissingNewline)
{
const char* str = "#pragma foo(bar)";
ASSERT_TRUE(mPreprocessor.init(1, &str, NULL));
using testing::_;
// Pragma successfully parsed.
EXPECT_CALL(mDirectiveHandler,
handlePragma(pp::SourceLocation(0, 1), "foo", "bar"));
// Error reported about EOF.
EXPECT_CALL(mDiagnostics, print(pp::Diagnostics::EOF_IN_DIRECTIVE, _, _));
lex();
}
class InvalidPragmaTest : public PragmaTest,
public testing::WithParamInterface<const char*>
{
};
TEST_P(InvalidPragmaTest, Identified)
{
const char* str = GetParam();
ASSERT_TRUE(mPreprocessor.init(1, &str, NULL));
using testing::_;
// No handlePragma calls.
EXPECT_CALL(mDirectiveHandler, handlePragma(_, _, _)).Times(0);
// Unrecognized pragma warning.
EXPECT_CALL(mDiagnostics,
print(pp::Diagnostics::UNRECOGNIZED_PRAGMA,
pp::SourceLocation(0, 1), _));
lex();
}
INSTANTIATE_TEST_CASE_P(All, InvalidPragmaTest, testing::Values(
"#pragma 1\n", // Invalid name.
"#pragma foo()\n", // Missing value.
"#pragma foo bar)\n", // Missing left paren,
"#pragma foo(bar\n", // Missing right paren.
"#pragma foo bar\n", // Missing parens.
"#pragma foo(bar) baz\n")); // Extra tokens.
......@@ -7,6 +7,7 @@
#include "gtest/gtest.h"
#include "MockDiagnostics.h"
#include "MockDirectiveHandler.h"
#include "Preprocessor.h"
#include "Token.h"
......@@ -32,7 +33,8 @@ TEST_P(SpaceCharTest, SpaceIgnored)
const char* cstr = str.c_str();
MockDiagnostics diagnostics;
pp::Preprocessor preprocessor(&diagnostics);
MockDirectiveHandler directiveHandler;
pp::Preprocessor preprocessor(&diagnostics, &directiveHandler);
ASSERT_TRUE(preprocessor.init(1, &cstr, 0));
pp::Token token;
......@@ -71,7 +73,8 @@ TEST_P(SpaceStringTest, SpaceIgnored)
const char* cstr = str.c_str();
MockDiagnostics diagnostics;
pp::Preprocessor preprocessor(&diagnostics);
MockDirectiveHandler directiveHandler;
pp::Preprocessor preprocessor(&diagnostics, &directiveHandler);
ASSERT_TRUE(preprocessor.init(1, &cstr, 0));
pp::Token token;
......@@ -100,7 +103,8 @@ TEST(SpaceTest, LeadingSpace)
pp::Token token;
MockDiagnostics diagnostics;
pp::Preprocessor preprocessor(&diagnostics);
MockDirectiveHandler directiveHandler;
pp::Preprocessor preprocessor(&diagnostics, &directiveHandler);
ASSERT_TRUE(preprocessor.init(1, &str, 0));
preprocessor.lex(&token);
......
......@@ -5,6 +5,7 @@
//
#include "gtest/gtest.h"
#include "Token.h"
TEST(TokenTest, DefaultConstructor)
......
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