From: Russell Hind (rh_gmane_at_[hidden])
Date: 2004-10-23 03:50:19
test_class_info_load and test_class_info_save both passed for
xml_archive but I have created a test (attached) which fails for version
0 xml archives. Can you try this please?
It creates an object with version 0, writes it to an xml archive
(currently hard-coded to drive c so I could check the output file
easily), and then reads it back in.
As mentioned before: when reading in the object, the version is passed
in to serialize as 3, not 0 as it should be.
For XML files: there is no version attribute for the object when the
version is 0, so maybe this is the problem.
Robert Ramey wrote:
> I rebuilt and reran the the tests "test_class_info_load" and
> "test_class_info_save" which are explicitly designed to test this
> functionality. I ran these test with XML archives. Do these tests pass for
> you? How is this situation different than yours? I updated the test
> sliightly so that the class version jumps from 2 to 4 - skipping over 3 so
> that a confusion between serialization library version and class version
> wouldn't be overlooked.
> Robert Ramey
> "Russell Hind" <rh_gmane_at_[hidden]> wrote in message
>>Robert Ramey wrote:
>>>There is a confusion here. Check the manual section titled "Class
>>>There should be something like:
>>>in your code. I don't remember what the maximum class version might be
>>>it could be small like 255 for binary archives.
>>I did ask about this in the previous e-mail. I thought non-primitive
>>types were, by default, versioned, i.e. if no BOOST_CLASS_VERSION is
>>specified, they have a version of 0. Is this not the case?
>>Anyway, the code I posted still gives odd results if I set
>>BOOST_CLASS_VERSION(Test_c, 0). Anything but 0 works, but zero gives
>>the effects described previously, a 3 on the way back in, which is your
>>archive version, not the class version.
>>Again, specifying no version works for text archives (haven't checked
>>binary) but not for XML.
>>Unsubscribe & other changes:
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
// test_class_info_load.cpp: test implementation level trait
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// test implementation level "object_class_info"
// should pass compilation and execution
template <typename ArchiveT>
void serialize(ArchiveT& ar, const unsigned int version)
BOOST_CHECK(version == 0);
void in(const char *testfile, A& a)
xoa & BOOST_SERIALIZATION_NVP(a);
xia & BOOST_SERIALIZATION_NVP(a);
test_main( int /* argc */, char* /* argv */ )
filename += boost::archive::tmpdir();
filename += '/';
filename += BOOST_PP_STRINGIZE(testfile_);
filename += BOOST_PP_STRINGIZE(BOOST_ARCHIVE_TEST);
// in(filename.c_str(), a, b);
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk