Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
R
rapidjson
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
rapidjson
Commits
4d94a805
Commit
4d94a805
authored
Jun 20, 2014
by
Milo Yip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes unit testing on Visual Studio.
tmpnam() in VS prepends backslash in the path.
parent
23056aba
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
3 deletions
+18
-3
.gitignore
.gitignore
+6
-0
encodedstreamtest.cpp
test/unittest/encodedstreamtest.cpp
+2
-2
filestreamtest.cpp
test/unittest/filestreamtest.cpp
+1
-1
unittest.h
test/unittest/unittest.h
+9
-0
No files found.
.gitignore
0 → 100644
View file @
4d94a805
/bin/*
/build/*.exe
/build/gmake
/build/vs*/
/thirdparty/lib
/intermediate
test/unittest/encodedstreamtest.cpp
View file @
4d94a805
...
...
@@ -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
];
...
...
test/unittest/filestreamtest.cpp
View file @
4d94a805
...
...
@@ -70,7 +70,7 @@ TEST_F(FileStreamTest, FileReadStream) {
TEST_F
(
FileStreamTest
,
FileWriteStream
)
{
char
filename
[
L_tmpnam
];
tmpnam
(
filename
);
TempFilename
(
filename
);
FILE
*
fp
=
fopen
(
filename
,
"wb"
);
char
buffer
[
65536
];
...
...
test/unittest/unittest.h
View file @
4d94a805
...
...
@@ -30,4 +30,13 @@ inline Ch* StrDup(const Ch* str) {
return
buffer
;
}
inline
void
TempFilename
(
char
*
filename
)
{
tmpnam
(
filename
);
// For Visual Studio, tmpnam() adds a backslash in front. Remove it.
if
(
filename
[
0
]
==
'\\'
)
for
(
int
i
=
0
;
filename
[
i
]
!=
'\0'
;
i
++
)
filename
[
i
]
=
filename
[
i
+
1
];
}
#endif // UNITTEST_H_
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment