mirror of
https://github.com/USCiLab/cereal.git
synced 2025-09-21 20:59:31 +02:00
Compiling with clang and gcc with -Wshadow
See issue #17 Somewhere along the way we've also broken our ability to compile with GCC 4.7.3. We'll have to decide if we care about supporting 4.7.3 or not. The changes that break this are: -there is no emplace in std::map (or related) in 4.7.3 -there are some enable_ifs in rapidjson's writer.h that are always false (which is fine), but GCC 4.7.3 doesn't like this
This commit is contained in:
parent
16b6e791a4
commit
f27eb02caf
2
Makefile
2
Makefile
@ -1,4 +1,4 @@
|
||||
CPPFLAGS=-std=c++11 -I./include -Wall -Werror -g -Wextra
|
||||
CPPFLAGS=-std=c++11 -I./include -Wall -Werror -g -Wextra -Wshadow
|
||||
CXX=g++
|
||||
COVERAGE_OUTPUT=out
|
||||
|
||||
|
@ -407,11 +407,11 @@ namespace cereal
|
||||
|
||||
//! Adjust our position such that we are at the node with the given name
|
||||
/*! @throws Exception if no such named node exists */
|
||||
inline void search( const char * name )//, GenericValue const & parent )
|
||||
inline void search( const char * searchName )//, GenericValue const & parent )
|
||||
{
|
||||
size_t index = 0;
|
||||
for( auto it = itsMemberItBegin; it != itsMemberItEnd; ++it, ++index )
|
||||
if( std::strcmp( name, it->name.GetString() ) == 0 )
|
||||
if( std::strcmp( searchName, it->name.GetString() ) == 0 )
|
||||
{
|
||||
itsIndex = index;
|
||||
return;
|
||||
|
@ -587,18 +587,18 @@ namespace cereal
|
||||
}
|
||||
|
||||
//! Searches for a child with the given name in this node
|
||||
/*! @param name The name to search for (must be null terminated)
|
||||
/*! @param searchName The name to search for (must be null terminated)
|
||||
@return The node if found, nullptr otherwise */
|
||||
rapidxml::xml_node<> * search( const char * name )
|
||||
rapidxml::xml_node<> * search( const char * searchName )
|
||||
{
|
||||
if( name )
|
||||
if( searchName )
|
||||
{
|
||||
size_t new_size = XMLInputArchive::getNumChildren( node );
|
||||
size_t name_size = rapidxml::internal::measure( name );
|
||||
size_t name_size = rapidxml::internal::measure( searchName );
|
||||
|
||||
for( auto new_child = node->first_node(); new_child != nullptr; new_child = new_child->next_sibling() )
|
||||
{
|
||||
if( rapidxml::internal::compare( new_child->name(), new_child->name_size(), name, name_size, true ) )
|
||||
if( rapidxml::internal::compare( new_child->name(), new_child->name_size(), searchName, name_size, true ) )
|
||||
{
|
||||
size = new_size;
|
||||
child = new_child;
|
||||
|
@ -48,8 +48,8 @@ namespace cereal
|
||||
/*! @ingroup Utility */
|
||||
struct Exception : public std::runtime_error
|
||||
{
|
||||
Exception( const std::string& what ) : std::runtime_error(what) {}
|
||||
Exception( const char* what ) : std::runtime_error(what) {}
|
||||
Exception( const std::string& what_ ) : std::runtime_error(what_) {}
|
||||
Exception( const char* what_ ) : std::runtime_error(what_) {}
|
||||
};
|
||||
|
||||
// ######################################################################
|
||||
@ -234,8 +234,8 @@ namespace cereal
|
||||
{
|
||||
public:
|
||||
//! Construct the output archive
|
||||
/*! @param self A pointer to the derived ArchiveType (pass this from the derived archive) */
|
||||
OutputArchive(ArchiveType * const self) : self(self), itsCurrentPointerId(1), itsCurrentPolymorphicTypeId(1)
|
||||
/*! @param derived A pointer to the derived ArchiveType (pass this from the derived archive) */
|
||||
OutputArchive(ArchiveType * const derived) : self(derived), itsCurrentPointerId(1), itsCurrentPolymorphicTypeId(1)
|
||||
{ }
|
||||
|
||||
//! Serializes all passed in data
|
||||
@ -540,8 +540,8 @@ namespace cereal
|
||||
{
|
||||
public:
|
||||
//! Construct the output archive
|
||||
/*! @param self A pointer to the derived ArchiveType (pass this from the derived archive) */
|
||||
InputArchive(ArchiveType * const self) : self(self) { }
|
||||
/*! @param derived A pointer to the derived ArchiveType (pass this from the derived archive) */
|
||||
InputArchive(ArchiveType * const derived) : self(derived) { }
|
||||
|
||||
//! Serializes all passed in data
|
||||
template <class ... Types> inline
|
||||
|
@ -285,7 +285,7 @@ namespace cereal
|
||||
|
||||
//! Construct a MapItem from a key and a value
|
||||
/*! @internal */
|
||||
MapItem( Key && key, Value && value ) : key(const_cast<KeyType>(key)), value(const_cast<ValueType>(value)) {}
|
||||
MapItem( Key && key_, Value && value_ ) : key(const_cast<KeyType>(key_)), value(const_cast<ValueType>(value_)) {}
|
||||
|
||||
KeyType key;
|
||||
ValueType value;
|
||||
|
116
include/cereal/external/rapidxml/rapidxml.hpp
vendored
116
include/cereal/external/rapidxml/rapidxml.hpp
vendored
@ -73,9 +73,9 @@ namespace rapidxml
|
||||
public:
|
||||
|
||||
//! Constructs parse error
|
||||
parse_error(const char *what, void *where)
|
||||
: m_what(what)
|
||||
, m_where(where)
|
||||
parse_error(const char *what_, void *where_)
|
||||
: m_what(what_)
|
||||
, m_where(where_)
|
||||
{
|
||||
}
|
||||
|
||||
@ -717,18 +717,18 @@ namespace rapidxml
|
||||
//! Use name(const Ch *) function to have the length automatically calculated (string must be zero terminated).
|
||||
//! \param name Name of node to set. Does not have to be zero terminated.
|
||||
//! \param size Size of name, in characters. This does not include zero terminator, if one is present.
|
||||
void name(const Ch *name, std::size_t size)
|
||||
void name(const Ch *name_, std::size_t size)
|
||||
{
|
||||
m_name = const_cast<Ch *>(name);
|
||||
m_name = const_cast<Ch *>(name_);
|
||||
m_name_size = size;
|
||||
}
|
||||
|
||||
//! Sets name of node to a zero-terminated string.
|
||||
//! See also \ref ownership_of_strings and xml_node::name(const Ch *, std::size_t).
|
||||
//! \param name Name of node to set. Must be zero terminated.
|
||||
void name(const Ch *name)
|
||||
void name(const Ch *name_)
|
||||
{
|
||||
this->name(name, internal::measure(name));
|
||||
this->name(name_, internal::measure(name_));
|
||||
}
|
||||
|
||||
//! Sets value of node to a non zero-terminated string.
|
||||
@ -747,18 +747,18 @@ namespace rapidxml
|
||||
//! If you want to manipulate data of elements using values, use parser flag rapidxml::parse_no_data_nodes to prevent creation of data nodes by the parser.
|
||||
//! \param value value of node to set. Does not have to be zero terminated.
|
||||
//! \param size Size of value, in characters. This does not include zero terminator, if one is present.
|
||||
void value(const Ch *value, std::size_t size)
|
||||
void value(const Ch *value_, std::size_t size)
|
||||
{
|
||||
m_value = const_cast<Ch *>(value);
|
||||
m_value = const_cast<Ch *>(value_);
|
||||
m_value_size = size;
|
||||
}
|
||||
|
||||
//! Sets value of node to a zero-terminated string.
|
||||
//! See also \ref ownership_of_strings and xml_node::value(const Ch *, std::size_t).
|
||||
//! \param value Vame of node to set. Must be zero terminated.
|
||||
void value(const Ch *value)
|
||||
void value(const Ch *value_)
|
||||
{
|
||||
this->value(value, internal::measure(value));
|
||||
this->value(value_, internal::measure(value_));
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
@ -852,14 +852,14 @@ namespace rapidxml
|
||||
//! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string
|
||||
//! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters
|
||||
//! \return Pointer to found attribute, or 0 if not found.
|
||||
xml_attribute<Ch> *next_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
|
||||
xml_attribute<Ch> *next_attribute(const Ch *name_ = 0, std::size_t name_size_ = 0, bool case_sensitive = true) const
|
||||
{
|
||||
if (name)
|
||||
if (name_)
|
||||
{
|
||||
if (name_size == 0)
|
||||
name_size = internal::measure(name);
|
||||
if (name_size_ == 0)
|
||||
name_size_ = internal::measure(name_);
|
||||
for (xml_attribute<Ch> *attribute = m_next_attribute; attribute; attribute = attribute->m_next_attribute)
|
||||
if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive))
|
||||
if (internal::compare(attribute->name(), attribute->name_size(), name_, name_size_, case_sensitive))
|
||||
return attribute;
|
||||
return 0;
|
||||
}
|
||||
@ -897,8 +897,8 @@ namespace rapidxml
|
||||
//! Constructs an empty node with the specified type.
|
||||
//! Consider using memory_pool of appropriate document to allocate nodes manually.
|
||||
//! \param type Type of node to construct.
|
||||
xml_node(node_type type)
|
||||
: m_type(type)
|
||||
xml_node(node_type type_)
|
||||
: m_type(type_)
|
||||
, m_first_node(0)
|
||||
, m_first_attribute(0)
|
||||
{
|
||||
@ -932,14 +932,14 @@ namespace rapidxml
|
||||
//! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string
|
||||
//! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters
|
||||
//! \return Pointer to found child, or 0 if not found.
|
||||
xml_node<Ch> *first_node(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
|
||||
xml_node<Ch> *first_node(const Ch *name_ = 0, std::size_t name_size_ = 0, bool case_sensitive = true) const
|
||||
{
|
||||
if (name)
|
||||
if (name_)
|
||||
{
|
||||
if (name_size == 0)
|
||||
name_size = internal::measure(name);
|
||||
if (name_size_ == 0)
|
||||
name_size_ = internal::measure(name_);
|
||||
for (xml_node<Ch> *child = m_first_node; child; child = child->next_sibling())
|
||||
if (internal::compare(child->name(), child->name_size(), name, name_size, case_sensitive))
|
||||
if (internal::compare(child->name(), child->name_size(), name_, name_size_, case_sensitive))
|
||||
return child;
|
||||
return 0;
|
||||
}
|
||||
@ -1000,15 +1000,15 @@ namespace rapidxml
|
||||
//! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string
|
||||
//! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters
|
||||
//! \return Pointer to found sibling, or 0 if not found.
|
||||
xml_node<Ch> *next_sibling(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
|
||||
xml_node<Ch> *next_sibling(const Ch *name_ = 0, std::size_t name_size_ = 0, bool case_sensitive = true) const
|
||||
{
|
||||
assert(this->m_parent); // Cannot query for siblings if node has no parent
|
||||
if (name)
|
||||
if (name_)
|
||||
{
|
||||
if (name_size == 0)
|
||||
name_size = internal::measure(name);
|
||||
if (name_size_ == 0)
|
||||
name_size_ = internal::measure(name_);
|
||||
for (xml_node<Ch> *sibling = m_next_sibling; sibling; sibling = sibling->m_next_sibling)
|
||||
if (internal::compare(sibling->name(), sibling->name_size(), name, name_size, case_sensitive))
|
||||
if (internal::compare(sibling->name(), sibling->name_size(), name_, name_size_, case_sensitive))
|
||||
return sibling;
|
||||
return 0;
|
||||
}
|
||||
@ -1021,14 +1021,14 @@ namespace rapidxml
|
||||
//! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string
|
||||
//! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters
|
||||
//! \return Pointer to found attribute, or 0 if not found.
|
||||
xml_attribute<Ch> *first_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
|
||||
xml_attribute<Ch> *first_attribute(const Ch *name_ = 0, std::size_t name_size_ = 0, bool case_sensitive = true) const
|
||||
{
|
||||
if (name)
|
||||
if (name_)
|
||||
{
|
||||
if (name_size == 0)
|
||||
name_size = internal::measure(name);
|
||||
if (name_size_ == 0)
|
||||
name_size_ = internal::measure(name_);
|
||||
for (xml_attribute<Ch> *attribute = m_first_attribute; attribute; attribute = attribute->m_next_attribute)
|
||||
if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive))
|
||||
if (internal::compare(attribute->name(), attribute->name_size(), name_, name_size_, case_sensitive))
|
||||
return attribute;
|
||||
return 0;
|
||||
}
|
||||
@ -1061,9 +1061,9 @@ namespace rapidxml
|
||||
|
||||
//! Sets type of node.
|
||||
//! \param type Type of node to set.
|
||||
void type(node_type type)
|
||||
void type(node_type type_)
|
||||
{
|
||||
m_type = type;
|
||||
m_type = type_;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
@ -1786,7 +1786,7 @@ namespace rapidxml
|
||||
}
|
||||
|
||||
// Remember value start
|
||||
Ch *value = text;
|
||||
Ch *value_ = text;
|
||||
|
||||
// Skip until end of comment
|
||||
while (text[0] != Ch('-') || text[1] != Ch('-') || text[2] != Ch('>'))
|
||||
@ -1798,7 +1798,7 @@ namespace rapidxml
|
||||
|
||||
// Create comment node
|
||||
xml_node<Ch> *comment = this->allocate_node(node_comment);
|
||||
comment->value(value, text - value);
|
||||
comment->value(value_, text - value_);
|
||||
|
||||
// Place zero terminator after comment value
|
||||
if (!(Flags & parse_no_string_terminators))
|
||||
@ -1813,7 +1813,7 @@ namespace rapidxml
|
||||
xml_node<Ch> *parse_doctype(Ch *&text)
|
||||
{
|
||||
// Remember value start
|
||||
Ch *value = text;
|
||||
Ch *value_ = text;
|
||||
|
||||
// Skip to >
|
||||
while (*text != Ch('>'))
|
||||
@ -1857,7 +1857,7 @@ namespace rapidxml
|
||||
{
|
||||
// Create a new doctype node
|
||||
xml_node<Ch> *doctype = this->allocate_node(node_doctype);
|
||||
doctype->value(value, text - value);
|
||||
doctype->value(value_, text - value_);
|
||||
|
||||
// Place zero terminator after value
|
||||
if (!(Flags & parse_no_string_terminators))
|
||||
@ -1885,17 +1885,17 @@ namespace rapidxml
|
||||
xml_node<Ch> *pi = this->allocate_node(node_pi);
|
||||
|
||||
// Extract PI target name
|
||||
Ch *name = text;
|
||||
Ch *name_ = text;
|
||||
skip<node_name_pred, Flags>(text);
|
||||
if (text == name)
|
||||
if (text == name_)
|
||||
RAPIDXML_PARSE_ERROR("expected PI target", text);
|
||||
pi->name(name, text - name);
|
||||
pi->name(name_, text - name_);
|
||||
|
||||
// Skip whitespace between pi target and pi
|
||||
skip<whitespace_pred, Flags>(text);
|
||||
|
||||
// Remember start of pi
|
||||
Ch *value = text;
|
||||
Ch *value_ = text;
|
||||
|
||||
// Skip to '?>'
|
||||
while (text[0] != Ch('?') || text[1] != Ch('>'))
|
||||
@ -1906,7 +1906,7 @@ namespace rapidxml
|
||||
}
|
||||
|
||||
// Set pi value (verbatim, no entity expansion or whitespace normalization)
|
||||
pi->value(value, text - value);
|
||||
pi->value(value_, text - value_);
|
||||
|
||||
// Place zero terminator after name and value
|
||||
if (!(Flags & parse_no_string_terminators))
|
||||
@ -1943,7 +1943,7 @@ namespace rapidxml
|
||||
text = contents_start;
|
||||
|
||||
// Skip until end of data
|
||||
Ch *value = text, *end;
|
||||
Ch *value_ = text, *end;
|
||||
if (Flags & parse_normalize_whitespace)
|
||||
end = skip_and_expand_character_refs<text_pred, text_pure_with_ws_pred, Flags>(text);
|
||||
else
|
||||
@ -1971,14 +1971,14 @@ namespace rapidxml
|
||||
if (!(Flags & parse_no_data_nodes))
|
||||
{
|
||||
xml_node<Ch> *data = this->allocate_node(node_data);
|
||||
data->value(value, end - value);
|
||||
data->value(value_, end - value_);
|
||||
node->append_node(data);
|
||||
}
|
||||
|
||||
// Add data to parent node if no data exists yet
|
||||
if (!(Flags & parse_no_element_values))
|
||||
if (*node->value() == Ch('\0'))
|
||||
node->value(value, end - value);
|
||||
node->value(value_, end - value_);
|
||||
|
||||
// Place zero terminator after value
|
||||
if (!(Flags & parse_no_string_terminators))
|
||||
@ -2011,7 +2011,7 @@ namespace rapidxml
|
||||
}
|
||||
|
||||
// Skip until end of cdata
|
||||
Ch *value = text;
|
||||
Ch *value_ = text;
|
||||
while (text[0] != Ch(']') || text[1] != Ch(']') || text[2] != Ch('>'))
|
||||
{
|
||||
if (!text[0])
|
||||
@ -2021,7 +2021,7 @@ namespace rapidxml
|
||||
|
||||
// Create new cdata node
|
||||
xml_node<Ch> *cdata = this->allocate_node(node_cdata);
|
||||
cdata->value(value, text - value);
|
||||
cdata->value(value_, text - value_);
|
||||
|
||||
// Place zero terminator after value
|
||||
if (!(Flags & parse_no_string_terminators))
|
||||
@ -2039,11 +2039,11 @@ namespace rapidxml
|
||||
xml_node<Ch> *element = this->allocate_node(node_element);
|
||||
|
||||
// Extract element name
|
||||
Ch *name = text;
|
||||
Ch *name_ = text;
|
||||
skip<node_name_pred, Flags>(text);
|
||||
if (text == name)
|
||||
if (text == name_)
|
||||
RAPIDXML_PARSE_ERROR("expected element name", text);
|
||||
element->name(name, text - name);
|
||||
element->name(name_, text - name_);
|
||||
|
||||
// Skip whitespace between element name and attributes or >
|
||||
skip<whitespace_pred, Flags>(text);
|
||||
@ -2239,15 +2239,15 @@ namespace rapidxml
|
||||
while (attribute_name_pred::test(*text))
|
||||
{
|
||||
// Extract attribute name
|
||||
Ch *name = text;
|
||||
Ch *name_ = text;
|
||||
++text; // Skip first character of attribute name
|
||||
skip<attribute_name_pred, Flags>(text);
|
||||
if (text == name)
|
||||
RAPIDXML_PARSE_ERROR("expected attribute name", name);
|
||||
if (text == name_)
|
||||
RAPIDXML_PARSE_ERROR("expected attribute name", name_);
|
||||
|
||||
// Create new attribute
|
||||
xml_attribute<Ch> *attribute = this->allocate_attribute();
|
||||
attribute->name(name, text - name);
|
||||
attribute->name(name_, text - name_);
|
||||
node->append_attribute(attribute);
|
||||
|
||||
// Skip whitespace after attribute name
|
||||
@ -2272,7 +2272,7 @@ namespace rapidxml
|
||||
++text;
|
||||
|
||||
// Extract attribute value and expand char refs in it
|
||||
Ch *value = text, *end;
|
||||
Ch *value_ = text, *end;
|
||||
const int AttFlags = Flags & ~parse_normalize_whitespace; // No whitespace normalization in attributes
|
||||
if (quote == Ch('\''))
|
||||
end = skip_and_expand_character_refs<attribute_value_pred<Ch('\'')>, attribute_value_pure_pred<Ch('\'')>, AttFlags>(text);
|
||||
@ -2280,7 +2280,7 @@ namespace rapidxml
|
||||
end = skip_and_expand_character_refs<attribute_value_pred<Ch('"')>, attribute_value_pure_pred<Ch('"')>, AttFlags>(text);
|
||||
|
||||
// Set attribute value
|
||||
attribute->value(value, end - value);
|
||||
attribute->value(value_, end - value_);
|
||||
|
||||
// Make sure that end quote is present
|
||||
if (*text != quote)
|
||||
|
@ -344,13 +344,13 @@ int main()
|
||||
const bool randomize = false;
|
||||
|
||||
//########################################
|
||||
auto vectorDoubleTest = [&](size_t s, bool randomize)
|
||||
auto vectorDoubleTest = [&](size_t s, bool randomize_)
|
||||
{
|
||||
std::ostringstream name;
|
||||
name << "Vector(double) size " << s;
|
||||
|
||||
std::vector<double> data(s);
|
||||
if(randomize)
|
||||
if(randomize_)
|
||||
for( auto & d : data )
|
||||
d = rngD();
|
||||
|
||||
@ -363,13 +363,13 @@ int main()
|
||||
vectorDoubleTest(1024*1024, randomize); // 8MB
|
||||
|
||||
//########################################
|
||||
auto vectorCharTest = [&](size_t s, bool randomize)
|
||||
auto vectorCharTest = [&](size_t s, bool randomize_)
|
||||
{
|
||||
std::ostringstream name;
|
||||
name << "Vector(uint8_t) size " << s;
|
||||
|
||||
std::vector<uint8_t> data(s);
|
||||
if(randomize)
|
||||
if(randomize_)
|
||||
for( auto & d : data )
|
||||
d = rngC();
|
||||
|
||||
|
@ -316,7 +316,7 @@ void test_structs()
|
||||
std::random_device rd;
|
||||
std::mt19937 gen(rd());
|
||||
|
||||
for(int i=0; i<100; ++i)
|
||||
for(int ii=0; ii<100; ++ii)
|
||||
{
|
||||
StructInternalSerialize o_iser = { random_value<int>(gen), random_value<int>(gen) };
|
||||
StructInternalSplit o_ispl = { random_value<int>(gen), random_value<int>(gen) };
|
||||
@ -374,7 +374,7 @@ void test_array()
|
||||
std::random_device rd;
|
||||
std::mt19937 gen(rd());
|
||||
|
||||
for(int i=0; i<100; ++i)
|
||||
for(int ii=0; ii<100; ++ii)
|
||||
{
|
||||
std::array<int, 100> o_podarray;
|
||||
for(auto & elem : o_podarray)
|
||||
@ -459,7 +459,7 @@ void test_deque()
|
||||
std::random_device rd;
|
||||
std::mt19937 gen(rd());
|
||||
|
||||
for(int i=0; i<100; ++i)
|
||||
for(int ii=0; ii<100; ++ii)
|
||||
{
|
||||
std::deque<int> o_poddeque(100);
|
||||
for(auto & elem : o_poddeque)
|
||||
@ -550,7 +550,7 @@ void test_forward_list()
|
||||
std::random_device rd;
|
||||
std::mt19937 gen(rd());
|
||||
|
||||
for(int i=0; i<100; ++i)
|
||||
for(int ii=0; ii<100; ++ii)
|
||||
{
|
||||
std::forward_list<int> o_podforward_list(100);
|
||||
for(auto & elem : o_podforward_list)
|
||||
@ -635,7 +635,7 @@ void test_list()
|
||||
std::random_device rd;
|
||||
std::mt19937 gen(rd());
|
||||
|
||||
for(int i=0; i<100; ++i)
|
||||
for(int ii=0; ii<100; ++ii)
|
||||
{
|
||||
std::list<int> o_podlist(100);
|
||||
for(auto & elem : o_podlist)
|
||||
@ -720,7 +720,7 @@ void test_map()
|
||||
std::random_device rd;
|
||||
std::mt19937 gen(rd());
|
||||
|
||||
for(int i=0; i<100; ++i)
|
||||
for(int ii=0; ii<100; ++ii)
|
||||
{
|
||||
std::map<size_t, std::vector<StructInternalSerialize>> o_vectormap;
|
||||
for(int j=0; j<10; ++j)
|
||||
@ -804,7 +804,7 @@ void test_map_memory()
|
||||
std::random_device rd;
|
||||
std::mt19937 gen(rd());
|
||||
|
||||
for(int i=0; i<100; ++i)
|
||||
for(int ii=0; ii<100; ++ii)
|
||||
{
|
||||
std::map<int, std::unique_ptr<int>> o_uniqueptrMap;
|
||||
std::map<int, std::shared_ptr<int>> o_sharedptrMap;
|
||||
@ -894,7 +894,7 @@ void test_multimap()
|
||||
std::random_device rd;
|
||||
std::mt19937 gen(rd());
|
||||
|
||||
for(int i=0; i<100; ++i)
|
||||
for(int ii=0; ii<100; ++ii)
|
||||
{
|
||||
std::multimap<std::string, int> o_podmultimap;
|
||||
for(int j=0; j<100; ++j)
|
||||
@ -1013,7 +1013,7 @@ void test_memory()
|
||||
std::random_device rd;
|
||||
std::mt19937 gen(rd());
|
||||
|
||||
for(int i=0; i<100; ++i)
|
||||
for(int ii=0; ii<100; ++ii)
|
||||
{
|
||||
std::shared_ptr<int> o_xptr1 = std::make_shared<int>(random_value<int>(gen));
|
||||
std::shared_ptr<int> o_xptr2 = o_xptr1;
|
||||
@ -1086,7 +1086,7 @@ void test_queue()
|
||||
std::random_device rd;
|
||||
std::mt19937 gen(rd());
|
||||
|
||||
for(int i=0; i<100; ++i)
|
||||
for(int ii=0; ii<100; ++ii)
|
||||
{
|
||||
std::queue<int> o_podqueue;
|
||||
for(int j=0; j<100; ++j)
|
||||
@ -1183,7 +1183,7 @@ void test_priority_queue()
|
||||
std::random_device rd;
|
||||
std::mt19937 gen(rd());
|
||||
|
||||
for(int i=0; i<100; ++i)
|
||||
for(int ii=0; ii<100; ++ii)
|
||||
{
|
||||
std::priority_queue<int> o_podpriority_queue;
|
||||
for(int j=0; j<100; ++j)
|
||||
@ -1280,7 +1280,7 @@ void test_set()
|
||||
std::random_device rd;
|
||||
std::mt19937 gen(rd());
|
||||
|
||||
for(int i=0; i<100; ++i)
|
||||
for(int ii=0; ii<100; ++ii)
|
||||
{
|
||||
std::set<int> o_podset;
|
||||
for(int j=0; j<100; ++j)
|
||||
@ -1365,7 +1365,7 @@ void test_multiset()
|
||||
std::random_device rd;
|
||||
std::mt19937 gen(rd());
|
||||
|
||||
for(int i=0; i<100; ++i)
|
||||
for(int ii=0; ii<100; ++ii)
|
||||
{
|
||||
std::multiset<int> o_podmultiset;
|
||||
for(int j=0; j<100; ++j)
|
||||
@ -1489,7 +1489,7 @@ void test_stack()
|
||||
std::random_device rd;
|
||||
std::mt19937 gen(rd());
|
||||
|
||||
for(int i=0; i<100; ++i)
|
||||
for(int ii=0; ii<100; ++ii)
|
||||
{
|
||||
std::stack<int> o_podstack;
|
||||
for(int j=0; j<100; ++j)
|
||||
@ -1680,7 +1680,7 @@ void test_unordered_map()
|
||||
std::random_device rd;
|
||||
std::mt19937 gen(rd());
|
||||
|
||||
for(int i=0; i<100; ++i)
|
||||
for(int ii=0; ii<100; ++ii)
|
||||
{
|
||||
std::unordered_map<std::string, int> o_podunordered_map;
|
||||
for(int j=0; j<100; ++j)
|
||||
@ -1794,7 +1794,7 @@ void test_unordered_multimap()
|
||||
std::random_device rd;
|
||||
std::mt19937 gen(rd());
|
||||
|
||||
for(int i=0; i<100; ++i)
|
||||
for(int ii=0; ii<100; ++ii)
|
||||
{
|
||||
std::unordered_multimap<std::string, int> o_podunordered_multimap;
|
||||
for(int j=0; j<100; ++j)
|
||||
@ -1939,7 +1939,7 @@ void test_unordered_set()
|
||||
std::random_device rd;
|
||||
std::mt19937 gen(rd());
|
||||
|
||||
for(int i=0; i<100; ++i)
|
||||
for(int ii=0; ii<100; ++ii)
|
||||
{
|
||||
std::unordered_set<int> o_podunordered_set;
|
||||
for(int j=0; j<100; ++j)
|
||||
@ -2043,7 +2043,7 @@ void test_unordered_multiset()
|
||||
std::random_device rd;
|
||||
std::mt19937 gen(rd());
|
||||
|
||||
for(int i=0; i<100; ++i)
|
||||
for(int ii=0; ii<100; ++ii)
|
||||
{
|
||||
std::unordered_multiset<int> o_podunordered_multiset;
|
||||
for(int j=0; j<100; ++j)
|
||||
@ -2167,7 +2167,7 @@ void test_vector()
|
||||
std::random_device rd;
|
||||
std::mt19937 gen(rd());
|
||||
|
||||
for(int i=0; i<100; ++i)
|
||||
for(int ii=0; ii<100; ++ii)
|
||||
{
|
||||
std::vector<int> o_podvector(100);
|
||||
for(auto & elem : o_podvector)
|
||||
@ -2269,7 +2269,7 @@ void test_pair()
|
||||
|
||||
auto rng = [&](){ return random_value<int>(gen); };
|
||||
|
||||
for(int i=0; i<100; ++i)
|
||||
for(int ii=0; ii<100; ++ii)
|
||||
{
|
||||
std::pair<int, int> o_podpair = {rng(), rng()};
|
||||
std::pair<StructInternalSerialize, StructInternalSerialize> o_iserpair = {{rng(), rng()}, {rng(), rng()}};
|
||||
@ -2350,7 +2350,7 @@ void test_tuple()
|
||||
|
||||
auto rng = [&](){ return random_value<int>(gen); };
|
||||
|
||||
for(int i=0; i<100; ++i)
|
||||
for(int ii=0; ii<100; ++ii)
|
||||
{
|
||||
auto o_podtuple = std::make_tuple( rng(), rng(), rng(), rng() );
|
||||
auto o_isertuple = std::make_tuple( StructInternalSerialize( rng(), rng() ),
|
||||
@ -2437,7 +2437,7 @@ void test_complex()
|
||||
auto rngD = [&](){ return random_value<double>(gen); };
|
||||
auto rngLD = [&](){ return random_value<long double>(gen); };
|
||||
|
||||
for(int i=0; i<100; ++i)
|
||||
for(int ii=0; ii<100; ++ii)
|
||||
{
|
||||
std::complex<float> o_float( rngF(), rngF() );
|
||||
std::complex<double> o_double( rngD(), rngD() );
|
||||
@ -2504,7 +2504,7 @@ void test_bitset()
|
||||
auto rng65 = [&](){ return random_binary_string<65>( gen ); };
|
||||
auto rng256 = [&](){ return random_binary_string<256>( gen ); };
|
||||
|
||||
for(int i=0; i<100; ++i)
|
||||
for(int ii=0; ii<100; ++ii)
|
||||
{
|
||||
std::bitset<32> o_bit32( rng32() );
|
||||
std::bitset<65> o_bit65( rng65() );
|
||||
@ -2562,7 +2562,7 @@ BOOST_AUTO_TEST_CASE( json_bitset )
|
||||
template <class IArchive, class OArchive>
|
||||
void test_chrono()
|
||||
{
|
||||
for(int i=0; i<100; ++i)
|
||||
for(int ii=0; ii<100; ++ii)
|
||||
{
|
||||
auto o_timePoint1 = std::chrono::system_clock::now();
|
||||
auto o_timePoint2 = std::chrono::steady_clock::now();
|
||||
@ -2711,7 +2711,7 @@ void test_structs_specialized()
|
||||
std::random_device rd;
|
||||
std::mt19937 gen(rd());
|
||||
|
||||
for(int i=0; i<100; ++i)
|
||||
for(int ii=0; ii<100; ++ii)
|
||||
{
|
||||
SpecializedMSerialize o_iser = { random_value<int>(gen) };
|
||||
SpecializedMSplit o_ispl = { random_value<int>(gen) };
|
||||
@ -2829,7 +2829,7 @@ void test_polymorphic()
|
||||
auto rngF = [&](){ return random_value<float>( gen ); };
|
||||
auto rngD = [&](){ return random_value<double>( gen ); };
|
||||
|
||||
for(int i=0; i<100; ++i)
|
||||
for(int ii=0; ii<100; ++ii)
|
||||
{
|
||||
std::shared_ptr<PolyBase> o_shared = std::make_shared<PolyDerived>( rngI(), rngF(), rngB(), rngD() );
|
||||
std::weak_ptr<PolyBase> o_weak = o_shared;
|
||||
@ -3057,7 +3057,7 @@ void test_unordered_loads()
|
||||
auto rngD = [&](){ return random_value<double>( gen ); };
|
||||
auto rngS = [&](){ return random_basic_string<char>( gen ); };
|
||||
|
||||
for(int i=0; i<100; ++i)
|
||||
for(int ii=0; ii<100; ++ii)
|
||||
{
|
||||
auto const name1 = rngS();
|
||||
auto const name2 = rngS();
|
||||
|
Loading…
x
Reference in New Issue
Block a user