3 /// Tests for the Date class
7 Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/)
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU General Public License in the COPYING file at the
19 root directory of this project for more details.
22 #include <barry/record.h>
29 using namespace Barry
;
34 memset(&t
, 0, sizeof(t
));
40 TEST( d
.ToYYYYMMDD() == "20110228", "ToYYYYMMDD() failed");
41 TEST( d
.ToBBString() == "28/02/2011", "ToBBString() failed");
45 TEST( oss
.str() == "2011/02/28", "Stream output failed: " << oss
.str());
49 TEST( d2
.ToYYYYMMDD() == "20110228", "FromTm() failed");
54 TEST( d2
.ToYYYYMMDD() == "20110228", "ToTm() failed");
56 d2
.FromBBString(d
.ToBBString());
57 TEST( d2
.ToYYYYMMDD() == "20110228", "FromBBString() failed");
59 d2
.FromYYYYMMDD(d
.ToYYYYMMDD());
60 TEST( d2
.ToYYYYMMDD() == "20110228", "FromYYYMMDD() failed");
65 NewTest
testdate("Date class", &TestDate
);