diff --git a/source/styles/tests/test_number_format.hpp b/source/styles/tests/test_number_format.hpp index 5368b33e..5014678c 100644 --- a/source/styles/tests/test_number_format.hpp +++ b/source/styles/tests/test_number_format.hpp @@ -168,7 +168,7 @@ public: auto period = xlnt::timedelta(1, 2, 3, 4, 5); auto period_number = period.to_number(); - xlnt::number_format nf = xlnt::number_format::number_format("[mm]:ss"); + xlnt::number_format nf("[mm]:ss"); auto formatted = nf.format(period_number, xlnt::calendar::windows_1900); TS_ASSERT_EQUALS(formatted, "1563:04"); @@ -179,7 +179,7 @@ public: auto time = xlnt::time(1, 2, 3, 400000); auto time_number = time.to_number(); - xlnt::number_format nf = xlnt::number_format::number_format("ss.0"); + xlnt::number_format nf("ss.0"); auto formatted = nf.format(time_number, xlnt::calendar::windows_1900); TS_ASSERT_EQUALS(formatted, "03.4"); @@ -190,7 +190,7 @@ public: auto time = xlnt::time(1, 2, 3, 400000); auto time_number = time.to_number(); - xlnt::number_format nf = xlnt::number_format::number_format("s.0"); + xlnt::number_format nf("s.0"); auto formatted = nf.format(time_number, xlnt::calendar::windows_1900); TS_ASSERT_EQUALS(formatted, "3.4"); @@ -201,7 +201,7 @@ public: auto period = xlnt::timedelta(1, 2, 3, 4, 5); auto period_number = period.to_number(); - xlnt::number_format nf = xlnt::number_format::number_format("[ss]"); + xlnt::number_format nf("[ss]"); auto formatted = nf.format(period_number, xlnt::calendar::windows_1900); TS_ASSERT_EQUALS(formatted, "93784"); diff --git a/tests/helpers/path_helper.hpp b/tests/helpers/path_helper.hpp index 8710c0bb..9f2ba69a 100644 --- a/tests/helpers/path_helper.hpp +++ b/tests/helpers/path_helper.hpp @@ -94,8 +94,13 @@ public: std::basic_string working_directory(buffer); return windows_to_universal_path(std::string(working_directory.begin(), working_directory.end())); #else - char buffer[2048]; - getcwd(buffer, 2048); + char buffer[PATH_MAX]; + + if (getcwd(buffer, 2048) == nullptr) + { + throw std::runtime_error("getcwd failed"); + } + return std::string(buffer); #endif }