Skip to content

Commit b28cda1

Browse files
committed
Fix path-to-string conversion issue
Fix bug on Windows where converting a path using c_str() results in a wchar_t* instead of the expected char*
1 parent a9e2572 commit b28cda1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/test_c_api.cxx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ TEST(CTest, link_read_write){
3838
std::string token = fdp::read_token(
3939
fs::path(home_dir()) / ".fair" / "registry" / "token"
4040
);
41-
ASSERT_EQ(fdp_init(config.c_str(), script.c_str(), token.c_str()), FDP_ERR_NONE);
41+
ASSERT_EQ(
42+
fdp_init(config.string().c_str(), script.string().c_str(), token.c_str()),
43+
FDP_ERR_NONE
44+
);
4245
char buf[512];
4346

4447
// Test link write
@@ -54,7 +57,10 @@ TEST(CTest, link_read_write){
5457
// Finalise and re-initialise
5558
ASSERT_EQ(fdp_finalise(), FDP_ERR_NONE);
5659
config = fs::path(TESTDIR) / "data" / "read_csv.yaml";
57-
ASSERT_EQ(fdp_init(config.c_str(), script.c_str(), token.c_str()), FDP_ERR_NONE);
60+
ASSERT_EQ(
61+
fdp_init(config.string().c_str(), script.string().c_str(), token.c_str()),
62+
FDP_ERR_NONE
63+
);
5864

5965
// Test link read
6066
buf[0] = '\0'; // Ensure strlen of output buffer is 0

0 commit comments

Comments
 (0)