Loading src/GTMesh/Debug/JSONLogger.h +4 −13 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ #include <fstream> #include "VariableExport.h" #include <iostream> #include <iomanip> /** * @brief The JSONLogger class * has opened file to write log Loading Loading @@ -84,7 +85,7 @@ public: firstWrite = false; } (*logFile) << "\t{\n\t\t\"expr\" : \""<< escapeQuotationMarks( name ) << (*logFile) << "\t{\n\t\t\"expr\" : \""<< std::quoted( name ) << "\",\n\t\t\"data\" : " ; VariableExport<>::exportVariable(*logFile, value); (*logFile) << "\n}"; Loading @@ -108,7 +109,7 @@ public: "\n\t\t\"gInd\" : " << groupIndex << "," << "\n\t\t\"file\" : \"" << cppFile << "\"," << "\n\t\t\"line\" : " << line << "," << "\n\t\t\"expr\" : \""<< escapeQuotationMarks( name ) << "\"," << "\n\t\t\"expr\" : \""<< std::quoted( name ) << "\"," << "\n\t\t\"data\" : "; VariableExport<>::exportVariable(*logFile, value); (*logFile) << "\n\t}"; Loading @@ -132,7 +133,7 @@ public: "\n\t\t\"gInd\" : " << groupIndex << "," << "\n\t\t\"file\" : \"" << cppFile << "\"," << "\n\t\t\"line\" : " << line << "," << "\n\t\t\"expr\" : \""<< escapeQuotationMarks( name ) << "\"," << "\n\t\t\"expr\" : \""<< std::quoted( name ) << "\"," << "\n\t\t\"data\" : "; VariableExport<>::exportVariable(*logFile, value); Loading @@ -157,16 +158,6 @@ public: } return res; } std::string escapeQuotationMarks(const char * str){ std::string res = str; size_t pos = 0; while((pos = res.find("\"", pos + 2)) != res.npos){ res.replace(pos, 1, "\\\""); } return res; } }; #endif // JSONLOGGER_H src/UnitTests/BinarySerializer/CMakeLists.txt 0 → 100644 +9 −0 Original line number Diff line number Diff line ## below are targets for each test add_executable( BinarySerializerTest BinarySerializerTest.cpp ) target_compile_options( BinarySerializerTest PRIVATE ${CXX_TESTS_FLAGS} ) target_link_libraries( BinarySerializerTest ${GTEST_BOTH_LIBRARIES} ) ## add all targets to the CMake's "test" target (i.e. `make test` runs all tests) add_test( BinarySerializerTest ${EXECUTABLE_OUTPUT_PATH}/BinarySerializerTest${CMAKE_EXECUTABLE_SUFFIX} ) Loading
src/GTMesh/Debug/JSONLogger.h +4 −13 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ #include <fstream> #include "VariableExport.h" #include <iostream> #include <iomanip> /** * @brief The JSONLogger class * has opened file to write log Loading Loading @@ -84,7 +85,7 @@ public: firstWrite = false; } (*logFile) << "\t{\n\t\t\"expr\" : \""<< escapeQuotationMarks( name ) << (*logFile) << "\t{\n\t\t\"expr\" : \""<< std::quoted( name ) << "\",\n\t\t\"data\" : " ; VariableExport<>::exportVariable(*logFile, value); (*logFile) << "\n}"; Loading @@ -108,7 +109,7 @@ public: "\n\t\t\"gInd\" : " << groupIndex << "," << "\n\t\t\"file\" : \"" << cppFile << "\"," << "\n\t\t\"line\" : " << line << "," << "\n\t\t\"expr\" : \""<< escapeQuotationMarks( name ) << "\"," << "\n\t\t\"expr\" : \""<< std::quoted( name ) << "\"," << "\n\t\t\"data\" : "; VariableExport<>::exportVariable(*logFile, value); (*logFile) << "\n\t}"; Loading @@ -132,7 +133,7 @@ public: "\n\t\t\"gInd\" : " << groupIndex << "," << "\n\t\t\"file\" : \"" << cppFile << "\"," << "\n\t\t\"line\" : " << line << "," << "\n\t\t\"expr\" : \""<< escapeQuotationMarks( name ) << "\"," << "\n\t\t\"expr\" : \""<< std::quoted( name ) << "\"," << "\n\t\t\"data\" : "; VariableExport<>::exportVariable(*logFile, value); Loading @@ -157,16 +158,6 @@ public: } return res; } std::string escapeQuotationMarks(const char * str){ std::string res = str; size_t pos = 0; while((pos = res.find("\"", pos + 2)) != res.npos){ res.replace(pos, 1, "\\\""); } return res; } }; #endif // JSONLOGGER_H
src/UnitTests/BinarySerializer/CMakeLists.txt 0 → 100644 +9 −0 Original line number Diff line number Diff line ## below are targets for each test add_executable( BinarySerializerTest BinarySerializerTest.cpp ) target_compile_options( BinarySerializerTest PRIVATE ${CXX_TESTS_FLAGS} ) target_link_libraries( BinarySerializerTest ${GTEST_BOTH_LIBRARIES} ) ## add all targets to the CMake's "test" target (i.e. `make test` runs all tests) add_test( BinarySerializerTest ${EXECUTABLE_OUTPUT_PATH}/BinarySerializerTest${CMAKE_EXECUTABLE_SUFFIX} )