diff --git a/tests/testformatDiveGasString.cpp b/tests/testformatDiveGasString.cpp index 063022563..a9518ee1a 100644 --- a/tests/testformatDiveGasString.cpp +++ b/tests/testformatDiveGasString.cpp @@ -208,4 +208,31 @@ void TestformatDiveGasString::test_ccr() { QCOMPARE(formatDiveGasString(&dive), "21/35"); } +void TestformatDiveGasString::test_ccr_bailout() { + struct dive dive = {0}; + cylinder_t *cylinder = get_or_create_cylinder(&dive, 0); + + cylinder->gasmix.o2.permille = 1000; + cylinder->cylinder_use = OXYGEN; + cylinder->start.mbar = 230000; + cylinder->end.mbar = 100000; + + cylinder = get_or_create_cylinder(&dive, 1); + + cylinder->gasmix.o2.permille = 220; + cylinder->gasmix.he.permille = 200; + cylinder->cylinder_use = DILUENT; + cylinder->start.mbar = 230000; + cylinder->end.mbar = 100000; + + cylinder = get_or_create_cylinder(&dive, 2); + + cylinder->gasmix.o2.permille = 210; + cylinder->gasmix.he.permille = 0; + cylinder->start.mbar = 230000; + cylinder->end.mbar = 100000; + + QCOMPARE(formatDiveGasString(&dive), "22/20"); +} + QTEST_GUILESS_MAIN(TestformatDiveGasString) diff --git a/tests/testformatDiveGasString.h b/tests/testformatDiveGasString.h index ee04110a4..2a3c799bd 100644 --- a/tests/testformatDiveGasString.h +++ b/tests/testformatDiveGasString.h @@ -18,4 +18,5 @@ private slots: void test_trimix_and_nitrox_same_o2(); void test_trimix_and_nitrox_lower_o2(); void test_ccr(); + void test_ccr_bailout(); };