X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1d805c14685af118189a1f393532573cc5f0d085..17db93e969753e3f666e9b1eb100533a25ce5511:/tests/longlong/longlongtest.cpp diff --git a/tests/longlong/longlongtest.cpp b/tests/longlong/longlongtest.cpp index e09edae668..a9142a6fb5 100644 --- a/tests/longlong/longlongtest.cpp +++ b/tests/longlong/longlongtest.cpp @@ -68,6 +68,7 @@ private: CPPUNIT_TEST( Division ); CPPUNIT_TEST( BitOperations ); CPPUNIT_TEST( ToString ); + CPPUNIT_TEST( LoHi ); CPPUNIT_TEST_SUITE_END(); void Conversion(); @@ -77,6 +78,7 @@ private: void Division(); void BitOperations(); void ToString(); + void LoHi(); DECLARE_NO_COPY_CLASS(LongLongTestCase) }; @@ -235,7 +237,7 @@ void LongLongTestCase::Division() void LongLongTestCase::BitOperations() { - for ( size_t n = 0; n < ITEMS; n++ ) + for ( size_t m = 0; m < ITEMS; m++ ) { wxLongLong a = RAND_LL(); @@ -324,4 +326,15 @@ void LongLongTestCase::ToString() } +void LongLongTestCase::LoHi() +{ + wxLongLong ll(123, 456); + CPPUNIT_ASSERT_EQUAL( 456u, ll.GetLo() ); + CPPUNIT_ASSERT_EQUAL( 123, ll.GetHi() ); + + wxULongLong ull(987, 654); + CPPUNIT_ASSERT_EQUAL( 654u, ull.GetLo() ); + CPPUNIT_ASSERT_EQUAL( 987u, ull.GetHi() ); +} + #endif // wxUSE_LONGLONG