From b6a59b8ee4ffbcd541c78a4e259c1ef5619d6e09 Mon Sep 17 00:00:00 2001 From: Nypiaka Date: Tue, 7 Feb 2023 19:30:49 +0300 Subject: [PATCH 1/3] try to fix issue 280 --- server/src/Tests.h | 5 +++++ server/src/printers/TestsPrinter.cpp | 3 +++ 2 files changed, 8 insertions(+) diff --git a/server/src/Tests.h b/server/src/Tests.h index f7558e23..9b22018e 100644 --- a/server/src/Tests.h +++ b/server/src/Tests.h @@ -471,6 +471,11 @@ namespace tests { FileInfo getFileByName(char fileName) const { return filesValues.value()[fileName - 'A']; } + + std::string getError() const { + assert(!errorDescriptors.empty()); + return errorDescriptors[0].substr(0, errorDescriptors[0].find('\n')); + } }; struct Modifiers { diff --git a/server/src/printers/TestsPrinter.cpp b/server/src/printers/TestsPrinter.cpp index 54d1e2e6..eed2a9da 100644 --- a/server/src/printers/TestsPrinter.cpp +++ b/server/src/printers/TestsPrinter.cpp @@ -408,6 +408,9 @@ void TestsPrinter::genHeaders(Tests &tests, const fs::path& generatedHeaderPath) } void TestsPrinter::testHeader(const Tests::MethodTestCase &testCase) { + if (testCase.isError()) { + ss << "//" << testCase.getError() << NL; + } strFunctionCall("TEST", { testCase.suiteName, testCase.testName }, NL) << LB(false); } From f79d0e07fb2d39d04de9bbbc6af722b8449d0a7d Mon Sep 17 00:00:00 2001 From: Nypiaka Date: Wed, 8 Feb 2023 16:36:06 +0300 Subject: [PATCH 2/3] 1st fix --- server/src/Tests.h | 6 ++++-- server/src/printers/TestsPrinter.cpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/server/src/Tests.h b/server/src/Tests.h index 9b22018e..3be98660 100644 --- a/server/src/Tests.h +++ b/server/src/Tests.h @@ -473,8 +473,10 @@ namespace tests { } std::string getError() const { - assert(!errorDescriptors.empty()); - return errorDescriptors[0].substr(0, errorDescriptors[0].find('\n')); + if (!errorDescriptors.empty()) { + return errorDescriptors[0].substr(0, errorDescriptors[0].find('\n')); + } + return ""; } }; diff --git a/server/src/printers/TestsPrinter.cpp b/server/src/printers/TestsPrinter.cpp index eed2a9da..7b90a231 100644 --- a/server/src/printers/TestsPrinter.cpp +++ b/server/src/printers/TestsPrinter.cpp @@ -409,7 +409,7 @@ void TestsPrinter::genHeaders(Tests &tests, const fs::path& generatedHeaderPath) void TestsPrinter::testHeader(const Tests::MethodTestCase &testCase) { if (testCase.isError()) { - ss << "//" << testCase.getError() << NL; + strComment(testCase.getError()); } strFunctionCall("TEST", { testCase.suiteName, testCase.testName }, NL) << LB(false); } From f49c4fcd13399fa96c420fe901100a091bf84fcb Mon Sep 17 00:00:00 2001 From: Nypiaka Date: Tue, 14 Feb 2023 10:54:41 +0300 Subject: [PATCH 3/3] protoc update --- vscode-plugin/protoc.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 vscode-plugin/protoc.sh diff --git a/vscode-plugin/protoc.sh b/vscode-plugin/protoc.sh old mode 100644 new mode 100755