activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r819045 - /activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/lang/SystemTest.cpp
Date Fri, 25 Sep 2009 22:11:56 GMT
Author: tabish
Date: Fri Sep 25 22:11:56 2009
New Revision: 819045

URL: http://svn.apache.org/viewvc?rev=819045&view=rev
Log:
Add more tests to the System unit tests.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/lang/SystemTest.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/lang/SystemTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/lang/SystemTest.cpp?rev=819045&r1=819044&r2=819045&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/lang/SystemTest.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/lang/SystemTest.cpp Fri Sep 25
22:11:56 2009
@@ -19,6 +19,7 @@
 
 #include <decaf/lang/System.h>
 #include <decaf/util/StlMap.h>
+#include <decaf/lang/Thread.h>
 
 using namespace std;
 using namespace decaf;
@@ -78,9 +79,21 @@
 ////////////////////////////////////////////////////////////////////////////////
 void SystemTest::test_currentTimeMillis() {
     CPPUNIT_ASSERT( System::currentTimeMillis() != 0 );
+
+    long long start = System::currentTimeMillis();
+    Thread::sleep( 150 );
+    long long end = System::currentTimeMillis();
+
+    CPPUNIT_ASSERT_MESSAGE( "First Read isn't less than the second.", start < end );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void SystemTest::test_nanoTime() {
     CPPUNIT_ASSERT( System::nanoTime() != 0 );
+
+    long long start = System::nanoTime();
+    Thread::sleep( 150 );
+    long long end = System::nanoTime();
+
+    CPPUNIT_ASSERT_MESSAGE( "First Read isn't less than the second.", start < end );
 }



Mime
View raw message