diff options
| author | Oskari Timperi <oskari.timperi@iki.fi> | 2013-12-10 18:55:58 +0200 |
|---|---|---|
| committer | Oskari Timperi <oskari.timperi@iki.fi> | 2013-12-10 18:55:58 +0200 |
| commit | 9373817b38ae92f5aa185059ddd235a57cc39670 (patch) | |
| tree | bc28647eea56600a888891c3b8b7b5eaffec0f1e /tests/tst_AngleModel.qml | |
| parent | 4f61719b3368df3ff9eaea27b83517e9cf4612e4 (diff) | |
| download | unitmaster-9373817b38ae92f5aa185059ddd235a57cc39670.tar.gz unitmaster-9373817b38ae92f5aa185059ddd235a57cc39670.zip | |
more tests for Angle and Length models
Diffstat (limited to 'tests/tst_AngleModel.qml')
| -rw-r--r-- | tests/tst_AngleModel.qml | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/tst_AngleModel.qml b/tests/tst_AngleModel.qml index 9074906..b947d8c 100644 --- a/tests/tst_AngleModel.qml +++ b/tests/tst_AngleModel.qml @@ -37,4 +37,20 @@ TestCase { var result = model.from(data.from, data.value); compare(result, data.res); } + + function test_combined_data() { + return [ + { from: 'degree', fromval: 5, to: 'gon', toval: (5*Math.PI/180)*200/Math.PI }, + { from: 'gon', fromval: 8, to: 'arcminute', toval: (8*Math.PI/200.0)*10800/Math.PI }, + { from: 'gon', fromval: 8, to: 'arcsecond', toval: (8*Math.PI/200.0)*648000/Math.PI }, + { from: 'arcsecond', fromval: 8, to: 'arcminute', toval: 8.0/60.0 }, + { from: 'arcminute', fromval: 1.0, to: 'arcsecond', toval: 60.0 }, + ]; + } + + function test_combined(data) { + var result = model.from(data.from, data.fromval); + result = model.to(data.to, result); + compare(result, data.toval); + } } |
