Minor Refactoring

- Added support for more type-specific checks of attribute values.
- Added support for more type-specific attribute rendering.
- Improved generalized methods for checking columns in a report.
- Added unit tests.
- Minor code cleanup.
- Added secret hidden feature for internal testing.
This commit is contained in:
Paul Beckingham
2012-02-05 20:56:46 -05:00
parent cffc42484e
commit 96fe3f42ba
83 changed files with 351 additions and 81 deletions

View File

@@ -49,7 +49,7 @@ int convertDuration (const std::string& input)
int main (int argc, char** argv)
{
UnitTest t (643);
UnitTest t (644);
Duration d;
@@ -791,6 +791,10 @@ int main (int argc, char** argv)
left -= right;
t.is ((int)(time_t)left, 1, "3 -= 2, 3 is now 1");
t.is ((int)(time_t)right, 2, "3 -= 2, 2 is still 2");
// Assorted regression tests.
left = Duration ("-864000.00000");
t.is ((int)(time_t)left, 864000, "-864000.00000 -> 864000");
}
catch (const std::string& e) { t.diag (e); }

View File

@@ -39,15 +39,15 @@ int main (int argc, char** argv)
{
#ifdef NIBBLER_FEATURE_DATE
#ifdef NIBBLER_FEATURE_REGEX
UnitTest t (296);
UnitTest t (299);
#else
UnitTest t (272);
UnitTest t (275);
#endif
#else
#ifdef NIBBLER_FEATURE_REGEX
UnitTest t (246);
UnitTest t (249);
#else
UnitTest t (222);
UnitTest t (225);
#endif
#endif
@@ -303,6 +303,11 @@ int main (int argc, char** argv)
t.is (d, 2.0, 0.000001, "'2.0' : getNumber () -> '2.0'");
t.ok (n.depleted (), " '' : depleted () -> true");
n = Nibbler ("-864000.00000");
t.ok (n.getNumber (d), "'-864000.00000' : getNumber () -> true");
t.is (d, -864000.0, "'-864000.00000' : getNumber () -> -864000.0");
t.ok (n.depleted (), " '' : depleted () -> true");
// bool getLiteral (const std::string&);
t.diag ("Nibbler::getLiteral");
n = Nibbler ("foobar");