Fixes unit testing on Visual Studio.

tmpnam() in VS prepends backslash in the path.
This commit is contained in:
Milo Yip
2014-06-20 16:08:58 +08:00
parent 23056abad1
commit 4d94a8057d
4 changed files with 18 additions and 3 deletions

View File

@@ -85,7 +85,7 @@ protected:
template <typename FileEncoding, typename MemoryEncoding>
void TestEncodedOutputStream(const char* expectedFilename, bool putBOM) {
char filename[L_tmpnam];
tmpnam(filename);
TempFilename(filename);
FILE *fp = fopen(filename, "wb");
char buffer[16];
@@ -114,7 +114,7 @@ protected:
void TestAutoUTFOutputStream(UTFType type, bool putBOM, const char *expectedFilename) {
char filename[L_tmpnam];
tmpnam(filename);
TempFilename(filename);
FILE *fp = fopen(filename, "wb");
char buffer[16];