From d5b78104c633d78d2c174d4ba1bca9bd89be19e8 Mon Sep 17 00:00:00 2001 From: Geoffrey Merck Date: Sat, 12 Mar 2022 07:53:52 +0100 Subject: [PATCH] #20 fix broken test on Circle CI --- .vscode/launch.json | 2 +- Tests/AMBEFileReader/lookup.cpp | 12 ++++++------ Tests/AMBEFileReader/read.cpp | 11 ++++------- Tests/Makefile | 2 +- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index f15168f..55284ba 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -135,7 +135,7 @@ "program": "${workspaceFolder}/Tests/dstargateway_tests", "args": [ ], "stopAtEntry": false, - "cwd": "${workspaceFolder}", + "cwd": "${workspaceFolder}/Tests/", "environment": [], "externalConsole": false, "MIMode": "gdb", diff --git a/Tests/AMBEFileReader/lookup.cpp b/Tests/AMBEFileReader/lookup.cpp index f239eae..9f75475 100644 --- a/Tests/AMBEFileReader/lookup.cpp +++ b/Tests/AMBEFileReader/lookup.cpp @@ -47,7 +47,7 @@ namespace AMBEFileReaderTests TEST_F(AMBEFileReader_lookup, onlyIndexFileExists) { - std::string indexFile = std::string(std::filesystem::current_path()) + "/Tests/AMBEFileReader/fr_FR.indx"; + std::string indexFile = std::string(std::filesystem::current_path()) + "/AMBEFileReader/fr_FR.indx"; CAMBEFileReader reader(indexFile, "/this/file/does/not/exist"); bool res = reader.read(); EXPECT_FALSE(res) << "read shall return false on non existent file"; @@ -63,7 +63,7 @@ namespace AMBEFileReaderTests TEST_F(AMBEFileReader_lookup, onlyAmbeFileExists) { - std::string ambeFile = std::string(std::filesystem::current_path()) + "/Tests/AMBEFileReader/fr_FR.ambe"; + std::string ambeFile = std::string(std::filesystem::current_path()) + "/AMBEFileReader/fr_FR.ambe"; CAMBEFileReader reader("/this/file/does/not/exist", ambeFile); bool res = reader.read(); EXPECT_FALSE(res) << "read shall return false on non existent file"; @@ -79,8 +79,8 @@ namespace AMBEFileReaderTests TEST_F(AMBEFileReader_lookup, validId) { - std::string indexFile = std::string(std::filesystem::current_path()) + "/Tests/AMBEFileReader/fr_FR.indx"; - std::string ambeFile = std::string(std::filesystem::current_path()) + "/Tests/AMBEFileReader/fr_FR.ambe"; + std::string indexFile = std::string(std::filesystem::current_path()) + "/AMBEFileReader/fr_FR.indx"; + std::string ambeFile = std::string(std::filesystem::current_path()) + "/AMBEFileReader/fr_FR.ambe"; CAMBEFileReader reader(indexFile, ambeFile); bool res = reader.read(); EXPECT_TRUE(res) << "read shall return true on existent files"; @@ -97,8 +97,8 @@ namespace AMBEFileReaderTests TEST_F(AMBEFileReader_lookup, invalidId) { - std::string indexFile = std::string(std::filesystem::current_path()) + "/Tests/AMBEFileReader/fr_FR.indx"; - std::string ambeFile = std::string(std::filesystem::current_path()) + "/Tests/AMBEFileReader/fr_FR.ambe"; + std::string indexFile = std::string(std::filesystem::current_path()) + "/AMBEFileReader/fr_FR.indx"; + std::string ambeFile = std::string(std::filesystem::current_path()) + "/AMBEFileReader/fr_FR.ambe"; CAMBEFileReader reader(indexFile, ambeFile); bool res = reader.read(); EXPECT_TRUE(res) << "read shall return true on existent files"; diff --git a/Tests/AMBEFileReader/read.cpp b/Tests/AMBEFileReader/read.cpp index a60b8e6..f7b1753 100644 --- a/Tests/AMBEFileReader/read.cpp +++ b/Tests/AMBEFileReader/read.cpp @@ -38,7 +38,7 @@ namespace AMBEFileReaderTests TEST_F(AMBEFileReader_read, onlyIndexFileExists) { - std::string indexFile = std::string(std::filesystem::current_path()) + "/Tests/AMBEFileReader/fr_FR.indx"; + std::string indexFile = std::string(std::filesystem::current_path()) + "/AMBEFileReader/fr_FR.indx"; CAMBEFileReader reader(indexFile, "/this/file/does/not/exist"); bool res = reader.read(); EXPECT_FALSE(res) << "read shall return false on non existent file"; @@ -46,7 +46,7 @@ namespace AMBEFileReaderTests TEST_F(AMBEFileReader_read, onlyAmbeFileExists) { - std::string ambeFile = std::string(std::filesystem::current_path()) + "/Tests/AMBEFileReader/fr_FR.ambe"; + std::string ambeFile = std::string(std::filesystem::current_path()) + "/AMBEFileReader/fr_FR.ambe"; CAMBEFileReader reader("/this/file/does/not/exist", ambeFile); bool res = reader.read(); EXPECT_FALSE(res) << "read shall return false on non existent file"; @@ -54,11 +54,8 @@ namespace AMBEFileReaderTests TEST_F(AMBEFileReader_read, bothFileExist) { - std::string indexFile = std::string(std::filesystem::current_path()) + "/Tests/AMBEFileReader/fr_FR.indx"; - std::string ambeFile = std::string(std::filesystem::current_path()) + "/Tests/AMBEFileReader/fr_FR.ambe"; - - CLog::logInfo("Reading file: %s", indexFile.c_str()); - CLog::logInfo("Reading file: %s", ambeFile.c_str()); + std::string indexFile = std::string(std::filesystem::current_path()) + "/AMBEFileReader/fr_FR.indx"; + std::string ambeFile = std::string(std::filesystem::current_path()) + "/AMBEFileReader/fr_FR.ambe"; CAMBEFileReader reader(indexFile, ambeFile); bool res = reader.read(); diff --git a/Tests/Makefile b/Tests/Makefile index f338acc..d3b30bb 100644 --- a/Tests/Makefile +++ b/Tests/Makefile @@ -10,7 +10,7 @@ dstargateway_tests: ../VersionInfo/GitVersion.h $(OBJS) ../APRS/APRS.a ../IRCDDB -include $(DEPS) -.PHONY run-tests: dstargateway_tests +.PHONY run-tests: dstargateway_tests ./dstargateway_tests .PHONY clean :