diff options
author | arseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640> | 2010-06-02 06:37:29 +0000 |
---|---|---|
committer | arseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640> | 2010-06-02 06:37:29 +0000 |
commit | bef9439b01ed9a6ffcc850e355ff65eb531fe354 (patch) | |
tree | 26433249cd2c54f6af2354e195955166d08a8f6e /tests | |
parent | c622ce6fed61e07125c7d764f84fc70bb73c6c78 (diff) |
tests: Fixed test race condition (a better way would be to use argv[0]-relative path, but let's leave it like that till it breaks)
git-svn-id: http://pugixml.googlecode.com/svn/trunk@494 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_document.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/test_document.cpp b/tests/test_document.cpp index eab2be9..33f6df7 100644 --- a/tests/test_document.cpp +++ b/tests/test_document.cpp @@ -209,12 +209,14 @@ TEST_XML(document_save_declaration, "<node/>") TEST_XML(document_save_file, "<node/>")
{
- CHECK(doc.save_file("tests/data/output.xml"));
+ const char* path = tmpnam(0);
- CHECK(doc.load_file("tests/data/output.xml", pugi::parse_default | pugi::parse_declaration));
+ CHECK(doc.save_file(path));
+
+ CHECK(doc.load_file(path, pugi::parse_default | pugi::parse_declaration));
CHECK_NODE(doc, STR("<?xml version=\"1.0\"?><node />"));
- unlink("tests/data/output.xml");
+ unlink(path);
}
TEST_XML(document_save_file_error, "<node/>")
|