Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't test variants of all params.

  • Loading branch information...
commit 7639956edcbf9041b7a9d0143e13f280bd69eb48 1 parent 9223ff8
@erikogenvik erikogenvik authored
Showing with 13 additions and 9 deletions.
  1. +12 −9 test/ElementExerciser.h
  2. +1 −0  test/ServerInfo_unittest.cpp
View
21 test/ElementExerciser.h
@@ -22,9 +22,11 @@ class ElementParam
{
public:
Atlas::Message::Element defaultElement;
+ bool testVariants;
- ElementParam(Atlas::Message::Element defaultElement) :
- defaultElement(defaultElement)
+ ElementParam(Atlas::Message::Element defaultElement, bool testVariants =
+ true) :
+ defaultElement(defaultElement), testVariants(testVariants)
{
}
@@ -136,14 +138,15 @@ class ElementExerciser
//throwing an exception or crashing.
for (std::map<std::string, ElementParam>::const_iterator I =
mElementParams.begin(); I != mElementParams.end(); ++I) {
- for (size_t i = 0; i < (sizeof(types) / sizeof(*types)); ++i) {
- Atlas::Message::Element::Type type = types[i];
- EntityType entity;
- fillAllCorrectParams(entity);
- fillParam(entity, I->first, type);
- mExerciseSlot(entity);
+ if (I->second.testVariants) {
+ for (size_t i = 0; i < (sizeof(types) / sizeof(*types)); ++i) {
+ Atlas::Message::Element::Type type = types[i];
+ EntityType entity;
+ fillAllCorrectParams(entity);
+ fillParam(entity, I->first, type);
+ mExerciseSlot(entity);
+ }
}
-
}
}
View
1  test/ServerInfo_unittest.cpp
@@ -59,6 +59,7 @@ int main()
sigc::mem_fun(info, &Eris::TestServerInfo::injectAtlas));
ElementExerciser<Atlas::Objects::Entity::RootEntity> exerciser(slot);
exerciser.addParam("ruleset", ElementParam("mason"));
+ exerciser.addParam("name", ElementParam("a server", false));
exerciser.addParam("clients", ElementParam(2));
exerciser.addParam("server", ElementParam("localhost"));
exerciser.addParam("uptime", ElementParam(1000.0f));
Please sign in to comment.
Something went wrong with that request. Please try again.