summaryrefslogtreecommitdiffstats
path: root/tests/testunitconversion.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-04-14 14:27:32 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-04-14 11:49:49 -0700
commit019edd065fd1eefd5f705c42bce23255bb5e20ac (patch)
tree7152ff352630d4eeab654f6c2e7307fb1e982cb3 /tests/testunitconversion.cpp
parent907d8b8fbbb0bc07ccc4c4b4d1374f764c5d8dae (diff)
downloadsubsurface-019edd065fd1eefd5f705c42bce23255bb5e20ac.tar.gz
First test case implemented.
This is just a stub test case to show how a test case should be implemented. every 'private slot' on the test classes will be automatically executed when you run 'make test' on the terminal, and a report will be generated with a failure / success. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'tests/testunitconversion.cpp')
-rw-r--r--tests/testunitconversion.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/testunitconversion.cpp b/tests/testunitconversion.cpp
new file mode 100644
index 000000000..54b7e1b7b
--- /dev/null
+++ b/tests/testunitconversion.cpp
@@ -0,0 +1,14 @@
+#include "testunitconversion.h"
+#include "dive.h"
+
+void TestUnitConversion::testUnitConversions()
+{
+ QCOMPARE(IS_FP_SAME(grams_to_lbs(1000), 2.20459), true);
+ QCOMPARE(lbs_to_grams(1), 454);
+ QCOMPARE(IS_FP_SAME(ml_to_cuft(1000), 0.0353147), true);
+ QCOMPARE(IS_FP_SAME(cuft_to_l(1), 28.3168), true);
+ QCOMPARE(IS_FP_SAME(mm_to_feet(1000), 3.28084), true);
+ QCOMPARE(feet_to_mm(1), (long unsigned int) 305);
+}
+
+QTEST_MAIN(TestUnitConversion) \ No newline at end of file