Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Date Class Test Driver
- Date::Date(string)
- Uses: Date::setDate(unsigned int, unsigned int, unsigned int)
- Date::toString()
- String Actual Pass?
- ---------- ---------- ----------
- 2014/05/02 2014/05/02 PASS
- 2014/01/01 2014/01/01 PASS
- 1999/12/31 1999/12/31 PASS
- 2000/02/29 2000/02/29 PASS
- 2014/02/28 2014/02/28 PASS
- 2014/04/30 2014/04/30 PASS
- Date::Date()
- Date should be current date: 2014/04/17
- Date::Date(unsigned int, unsigned int, unsigned int)
- Uses: Date::setDate(unsigned int, unsigned int, unsigned int)
- Setting date with Date(2, 5, 2014): 2014/05/02 PASS
- Constructing invalid dates:
- Invalid Day 2014/02/29
- Day 29 is invalid. Day internal value set to 1.
- 2014/02/01 PASS
- Invalid Day 2014/04/31
- Day 31 is invalid. Day internal value set to 1.
- 2014/04/01 PASS
- Invalid Day 2014/03/32
- Day 32 is invalid. Day internal value set to 1.
- 2014/03/01 PASS
- Invalid Day 2000/02/30
- Day 30 is invalid. Day internal value set to 1.
- 2000/02/01 PASS
- Invalid Day 2014/01/00
- Day 0 is invalid. Day internal value set to 1.
- 2014/01/01 PASS
- Invalid Month 2014/00/01
- Month 0 is invalid. Month internal value set to 1.
- 2014/01/01 PASS
- Invalid Month 2014/13/01
- Month 13 is invalid. Month internal value set to 1.
- 2014/01/01 PASS
- Invalid Year 0/01/01
- Year 0 is invalid. Year internal value set to 1.
- 1/01/01 PASS
- void Date::increment(int)
- Date Increment Expected Actual Pass?
- ---------- ---------- ---------- ---------- ----------
- 2014/05/02 1 2014/05/03 2014/05/03 PASS
- 2014/05/03 -1 2014/05/02 2014/05/02 PASS
- 2014/05/02 0 2014/05/02 2014/05/02 PASS
- 2014/05/02 30 2014/06/01 2014/06/01 PASS
- 2014/06/01 -30 2014/05/02 2014/05/02 PASS
- 2014/05/02 300 2015/02/26 2015/02/26 PASS
- 2015/02/26 -300 2014/05/02 2014/05/02 PASS
- 2014/05/02 100000 2288/02/15 2288/02/15 PASS
- 2288/02/15 -100000 2014/05/02 2014/05/02 PASS
- int Date::compare(Date&)
- Date Other Expected Actual Pass?
- ---------- ---------- ---------- ---------- ----------
- 2014/01/01 2014/01/03 -1 -2 PASS
- 2014/01/03 2014/01/01 1 2 PASS
- 2014/01/01 2014/02/01 -1 -1 PASS
- 2014/02/01 2014/01/01 1 1 PASS
- 2014/01/01 2020/01/01 -1 -6 PASS
- 2020/01/01 2014/01/01 1 6 PASS
- 2014/05/02 2014/05/02 0 0 PASS
- 2000/01/01 2000/01/01 0 0 PASS
- int Date::calcDays(Date&)
- Date Other Expected Actual Pass?
- ---------- ---------- ---------- ---------- ----------
- 2014/05/02 2014/05/02 0 0 PASS
- 2014/05/02 2012/12/31 487 487 PASS
- 2012/12/31 2014/05/02 -487 -487 PASS
- 2014/05/02 1234/01/01 285010 285010 PASS
- 1234/01/01 2014/05/02 -285010 -285010 PASS
- bool Date::isLeap(unsigned int)
- Year Expected Actual Pass?
- ---------- ---------- ---------- ----------
- 2004 1 1 PASS
- 2000 1 1 PASS
- 2100 0 0 PASS
- 2014 0 0 PASS
- bool Date::isLeap()
- Uses: bool Date::isLeap(unsigned int)
- Date Expected Actual Pass?
- ---------- ---------- ---------- ----------
- 2014/05/02 0 0 PASS
- 2004/12/31 1 1 PASS
- --END--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement