diff --git a/src/test/app_test.cc b/src/test/app_test.cc index 01099313b3..ea4e69963b 100644 --- a/src/test/app_test.cc +++ b/src/test/app_test.cc @@ -342,7 +342,7 @@ TEST(User, DeletesZombies) { ASSERT_FALSE(te->IsMarkedAsDeletedOnServer()); std::string json = - loadTestDataFile("../testdata/me_without_time_entries.json"); + loadTestDataFile(std::string("../testdata/me_without_time_entries.json")); ASSERT_EQ(noError, user.LoadUserAndRelatedDataFromJSONString(json, true)); @@ -394,7 +394,7 @@ TEST(Database, AllowsSameEmail) { ASSERT_EQ(noError, db.instance()->SaveUser(&user, true, &changes)); User user2; - std::string json = loadTestDataFile("../testdata/same_email.json"); + std::string json = loadTestDataFile(std::string("../testdata/same_email.json")); ASSERT_EQ(noError, user2.LoadUserAndRelatedDataFromJSONString(json, true)); @@ -470,7 +470,7 @@ TEST(Database, SavesAndLoadsObmExperiments) { ASSERT_EQ(noError, user.LoadUserAndRelatedDataFromJSONString(loadTestData(), true)); - std::string json = loadTestDataFile("../testdata/obm_response.json"); + std::string json = loadTestDataFile(std::string("../testdata/obm_response.json")); Json::Value data = jsonStringToValue(json); user.LoadObmExperiments(data); @@ -502,7 +502,7 @@ TEST(Database, SavesAndLoadsObmExperimentsArray) { ASSERT_EQ(noError, user.LoadUserAndRelatedDataFromJSONString(loadTestData(), true)); - std::string json = loadTestDataFile("../testdata/obm_response_array.json"); + std::string json = loadTestDataFile(std::string("../testdata/obm_response_array.json")); Json::Value data = jsonStringToValue(json); user.LoadObmExperiments(data); @@ -1300,7 +1300,7 @@ TEST(User, Continue) { TEST(TimeEntry, SetDurationOnRunningTimeEntryWithDurOnlySetting) { testing::Database db; - std::string json = loadTestDataFile("../testdata/user_with_duronly.json"); + std::string json = loadTestDataFile(std::string("../testdata/user_with_duronly.json")); User user; ASSERT_EQ(noError, diff --git a/src/test/test_data.cc b/src/test/test_data.cc index 13f4174be1..d50cc8c704 100644 --- a/src/test/test_data.cc +++ b/src/test/test_data.cc @@ -16,7 +16,7 @@ std::string loadTestData() { return loadFromTestDataDir("me.json"); } -std::string loadFromTestDataDir(const char* filename) { +std::string loadFromTestDataDir(const std::string &filename) { return loadTestDataFile(std::string(TESTDATADIR) + filename); } diff --git a/src/test/test_data.h b/src/test/test_data.h index 80d0241173..94e762127e 100644 --- a/src/test/test_data.h +++ b/src/test/test_data.h @@ -6,7 +6,7 @@ #include std::string loadTestData(); -std::string loadFromTestDataDir(const char* filename); +std::string loadFromTestDataDir(const std::string &filename); std::string loadTestDataFile(const std::string &filename); #endif // SRC_TEST_TEST_DATA_H_ diff --git a/src/test/toggl_api_test.cc b/src/test/toggl_api_test.cc index f32e73317b..c09243294e 100644 --- a/src/test/toggl_api_test.cc +++ b/src/test/toggl_api_test.cc @@ -1856,7 +1856,7 @@ TEST(toggl_api, toggl_set_time_entry_end) { TEST(toggl_api, toggl_set_time_entry_end_prefers_same_day) { testing::App app; std::string json = - loadFromTestDataDir("time_entry_ending_tomorrow.json"); + loadFromTestDataDir(std::string("time_entry_ending_tomorrow.json")); ASSERT_TRUE(testing_set_logged_in_user(app.ctx(), json.c_str())); toggl::TimeEntry te = testing::testresult::time_entry_by_id(89818605);