refs #197 fixing (hopefully) comparison between null quantities

and related rationalization of PQ comparison.
This commit is contained in:
Mathew Sutcliffe
2014-04-08 16:55:11 +01:00
committed by Klaus Basan
parent 8ba2badb61
commit a4e3ac6f40
5 changed files with 33 additions and 11 deletions

View File

@@ -44,6 +44,14 @@ namespace BlackMiscTest
CLength l2(0, CLengthUnit::nullUnit());
QVERIFY2(l1 == l2, "Null lengths should be equal");
CLength l3(0, CLengthUnit::m());
CLength l4(-1, CLengthUnit::m());
QVERIFY2(l1 != l3, "Null length and non-null length should not be equal");
QVERIFY2(l1 != l4, "Null length and non-null length should not be equal");
QVERIFY2(!(l1 < l4), "Null length and non-null length should not be comparable");
QVERIFY2(!(l1 > l4), "Null length and non-null length should not be comparable");
QVERIFY2(compare(l1, l4) < 0, "Null length and non-null length should be sortable");
QVariant station1qv = QVariant::fromValue(station1);
QVERIFY2(station1 == station1, "Station should be equal");