Sha256: 72e3a13374f338e04253af11525aef69b85e9620022dc11327669beabc3084b1

Contents?: true

Size: 708 Bytes

Versions: 23

Compression:

Stored size: 708 Bytes

Contents

#include "tut.h"
#include "SystemTime.h"

using namespace Passenger;
using namespace std;

namespace tut {
	struct SystemTimeTest {
		~SystemTimeTest() {
			SystemTime::release();
		}
	};
	
	DEFINE_TEST_GROUP(SystemTimeTest);
	
	TEST_METHOD(1) {
		time_t begin = SystemTime::get();
		
		SystemTime::force(1);
		ensure_equals(SystemTime::get(), (time_t) 1);
		SystemTime::release();
		
		time_t now = SystemTime::get();
		ensure(now >= begin && now <= begin + 2);
	}
	
	TEST_METHOD(2) {
		time_t begin = SystemTime::get();
		
		SystemTime::force(1);
		ensure_equals(SystemTime::get(), (time_t) 1);
		SystemTime::release();
		
		time_t now = SystemTime::get();
		ensure(now >= begin && now <= begin + 2);
	}
}

Version data entries

23 entries across 23 versions & 4 rubygems

Version Path
vanity-1.7.1 vendor/ruby/1.9.1/gems/passenger-2.2.15/test/SystemTimeTest.cpp
passenger-2.2.15 test/SystemTimeTest.cpp
passenger-2.2.14 test/SystemTimeTest.cpp
passenger-2.2.13 test/SystemTimeTest.cpp
passenger-2.2.12 test/SystemTimeTest.cpp
colouringcode-passenger-0.2 test/SystemTimeTest.cpp
passenger-2.2.11 test/SystemTimeTest.cpp
passenger-jmazzi-2.2.10 test/SystemTimeTest.cpp
passenger-2.2.10 test/SystemTimeTest.cpp
passenger-jmazzi-2.2.9 test/SystemTimeTest.cpp
passenger-2.2.9 test/SystemTimeTest.cpp
passenger-2.2.8 test/SystemTimeTest.cpp
colouringcode-passenger-0.1 test/SystemTimeTest.cpp
passenger-2.2.7 test/SystemTimeTest.cpp
passenger-2.2.6 test/SystemTimeTest.cpp
passenger-2.2.5 test/SystemTimeTest.cpp
passenger-2.2.3 test/SystemTimeTest.cpp
passenger-2.2.4 test/SystemTimeTest.cpp
passenger-2.1.2 test/SystemTimeTest.cpp
passenger-2.2.1 test/SystemTimeTest.cpp