//: C02:SimpleDateTest.cpp // From "Thinking in C++, Volume 2", by Bruce Eckel & Chuck Allison. // (c) 1995-2004 MindView, Inc. All Rights Reserved. // See source code use permissions stated in the file 'License.txt', // distributed with the code package available at www.MindView.net. //{L} Date #include #include "Date.h" // From Appendix B using namespace std; // Test machinery int nPass = 0, nFail = 0; void test(bool t) { if(t) nPass++; else nFail++; } int main() { Date mybday(1951, 10, 1); test(mybday.getYear() == 1951); test(mybday.getMonth() == 10); test(mybday.getDay() == 1); cout << "Passed: " << nPass << ", Failed: " << nFail << endl; } /* Expected output: Passed: 3, Failed: 0 */ ///:~