diff options
-rw-r--r-- | ACE/ChangeLog | 8 | ||||
-rw-r--r-- | ACE/tests/Time_Value_Test.cpp | 22 |
2 files changed, 19 insertions, 11 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog index 52cab02edf0..b785640ffea 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,11 @@ +Thu Mar 8 23:44:14 Pacific Standard Time 2007 <ossama_othman@symantec.com> + + * tests/Time_Value_Test.cpp (run_main): + + Simplified assertions. Rather than test equality of sec() and + usec() components separately, just test equality of the + ACE_Time_Value objects as a whole. + Fri Mar 9 00:53:43 UTC 2007 Steve Huston <shuston@riverace.com> Changes to resolve or quiet warnings from Visual Studio .NET 2005: diff --git a/ACE/tests/Time_Value_Test.cpp b/ACE/tests/Time_Value_Test.cpp index 91c62c35f19..20145f81145 100644 --- a/ACE/tests/Time_Value_Test.cpp +++ b/ACE/tests/Time_Value_Test.cpp @@ -227,21 +227,21 @@ run_main (int, ACE_TCHAR *[]) tv1.set (1, 1); tv2.set (2, 2); tv1 *= 2.0; - ACE_ASSERT (tv1.sec () == tv2.sec () && tv1.usec () == tv2.usec ()); + ACE_ASSERT (tv1 == tv2); tv1.set (1, 1); tv2.set (-2, -2); tv1 *= -2.0; - ACE_ASSERT (tv1.sec () == tv2.sec () && tv1.usec () == tv2.usec ()); + ACE_ASSERT (tv1 == tv2); // test usec shift tv1.set (1, 999999); tv2.set (19, 999990); tv1 *= 10.0; - ACE_ASSERT ( tv1.sec () == tv2.sec () && tv1.usec () == tv2.usec ()); + ACE_ASSERT ( tv1 == tv2); tv1.set (1, 999999); tv2.set (-19, -999990); tv1 *= -10.0; - ACE_ASSERT (tv1.sec () == tv2.sec () && tv1.usec () == tv2.usec ()); + ACE_ASSERT (tv1 == tv2); const time_t max_time_t = ACE_Numeric_Limits<time_t>::max (); const time_t min_time_t = ACE_Numeric_Limits<time_t>::min (); @@ -250,21 +250,21 @@ run_main (int, ACE_TCHAR *[]) tv1.set ((max_time_t >> 1), 499999); tv2.set ((-(max_time_t >> 1) << 1), -999998); tv1 *= -2.0; - ACE_ASSERT (tv1.sec () == tv2.sec () && tv1.usec () == tv2.usec ()); + ACE_ASSERT (tv1 == tv2); tv1.set (max_time_t >> 1, 499999); tv2.set (((max_time_t >> 1) << 1), 999998); tv1 *= 2.0; - ACE_ASSERT (tv1.sec () == tv2.sec () && tv1.usec () == tv2.usec ()); + ACE_ASSERT (tv1 == tv2); // test saturated result tv1.set (max_time_t - 1, 499999); - tv2.set (max_time_t, 999999); - tv1 *= max_time_t; - ACE_ASSERT (tv1.sec () == tv2.sec () && tv1.usec () == tv2.usec ()); + tv2.set (max_time_t, 999999); // ACE_Time_Value::max_time + tv1 *= 10.0; + ACE_ASSERT (tv1 == tv2); tv1.set (max_time_t - 1, 499999); tv2.set (min_time_t, -999999); - tv1 *= min_time_t; - ACE_ASSERT (tv1.sec () == tv2.sec () && tv1.usec () == tv2.usec ()); + tv1 *= -10.0; + ACE_ASSERT (tv1 == tv2); #if defined (sun) && !defined (ACE_LACKS_LONGLONG_T) if (test_ace_u_longlong () != 0) |