Skip to content

Commit 4fa77c3

Browse files
committed
update tests
1 parent fd5bc25 commit 4fa77c3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/testimportproject.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,8 @@ class TestImportProject : public TestFixture {
409409
TestImporter importer;
410410
ASSERT_EQUALS(false, importer.importCompileCommands(istr));
411411
ASSERT_EQUALS(0, importer.fileSettings.size());
412-
ASSERT_EQUALS("cppcheck: error: no 'arguments' or 'command' field found in compilation database entry\n", GET_REDIRECT_OUTPUT);
412+
ASSERT_EQUALS(1, importer.errors.size());
413+
ASSERT_EQUALS("no 'arguments' or 'command' field found in compilation database entry", importer.errors[0]);
413414
}
414415

415416
void importCompileCommandsDirectoryMissing() const {
@@ -419,7 +420,8 @@ class TestImportProject : public TestFixture {
419420
TestImporter importer;
420421
ASSERT_EQUALS(false, importer.importCompileCommands(istr));
421422
ASSERT_EQUALS(0, importer.fileSettings.size());
422-
ASSERT_EQUALS("cppcheck: error: 'directory' field in compilation database entry missing\n", GET_REDIRECT_OUTPUT);
423+
ASSERT_EQUALS(1, importer.errors.size());
424+
ASSERT_EQUALS("'directory' field in compilation database entry missing", importer.errors[0]);
423425
}
424426

425427
void importCompileCommandsDirectoryInvalid() const {
@@ -430,7 +432,8 @@ class TestImportProject : public TestFixture {
430432
TestImporter importer;
431433
ASSERT_EQUALS(false, importer.importCompileCommands(istr));
432434
ASSERT_EQUALS(0, importer.fileSettings.size());
433-
ASSERT_EQUALS("cppcheck: error: 'directory' field in compilation database entry is not a string\n", GET_REDIRECT_OUTPUT);
435+
ASSERT_EQUALS(1, importer.errors.size());
436+
ASSERT_EQUALS("'directory' field in compilation database entry is not a string", importer.errors[0]);
434437
}
435438

436439
void importCppcheckGuiProject() const {

0 commit comments

Comments
 (0)