summaryrefslogtreecommitdiff
path: root/test/utility/t_times.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-08-05 19:48:42 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-08-05 19:48:42 -0400
commit36cd8164049b570d9730a886e55d5a985bae1c2b (patch)
treea667029488caf3da54ec6d673628942ef6958ba8 /test/utility/t_times.cc
parent262bda35cfb7e739e1d148330ac429abfeaad895 (diff)
downloadfork-ledger-36cd8164049b570d9730a886e55d5a985bae1c2b.tar.gz
fork-ledger-36cd8164049b570d9730a886e55d5a985bae1c2b.tar.bz2
fork-ledger-36cd8164049b570d9730a886e55d5a985bae1c2b.zip
Moved the test sources around, so that all the unit tests are in test/unit.
Diffstat (limited to 'test/utility/t_times.cc')
-rw-r--r--test/utility/t_times.cc81
1 files changed, 0 insertions, 81 deletions
diff --git a/test/utility/t_times.cc b/test/utility/t_times.cc
deleted file mode 100644
index 05fd34ce..00000000
--- a/test/utility/t_times.cc
+++ /dev/null
@@ -1,81 +0,0 @@
-#include "t_times.h"
-
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(DateTimeTestCase, "utility");
-
-void DateTimeTestCase::setUp() {}
-void DateTimeTestCase::tearDown() {}
-
-void DateTimeTestCase::testConstructors()
-{
-#if 0
- std::time_t time_t_now = std::time(NULL);
- struct tm * moment = std::localtime(&time_t_now);
-
- std::time_t localMoment = std::mktime(moment);
-
- ptime d0;
- ptime d1(parse_datetime("1990/01/01"));
- ptime d3(boost::posix_time::from_time_t(localMoment));
- ptime d4(parse_datetime("2006/12/25"));
- //ptime d5(parse_datetime("12/25"));
- ptime d6(parse_datetime("2006.12.25"));
- //ptime d7(parse_datetime("12.25"));
- ptime d8(parse_datetime("2006-12-25"));
- //ptime d9(parse_datetime("12-25"));
-#if 0
- ptime d10(parse_datetime("tue"));
- ptime d11(parse_datetime("tuesday"));
- ptime d12(parse_datetime("feb"));
- ptime d13(parse_datetime("february"));
- ptime d14(parse_datetime("2006"));
-#endif
- ptime d15(d3);
-
- assertTrue(d0.is_not_a_date_time());
- assertFalse(d1.is_not_a_date_time());
- assertFalse(d4.is_not_a_date_time());
-
- assertTrue(now > d1);
- //assertTrue(now <= d3);
- assertTrue(now > d4);
-
- assertEqual(d3, d15);
- assertEqual(d4, d6);
- assertEqual(d4, d8);
- //assertEqual(d5, d7);
- //assertEqual(d5, d9);
-#if 0
- assertEqual(d10, d11);
- assertEqual(d12, d13);
-#endif
-
-#if 0
- assertThrow(parse_datetime("2007/02/29"), datetime_error *);
- assertThrow(parse_datetime("2007/13/01"), datetime_error *);
- assertThrow(parse_datetime("2007/00/01"), datetime_error *);
- assertThrow(parse_datetime("2007/01/00"), datetime_error *);
- assertThrow(parse_datetime("2007/00/00"), datetime_error *);
- assertThrow(parse_datetime("2007/05/32"), datetime_error *);
-
- assertThrow(parse_datetime("2006x/12/25"), datetime_error *);
- assertThrow(parse_datetime("2006/12x/25"), datetime_error *);
- //assertThrow(parse_datetime("2006/12/25x"), datetime_error *);
-
- assertThrow(parse_datetime("feb/12/25"), datetime_error *);
- assertThrow(parse_datetime("2006/mon/25"), datetime_error *);
- assertThrow(parse_datetime("2006/12/web"), datetime_error *);
-
- assertThrow(parse_datetime("12*25"), datetime_error *);
-
- assertThrow(parse_datetime("tuf"), datetime_error *);
- assertThrow(parse_datetime("tufsday"), datetime_error *);
- assertThrow(parse_datetime("fec"), datetime_error *);
- assertThrow(parse_datetime("fecruary"), datetime_error *);
- assertThrow(parse_datetime("207x"), datetime_error *);
- assertThrow(parse_datetime("hello"), datetime_error *);
-
- interval_t i1;
- interval_t i2;
-#endif
-#endif
-}