Unit Tests - Att

- Merged all old Mod tests into Att.
- Fixed broken tests.
This commit is contained in:
Paul Beckingham
2009-06-03 21:20:09 -04:00
parent 55771cc999
commit f295fdf78f
2 changed files with 12 additions and 9 deletions

View File

@@ -107,7 +107,12 @@ bool Att::parse (Nibbler& n)
{
std::string mod;
if (n.getUntilOneOf (".:", mod))
mMods.push_back (mod);
{
if (validMod (mod))
mMods.push_back (mod);
else
throw std::string ("The name '") + mod + "' is not a valid modifier";
}
else
throw std::string ("Missing . or : after modifier");
}
@@ -212,7 +217,10 @@ std::string Att::composeF4 () const
////////////////////////////////////////////////////////////////////////////////
void Att::addMod (const std::string& mod)
{
mMods.push_back (mod);
if (validMod (mod))
mMods.push_back (mod);
else
throw std::string ("The name '") + mod + "' is not a valid modifier";
}
////////////////////////////////////////////////////////////////////////////////