refs #212,improved tests and samples

This commit is contained in:
Klaus Basan
2014-04-30 02:34:55 +02:00
parent 036de1b0e6
commit 96200953ea
3 changed files with 54 additions and 69 deletions

View File

@@ -197,6 +197,18 @@ namespace BlackMiscTest
delete a;
}
/*
* Parsing tests
*/
void CTestPhysicalQuantities::parserTests()
{
QVERIFY2(CLength(33.0, CLengthUnit::ft()) == CLength("33.0 ft"), "Length");
QVERIFY2(CLength(33.0, CLengthUnit::ft()) != CLength("33.1 ft"), "Length !=");
QVERIFY2(CLength(-22.8, CLengthUnit::ft()) != CLength("-22.8 cm"), "Length !=");
QVERIFY2(CSpeed(123.45, CSpeedUnit::km_h()) == CSpeed("123.45km/h"), "Speed");
QVERIFY2(CMass(33.45, CMassUnit::kg()) == CMass("33.45000 kg"), "CMass");
}
/*
* Some very basic arithmetic tests on the PQs
*/