Sha256: e621a2aa0fbe03a92e14333bb3c9ae80a3f1ec11c0f75eb1a383b84b027e20cc

Contents?: true

Size: 722 Bytes

Versions: 93

Compression:

Stored size: 722 Bytes

Contents

#include "TestSupport.h"
#include "Utils/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

93 entries across 93 versions & 4 rubygems

Version Path
passenger-4.0.60 test/cxx/SystemTimeTest.cpp
passenger-5.0.4 test/cxx/SystemTimeTest.cpp
passenger-5.0.3 test/cxx/SystemTimeTest.cpp
passenger-5.0.2 test/cxx/SystemTimeTest.cpp
passenger-5.0.1 test/cxx/SystemTimeTest.cpp
passenger-5.0.0.rc2 test/cxx/SystemTimeTest.cpp
passenger-5.0.0.rc1 test/cxx/SystemTimeTest.cpp
passenger-4.0.59 test/cxx/SystemTimeTest.cpp
passenger-5.0.0.beta3 test/cxx/SystemTimeTest.cpp
passenger-4.0.58 test/cxx/SystemTimeTest.cpp
passenger-4.0.57 test/cxx/SystemTimeTest.cpp
passenger-5.0.0.beta2 test/cxx/SystemTimeTest.cpp
passenger-4.0.56 test/cxx/SystemTimeTest.cpp
passenger-4.0.55 test/cxx/SystemTimeTest.cpp
passenger-5.0.0.beta1 test/cxx/SystemTimeTest.cpp
passenger-4.0.53 test/cxx/SystemTimeTest.cpp
passenger-4.0.52 test/cxx/SystemTimeTest.cpp
passenger-4.0.51 test/cxx/SystemTimeTest.cpp
passenger-4.0.50 test/cxx/SystemTimeTest.cpp
passenger-4.0.49 test/cxx/SystemTimeTest.cpp