Changeset View
Changeset View
Standalone View
Standalone View
source/gui/tests/test_ParseString.h
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | void test_clientarea() | ||||
TS_ASSERT(!ca.SetClientArea("300 wide, 400 high")); | TS_ASSERT(!ca.SetClientArea("300 wide, 400 high")); | ||||
} | } | ||||
void test_rect() | void test_rect() | ||||
{ | { | ||||
TestLogger nolog; | TestLogger nolog; | ||||
CRect test; | CRect test; | ||||
TS_ASSERT(__ParseString(CStrW(L"0.0 10.0 20.0 30.0"), test)); | TS_ASSERT(__ParseString(nullptr, CStrW(L"0.0 10.0 20.0 30.0"), test)); | ||||
TS_ASSERT_EQUALS(CRect(0.0, 10.0, 20.0, 30.0), test); | TS_ASSERT_EQUALS(CRect(0.0, 10.0, 20.0, 30.0), test); | ||||
TS_ASSERT(!__ParseString(CStrW(L"0 10 20"), test)); | TS_ASSERT(!__ParseString(nullptr, CStrW(L"0 10 20"), test)); | ||||
TS_ASSERT(!__ParseString(CStrW(L"0 10 20 30 40"), test)); | TS_ASSERT(!__ParseString(nullptr, CStrW(L"0 10 20 30 40"), test)); | ||||
TS_ASSERT(!__ParseString(CStrW(L"0,0 10,0 20,0 30,0"), test)); | TS_ASSERT(!__ParseString(nullptr, CStrW(L"0,0 10,0 20,0 30,0"), test)); | ||||
} | } | ||||
void test_size() | void test_size() | ||||
{ | { | ||||
TestLogger nolog; | TestLogger nolog; | ||||
CSize test; | CSize test; | ||||
TS_ASSERT(__ParseString(CStrW(L"0.0 10.0"), test)); | TS_ASSERT(__ParseString(nullptr, CStrW(L"0.0 10.0"), test)); | ||||
TS_ASSERT_EQUALS(CSize(0.0, 10.0), test); | TS_ASSERT_EQUALS(CSize(0.0, 10.0), test); | ||||
TS_ASSERT(!__ParseString(CStrW(L"0"), test)); | TS_ASSERT(!__ParseString(nullptr, CStrW(L"0"), test)); | ||||
TS_ASSERT(!__ParseString(CStrW(L"0 10 20"), test)); | TS_ASSERT(!__ParseString(nullptr, CStrW(L"0 10 20"), test)); | ||||
TS_ASSERT(!__ParseString(CStrW(L"0,0 10,0"), test)); | TS_ASSERT(!__ParseString(nullptr, CStrW(L"0,0 10,0"), test)); | ||||
} | } | ||||
void test_pos() | void test_pos() | ||||
{ | { | ||||
TestLogger nolog; | TestLogger nolog; | ||||
CPos test; | CPos test; | ||||
TS_ASSERT(__ParseString(CStrW(L"0.0 10.0"), test)); | TS_ASSERT(__ParseString(nullptr, CStrW(L"0.0 10.0"), test)); | ||||
TS_ASSERT_EQUALS(CPos(0.0, 10.0), test); | TS_ASSERT_EQUALS(CPos(0.0, 10.0), test); | ||||
TS_ASSERT(!__ParseString(CStrW(L"0"), test)); | TS_ASSERT(!__ParseString(nullptr, CStrW(L"0"), test)); | ||||
TS_ASSERT(!__ParseString(CStrW(L"0 10 20"), test)); | TS_ASSERT(!__ParseString(nullptr, CStrW(L"0 10 20"), test)); | ||||
TS_ASSERT(!__ParseString(CStrW(L"0,0 10,0"), test)); | TS_ASSERT(!__ParseString(nullptr, CStrW(L"0,0 10,0"), test)); | ||||
} | } | ||||
}; | }; |
Wildfire Games · Phabricator