[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: commconcpp2 changes to date.cpp
From: |
Federico Montesino Pouzols |
Subject: |
Re: commconcpp2 changes to date.cpp |
Date: |
Thu, 9 Jan 2003 11:47:36 +0100 |
User-agent: |
Mutt/1.4i |
Committed to CVS.
On Mon, Jan 06, 2003 at 04:45:04PM -0800, Chad Yates wrote:
> The recent changes to date.cpp broke the library under MSVC 6.0 on the
> following:
>
> nyear = int(trunc(i));
> nmonth = int(trunc(j));
> nday = int(trunc(k));
>
> I removed the trunc() function, and wondered if it was redundant anyway?
> since the int() should suffice.
>
> I also wrote a test suite for the date class (figured what better way to
> determine if trunc() was necessary, and it needed to be done anyway) The
> following are the test cases, and I'll save the code fore release with the
> test suite:
>
> DateTest.testSimpleGets ...
> DateTest.testSimpleSets ...
> DateTest.testIsValid ...
> DateTest.testGetDate_String ...
> DateTest.testGetDate_time_t ...
> DateTest.testGeteDate_struct_tm ...
> DateTest.testOperations ...
>
> and implemented a functions that were defined in the class but not
> implemented (linker errors). I also re-arranged some of the related methods
> to avoid duplicate code. I've attached diffs showing what was changed. here
> is a summary:
>
> date.cpp
> - added test fixture for the Date class and fixed/enhanced.
> - implemented missing tm* Date::getDate(tm*) function declared in
> class but not in implementation. took the liberty to make it
> also return a time_t instead of tm* in addition to filling the
> provided tm structure.
> - simplified time_t Date::getDate(void) to use the above function.
> - changed setDate parameter to const and placed (char*) in calls to Number.
> setDate's use of Number seems to guarantee constness, but I don't know if
> Number itself does. hopefully these casts can be removed someday.
>
> email me with questions and comments.
>
> ,Chad
> _______________________________________________
> Bug-commoncpp mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp