Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tag: release-2.2.8
Fetching contributors…

Cannot retrieve contributors at this time

38 lines (28 sloc) 0.708 kB
#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);
}
}
Jump to Line
Something went wrong with that request. Please try again.