mirror of
https://github.com/USCiLab/cereal.git
synced 2025-09-21 20:59:31 +02:00
out of order XML working properly:
Errors in unittests turned out to be errors in the way the tests were written, not in the actual XML archive. Additional errors were due to improper loads in vector<bool>, which is now fixed.
This commit is contained in:
parent
db0f1cf47f
commit
3fccebb030
@ -101,7 +101,11 @@ namespace cereal
|
||||
|
||||
vector.resize( static_cast<std::size_t>( size ) );
|
||||
for( auto it = vector.begin(), end = vector.end(); it != end; ++it )
|
||||
ar( static_cast<bool>( *it ) );
|
||||
{
|
||||
bool b;
|
||||
ar( b );
|
||||
*it = b;
|
||||
}
|
||||
}
|
||||
} // namespace cereal
|
||||
|
||||
|
@ -188,7 +188,7 @@ random_value(std::mt19937 & gen)
|
||||
{
|
||||
std::string s(std::uniform_int_distribution<int>(3, 30)(gen), ' ');
|
||||
for(char & c : s)
|
||||
c = static_cast<char>( std::uniform_int_distribution<int>( '~', '~' )(gen) );
|
||||
c = static_cast<char>( std::uniform_int_distribution<int>( 'A', 'Z' )(gen) );
|
||||
return s;
|
||||
}
|
||||
|
||||
@ -197,7 +197,7 @@ std::basic_string<C> random_basic_string(std::mt19937 & gen)
|
||||
{
|
||||
std::basic_string<C> s(std::uniform_int_distribution<int>(3, 30)(gen), ' ');
|
||||
for(C & c : s)
|
||||
c = static_cast<C>( std::uniform_int_distribution<int>( '~', '~' )(gen) );
|
||||
c = static_cast<C>( std::uniform_int_distribution<int>( 'A', 'Z' )(gen) );
|
||||
return s;
|
||||
}
|
||||
|
||||
@ -2961,7 +2961,7 @@ struct unordered_naming
|
||||
{
|
||||
ar( x,
|
||||
CEREAL_NVP(y),
|
||||
z );
|
||||
CEREAL_NVP(z) );
|
||||
}
|
||||
|
||||
bool operator==( unordered_naming const & other ) const
|
||||
@ -3035,7 +3035,7 @@ void test_unordered_loads()
|
||||
{
|
||||
IArchive iar(is);
|
||||
|
||||
iar( cereal::make_nvp( name7, o_un7 ),
|
||||
iar( cereal::make_nvp( name7, i_un7 ),
|
||||
cereal::make_nvp( name2, i_double2 ),
|
||||
cereal::make_nvp( name4, i_int4 ),
|
||||
cereal::make_nvp( name3, i_vecbool3 ),
|
||||
|
Loading…
x
Reference in New Issue
Block a user