From 88a4cf34b858a5ae41753bb369b43348c05906b5 Mon Sep 17 00:00:00 2001 From: Tsuda Kageyu Date: Wed, 20 May 2015 19:57:08 +0900 Subject: [PATCH] Modify the test code to work on MSVC/Windows. --- tests/utils.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/utils.h b/tests/utils.h index a935f983..8be65ac0 100644 --- a/tests/utils.h +++ b/tests/utils.h @@ -30,9 +30,9 @@ inline string copyFile(const string &filename, const string &ext) char testFileName[1024]; #ifdef _WIN32 - char *testFileNameBody = tempnam(NULL, NULL); - snprintf(testFileName, sizeof(testFileName), "%s%s", testFileNameBody, ext.c_str()); - free(testFileNameBody); + GetTempPathA(sizeof(testFileName), testFileName); + GetTempFileNameA(testFileName, "tag", 0, testFileName); + strcat(testFileName, ext.c_str()); #else snprintf(testFileName, sizeof(testFileName), "/%s/taglib-test-XXXXXX%s", P_tmpdir, ext.c_str()); mkstemps(testFileName, 6); -- 2.40.0