# HG changeset patch # User jdg@air # Date 1432860612 -7200 # Node ID b1e47ee1f0a15acb5b0474fc473f53762a8633e5 # Parent 30edd177016a0e9def5e57999ebef03d6b38dcd0 NEW gas_volume unit test in CCR mode. Works too. diff -r 30edd177016a -r b1e47ee1f0a1 src/Tests/deco_volume_test.cpp --- a/src/Tests/deco_volume_test.cpp Fri May 29 02:46:44 2015 +0200 +++ b/src/Tests/deco_volume_test.cpp Fri May 29 02:50:12 2015 +0200 @@ -98,7 +98,7 @@ ////////////////////////////////////////////////////////////////////////////// -TEST(gas_volume, 30min40m_no_stops) +TEST(gas_volume, OC_30min40m_no_stops) { setup_dive(30, 40); // 30' @ 40m for(int s=0; s<32; ++s) @@ -115,7 +115,7 @@ ////////////////////////////////////////////////////////////////////////////// -TEST(gas_volume, 30min40m_1min_1min_3min_12min) +TEST(gas_volume, OC_30min40m_1min_1min_3min_12min) { setup_dive(30, 40); // 30' @ 40m @@ -131,3 +131,25 @@ EXPECT_EQ(0, int_O_gas_volumes[3]); EXPECT_EQ(0, int_O_gas_volumes[4]); } + +////////////////////////////////////////////////////////////////////////////// + +TEST(gas_volume, CCR_30min40m_1min_1min_3min_12min) +{ + setup_dive(30, 40); // 30' @ 40m + char_I_const_ppO2 = 140; + + ASSERT_NO_THROW( deco_gas_volumes() ); + + // BAILOUT at 40m: no bottom conso + EXPECT_NEAR(ascent(20,40,12) + + fixed(20, 1,12) + ascent(20,12,9), + int_O_gas_volumes[0], 1); + EXPECT_EQ(0, int_O_gas_volumes[1]); + EXPECT_NEAR(fixed(20, 1,9) + ascent(20,9,6) + + fixed(20, 3,6) + ascent(20,6,3) + + fixed(20,12,3) + ascent(20,3,0), + int_O_gas_volumes[2], 1); + EXPECT_EQ(0, int_O_gas_volumes[3]); + EXPECT_EQ(0, int_O_gas_volumes[4]); +}