X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=tests%2Ftools%2FtoolTestRunner.cxx;fp=tests%2Ftools%2FtoolTestRunner.cxx;h=89deab5a20614c20219e4a48db8184a0eefa5e4e;hb=a591c076e3b12441800b4de4061a983a8aba14c1;hp=768afecc200b7241d63b92ab6d0ab3419a504cf6;hpb=752a9b408122ea9952851c04e75e74d041768dab;p=clitk.git diff --git a/tests/tools/toolTestRunner.cxx b/tests/tools/toolTestRunner.cxx index 768afec..89deab5 100644 --- a/tests/tools/toolTestRunner.cxx +++ b/tests/tools/toolTestRunner.cxx @@ -33,15 +33,25 @@ int getOutputOptionIndex(int argc, char** argv){ } return NO_OUTPUT_OPTION; } + std::string getTmpFileName(){ char fileName[] = "/tmp/vvTempXXXXXX"; - int fd = mkstemp(fileName); - if(fd==-1){ + + #ifdef _WIN32 + errno_t err = tmpfile_s(&fileName, strlen(fileName)); + #else + int err=0; + int fd = mkstemp(fileName); + if(fd==-1) err=1; + #endif + if(err){ std::cout<<"couldnot create file. Exiting"<