summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarseny.kapoulkine@gmail.com <arseny.kapoulkine@gmail.com@99668b35-9821-0410-8761-19e4c4f06640>2012-03-06 07:03:09 +0000
committerarseny.kapoulkine@gmail.com <arseny.kapoulkine@gmail.com@99668b35-9821-0410-8761-19e4c4f06640>2012-03-06 07:03:09 +0000
commitf6c8613229f6d24804c94839254947d21391a9d0 (patch)
tree3ef4e9303954e8e1aea02afc7a188566e6065d40
parenteea13e4d72af4fb83a3d6c4671ae29d1c4305c49 (diff)
tests: Use mkstemp on Unix and QNX (BlackBerry) to avoid tmpnam deprecation warning
git-svn-id: http://pugixml.googlecode.com/svn/trunk@843 99668b35-9821-0410-8761-19e4c4f06640
-rw-r--r--tests/test_document.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test_document.cpp b/tests/test_document.cpp
index 3dc2d02..a34513e 100644
--- a/tests/test_document.cpp
+++ b/tests/test_document.cpp
@@ -382,6 +382,8 @@ TEST_XML(document_save_declaration_latin1, "<node/>")
CHECK(writer.as_narrow() == "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<node />\n");
}
+#define USE_MKSTEMP defined(__unix) || defined(__QNX__)
+
struct temp_file
{
char path[512];
@@ -389,7 +391,7 @@ struct temp_file
temp_file(): fd(0)
{
- #ifdef __unix
+ #if USE_MKSTEMP
strcpy(path, "/tmp/pugiXXXXXX");
fd = mkstemp(path);
@@ -407,7 +409,7 @@ struct temp_file
CHECK(unlink(path) == 0);
#endif
- #ifdef __unix
+ #if USE_MKSTEMP
CHECK(close(fd) == 0);
#endif
}