comparison src/Tests/deco_volume_test.cpp @ 290:b1e47ee1f0a1

NEW gas_volume unit test in CCR mode. Works too.
author jdg@air
date Fri, 29 May 2015 02:50:12 +0200
parents 08986d479b94
children 6d6b3689b20b
comparison
equal deleted inserted replaced
289:30edd177016a 290:b1e47ee1f0a1
96 EXPECT_EQ(20*4*(1+2), ascent(20, 0, 40)); // 0m -> 40m : 4min, avg 20m 96 EXPECT_EQ(20*4*(1+2), ascent(20, 0, 40)); // 0m -> 40m : 4min, avg 20m
97 } 97 }
98 98
99 ////////////////////////////////////////////////////////////////////////////// 99 //////////////////////////////////////////////////////////////////////////////
100 100
101 TEST(gas_volume, 30min40m_no_stops) 101 TEST(gas_volume, OC_30min40m_no_stops)
102 { 102 {
103 setup_dive(30, 40); // 30' @ 40m 103 setup_dive(30, 40); // 30' @ 40m
104 for(int s=0; s<32; ++s) 104 for(int s=0; s<32; ++s)
105 char_O_deco_time[s] = 0; 105 char_O_deco_time[s] = 0;
106 106
113 EXPECT_EQ(0, int_O_gas_volumes[4]); 113 EXPECT_EQ(0, int_O_gas_volumes[4]);
114 } 114 }
115 115
116 ////////////////////////////////////////////////////////////////////////////// 116 //////////////////////////////////////////////////////////////////////////////
117 117
118 TEST(gas_volume, 30min40m_1min_1min_3min_12min) 118 TEST(gas_volume, OC_30min40m_1min_1min_3min_12min)
119 { 119 {
120 setup_dive(30, 40); // 30' @ 40m 120 setup_dive(30, 40); // 30' @ 40m
121 121
122 ASSERT_NO_THROW( deco_gas_volumes() ); 122 ASSERT_NO_THROW( deco_gas_volumes() );
123 EXPECT_NEAR(fixed(20,30,40) + ascent(20,40,12) 123 EXPECT_NEAR(fixed(20,30,40) + ascent(20,40,12)
129 + fixed(20,12,3) + ascent(20,3,0), 129 + fixed(20,12,3) + ascent(20,3,0),
130 int_O_gas_volumes[2], 1); 130 int_O_gas_volumes[2], 1);
131 EXPECT_EQ(0, int_O_gas_volumes[3]); 131 EXPECT_EQ(0, int_O_gas_volumes[3]);
132 EXPECT_EQ(0, int_O_gas_volumes[4]); 132 EXPECT_EQ(0, int_O_gas_volumes[4]);
133 } 133 }
134
135 //////////////////////////////////////////////////////////////////////////////
136
137 TEST(gas_volume, CCR_30min40m_1min_1min_3min_12min)
138 {
139 setup_dive(30, 40); // 30' @ 40m
140 char_I_const_ppO2 = 140;
141
142 ASSERT_NO_THROW( deco_gas_volumes() );
143
144 // BAILOUT at 40m: no bottom conso
145 EXPECT_NEAR(ascent(20,40,12)
146 + fixed(20, 1,12) + ascent(20,12,9),
147 int_O_gas_volumes[0], 1);
148 EXPECT_EQ(0, int_O_gas_volumes[1]);
149 EXPECT_NEAR(fixed(20, 1,9) + ascent(20,9,6)
150 + fixed(20, 3,6) + ascent(20,6,3)
151 + fixed(20,12,3) + ascent(20,3,0),
152 int_O_gas_volumes[2], 1);
153 EXPECT_EQ(0, int_O_gas_volumes[3]);
154 EXPECT_EQ(0, int_O_gas_volumes[4]);
155 }