Bläddra i källkod

fix: 修复Release模式下无法编译ctest的问题

SongZihuan 3 år sedan
förälder
incheckning
bc35294282
2 ändrade filer med 16 tillägg och 6 borttagningar
  1. 6 2
      test/src/code_create.cpp
  2. 10 4
      test/src/it_syntactic.cpp

+ 6 - 2
test/src/code_create.cpp

@@ -11,7 +11,9 @@ int main() {
                                                                           new aFuncode::Code::ByteCode(start,
                                                                                                        "Test3",
                                                                                                        2), 2), 2));
-        start.display();
+#ifdef AFUN_DEBUG
+	start.display();
+#endif
         std::string md5 = start.getMD5_v1();
         printf("md5: %s\n", md5.c_str());
 
@@ -24,10 +26,12 @@ int main() {
         aFuncode::Code start = aFuncode::Code("test.aun");
         start.readByteCode("test.aun");
 
+#ifdef AFUN_DEBUG
         start.display();
+#endif
         std::string md5 = start.getMD5_v1();
         printf("md5: %s\n", md5.c_str());
     }
 
     return 0;
-}
+}

+ 10 - 4
test/src/it_syntactic.cpp

@@ -95,7 +95,9 @@ int main(int argc, char **) {
         bool ret = parser.parserCode(code);
         if (!ret)
             return 1;
-        code.display();
+#ifdef AFUN_DEBUG
+	code.display();
+#endif
         md5_1 = code.getMD5_v1();
         aFuntool::cout << "Code1 md5: %s" << md5_1 << "\n";
     }
@@ -127,7 +129,9 @@ int main(int argc, char **) {
         bool ret = parser.parserCode(code);
         if (!ret)
             return 1;
-        code.display();
+#ifdef AFUN_DEBUG
+	code.display();
+#endif
         md5_2 = code.getMD5_v1();
         aFuntool::cout << "Code2 md5: %s" << md5_2 << "\n";
     }
@@ -144,7 +148,9 @@ int main(int argc, char **) {
         bool ret = parser.parserCode(code);
 
         if (ret) {
-            code.display();
+#ifdef AFUN_DEBUG
+	    code.display();
+#endif
         } else {
             while (parser.countEvent() != 0) {
                 auto event = parser.popEvent();
@@ -154,4 +160,4 @@ int main(int argc, char **) {
     }
 
     return 0;
-}
+}