|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r48788 - trunk/libs/serialization/test
From: ramey_at_[hidden]
Date: 2008-09-15 02:09:09
Author: ramey
Date: 2008-09-15 02:09:09 EDT (Mon, 15 Sep 2008)
New Revision: 48788
URL: http://svn.boost.org/trac/boost/changeset/48788
Log:
Fixed bas64 for text files
Fixed location of test archives
Text files modified:
trunk/libs/serialization/test/test_binary.cpp | 4 ++--
trunk/libs/serialization/test/test_tools.hpp | 15 ++++++++-------
2 files changed, 10 insertions(+), 9 deletions(-)
Modified: trunk/libs/serialization/test/test_binary.cpp
==============================================================================
--- trunk/libs/serialization/test/test_binary.cpp (original)
+++ trunk/libs/serialization/test/test_binary.cpp 2008-09-15 02:09:09 EDT (Mon, 15 Sep 2008)
@@ -79,7 +79,6 @@
{
test_ostream os(testfile, TEST_STREAM_FLAGS);
test_oarchive oa(os, TEST_ARCHIVE_FLAGS);
- oa << BOOST_SERIALIZATION_NVP(a);
boost::serialization::make_nvp(
"s1", boost::serialization::make_binary_object(s1, sizeof(s1))
);
@@ -92,6 +91,7 @@
oa << boost::serialization::make_nvp(
"s4", boost::serialization::make_binary_object(s4, sizeof(s4))
);
+ oa << BOOST_SERIALIZATION_NVP(a);
// note: add a little bit on the end of the archive to detect
// failure of text mode binary.
oa << BOOST_SERIALIZATION_NVP(i);
@@ -99,7 +99,6 @@
{
test_istream is(testfile, TEST_STREAM_FLAGS);
test_iarchive ia(is, TEST_ARCHIVE_FLAGS);
- ia >> BOOST_SERIALIZATION_NVP(a1);
boost::serialization::make_nvp(
"s1", boost::serialization::make_binary_object(s1_1, sizeof(s1))
);
@@ -112,6 +111,7 @@
ia >> boost::serialization::make_nvp(
"s4", boost::serialization::make_binary_object(s1_4, sizeof(s4))
);
+ ia >> BOOST_SERIALIZATION_NVP(a1);
// note: add a little bit on the end of the archive to detect
// failure of text mode binary.
ia >> BOOST_SERIALIZATION_NVP(i1);
Modified: trunk/libs/serialization/test/test_tools.hpp
==============================================================================
--- trunk/libs/serialization/test/test_tools.hpp (original)
+++ trunk/libs/serialization/test/test_tools.hpp 2008-09-15 02:09:09 EDT (Mon, 15 Sep 2008)
@@ -74,21 +74,22 @@
namespace archive {
char * test_filename(char * dir = NULL, char *fname = NULL){
static char ibuffer [512];
-
- if(NULL == dir)
+ int i;
+ ibuffer[0] = '\0';
+ if(NULL == dir){
dir = boost::archive::tmpdir();
-
+ }
+ STRCPY(ibuffer, dir);
+ std::strcat(ibuffer, "/");
+ i = std::strlen(ibuffer);
if(NULL == fname){
char old_dir[256];
_getcwd(old_dir, sizeof(old_dir) - 1);
chdir(dir);
-
- std::tmpnam(ibuffer);
+ std::tmpnam(ibuffer + i);
chdir(old_dir);
}
else{
- STRCPY(ibuffer, dir);
- std::strcat(ibuffer, "/");
std::strcat(ibuffer, fname);
}
return ibuffer;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk