summaryrefslogtreecommitdiffhomepage
path: root/test-cpp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test-cpp.cpp')
-rw-r--r--test-cpp.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/test-cpp.cpp b/test-cpp.cpp
index aabc4f4..8a9b7cb 100644
--- a/test-cpp.cpp
+++ b/test-cpp.cpp
@@ -24,13 +24,12 @@ class CppTest: public ::testing::Test
{
protected:
CppTest() {
- debug = true;
+ //debug = true;
}
~CppTest() {
}
};
-#if 1
TEST_F(CppTest, preprocessing_tokenize) {
CPP cpp;
auto pp_tokens = cpp.preprocessing_tokenize("int main() { return 1; }");
@@ -45,7 +44,6 @@ TEST_F(CppTest, preprocessing_tokenize) {
ASSERT_EQ(nodes.size(), 44);
}
-#endif
TEST_F(CppTest, preprocessing_tokenize_compile_error) {
CPP cpp;
@@ -65,8 +63,16 @@ TEST_F(CppTest, preprocessing_tokenize_compile_error) {
FAIL() << "Exception expected";
}
-#if 0
-TEST(Cpp, translate) {
- CPP::translate();
+TEST(Cpp, compile) {
+ CPP cpp;
+
+ cpp.compile("int main() { return 1 + 1; }");
}
-#endif
+
+TEST(Cpp, compile_2_times) {
+ CPP cpp;
+
+ cpp.compile("int main() { return (1 + 2) * 2; }");
+ cpp.compile("int main() { return 1 + 2 * 2; }");
+}
+