Mercurial > public > hwos_code
annotate src/Tests/deco_volume_test.cpp @ 294:f97e439d711c
FIX clear before displaying gas volumes.
author | jDG |
---|---|
date | Sat, 30 May 2015 22:58:00 +0200 |
parents | 6d6b3689b20b |
children | 7027d735ac62 |
rev | line source |
---|---|
285 | 1 ////////////////////////////////////////////////////////////////////////////// |
2 /// deco_volume_test.cpp | |
3 /// Unit test for gas consumption c code. | |
4 /// Copyright (c) 2015, JD Gascuel, HeinrichsWeikamp, all right reserved. | |
5 ////////////////////////////////////////////////////////////////////////////// | |
6 // HISTORY | |
288
08986d479b94
FIX gas_volume shall read gas switches from char_O_deco_gas
jdg@air
parents:
286
diff
changeset
|
7 // 2015-05-27 jDG: Creation for gas volum re-introduction in hwOS 1.82 |
285 | 8 |
9 extern "C" { | |
10 # include "p2_deco.c" | |
11 } | |
12 | |
13 #include <gtest/gtest.h> | |
293
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
14 #include <iostream> |
285 | 15 |
16 ////////////////////////////////////////////////////////////////////////////// | |
17 /// \brief Defines a default OC gas list | |
18 static void setup_gas() | |
19 { | |
20 char_I_first_gas = 1; | |
21 | |
22 #define DEFINE_GAS(gas, o2, he, depth, role) \ | |
23 char_I_deco_N2_ratio [gas-1] = 100 - o2 - he; \ | |
24 char_I_deco_He_ratio [gas-1] = he; \ | |
25 char_I_deco_gas_change[gas-1] = depth; | |
26 | |
27 DEFINE_GAS(1, 21, 0, 0, 1); // Gas#1 : Air FIRST | |
28 DEFINE_GAS(2, 18, 30, 0, 2); // Gas#2 : Tx18/30 TRAVEL | |
29 DEFINE_GAS(3, 80, 0, 9, 3); // Gas#3 : Nx80 @ 9m DECO | |
286 | 30 DEFINE_GAS(4, 21, 0, 0, 0); // Gas#2 : air @ 10m DISABLED |
31 DEFINE_GAS(5, 21, 0, 0, 0); // Gas#2 : air @ 40m DISABLED | |
285 | 32 } |
33 | |
34 ////////////////////////////////////////////////////////////////////////////// | |
35 /// \brief Define a default deco plan. | |
293
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
36 static void setup_plan(const char* stops, |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
37 const char* gas) |
285 | 38 { |
293
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
39 int depth = 3 * (stops ? strlen(stops) : 0); |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
40 |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
41 int s = 0; |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
42 while( depth > 0 && s < NUM_STOPS ) { |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
43 char_O_deco_time [s] = stops[s]; |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
44 char_O_deco_depth[s] = depth; |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
45 char_O_deco_gas [s] = gas ? gas[s] : 1; // Gas#1 by default |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
46 ++s; |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
47 depth -= 3; |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
48 } |
285 | 49 // Done |
293
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
50 for(; s<NUM_STOPS; ++s) { |
285 | 51 char_O_deco_time [s] = 0; |
52 char_O_deco_depth[s] = 0; | |
53 char_O_deco_gas [s] = 0; | |
54 } | |
55 } | |
56 | |
293
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
57 static void setup_dive(int bottom, int depth, |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
58 const char* stops = 0, const char* gas = 0) |
285 | 59 { |
60 setup_gas(); | |
293
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
61 setup_plan(stops, gas); |
285 | 62 |
286 | 63 char_I_bottom_depth = depth; |
64 char_I_bottom_time = bottom; | |
65 } | |
66 | |
67 ////////////////////////////////////////////////////////////////////////////// | |
68 /// \brief Gas consumption at a fixed depth | |
69 static float fixed(int rmv, int time, int depth) { | |
70 return rmv * time * (1 + 0.1f*depth); | |
71 } | |
72 | |
73 TEST(gas_volume, fixed) | |
74 { | |
75 EXPECT_EQ(20*30*1, fixed(20,30, 0)); // 30' @ 0m | |
76 EXPECT_EQ(20*30*5, fixed(20,30,40)); // 30' @ 40m | |
77 } | |
78 | |
79 ////////////////////////////////////////////////////////////////////////////// | |
80 /// \brief Gas consumption during an ascent at 10m/min. | |
81 static float ascent(int rmv, int oldDepth, int newDepth) | |
82 { | |
83 return rmv | |
84 * abs(oldDepth-newDepth)*0.1f // Ascent time | |
85 * (1 + 0.05f*(oldDepth + newDepth)); // Avg pressure. | |
86 } | |
87 | |
88 TEST(gas_volume, ascent) | |
89 { | |
90 EXPECT_EQ(0, ascent(20, 30, 30)); // 30m -> 30m : no time, no conso | |
91 EXPECT_EQ(20*4*(1+2), ascent(20, 40, 0)); // 40m -> 0m : 4min, avg 20m | |
92 EXPECT_EQ(20*4*(1+2), ascent(20, 0, 40)); // 0m -> 40m : 4min, avg 20m | |
285 | 93 } |
94 | |
293
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
95 static void check_volumes(float G1, const char* L1, |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
96 float G2, const char* L2, |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
97 float G3, const char* L3, |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
98 float G4, const char* L4, |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
99 float G5, const char* L5) |
286 | 100 { |
293
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
101 std::cout << " " << std::setw(6) << G1 << " = " << L1 << std::endl; |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
102 std::cout << " " << std::setw(6) << G2 << " = " << L2 << std::endl; |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
103 std::cout << " " << std::setw(6) << G3 << " = " << L3 << std::endl; |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
104 std::cout << " " << std::setw(6) << G4 << " = " << L4 << std::endl; |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
105 std::cout << " " << std::setw(6) << G5 << " = " << L5 << std::endl; |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
106 |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
107 EXPECT_NEAR(G1, int_O_gas_volumes[0], 1) << L1; |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
108 EXPECT_NEAR(G2, int_O_gas_volumes[1], 1) << L2; |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
109 EXPECT_NEAR(G3, int_O_gas_volumes[2], 1) << L3; |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
110 EXPECT_NEAR(G4, int_O_gas_volumes[3], 1) << L4; |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
111 EXPECT_NEAR(G5, int_O_gas_volumes[4], 1) << L5; |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
112 } |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
113 |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
114 ////////////////////////////////////////////////////////////////////////////// |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
115 // v1.82 ZH-L16+GF, OC, 30%/85% |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
116 TEST(gas_volume, OC_13min30m) |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
117 { |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
118 char_I_const_ppO2 = 0; // OC |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
119 setup_dive(13, 30); // 13' @ 30m --> no deco |
286 | 120 |
121 ASSERT_NO_THROW( deco_gas_volumes() ); | |
293
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
122 check_volumes(fixed(20,13,30) + ascent(20,30,0), "Gas1: 1190 L", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
123 0, "", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
124 0, "", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
125 0, "", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
126 0, ""); |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
127 } |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
128 |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
129 ////////////////////////////////////////////////////////////////////////////// |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
130 // v1.82 ZH-L16+GF, OC, 30%/85% |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
131 TEST(gas_volume, OC_15min30m) |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
132 { |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
133 char_I_const_ppO2 = 0; // OC |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
134 char stops[] = {1, 0}; |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
135 char gas[] = {3, 0}; |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
136 setup_dive(15, 30, stops, gas); // 15' @ 30m --> 1min at 3m |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
137 |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
138 ASSERT_NO_THROW( deco_gas_volumes() ); |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
139 check_volumes(fixed(20,15,30) + ascent(20,30,3), "Gas1: 1343 L", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
140 0, "", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
141 fixed(20, 1, 3) + ascent(20, 3,0), "Gas3: 33", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
142 0, "", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
143 0, ""); |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
144 } |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
145 |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
146 ////////////////////////////////////////////////////////////////////////////// |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
147 // v1.82 ZH-L16+GF, OC, 30%/85% |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
148 TEST(gas_volume, OC_29min30m) |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
149 { |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
150 char_I_const_ppO2 = 0; // OC |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
151 char stops[] = {1, 1, 2, 4, 0}; |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
152 char gas[] = {1, 3, 3, 3, 0}; |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
153 setup_dive(29, 30, stops, gas); // 29' @ 30m --> 1' 1' 2' 4' |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
154 |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
155 ASSERT_NO_THROW( deco_gas_volumes() ); |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
156 check_volumes(fixed(20,29,30) + ascent(20,30,12) + |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
157 fixed(20, 1,12) + ascent(20,12, 9), "Gas1: 2488 L", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
158 0, "", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
159 fixed(20, 1, 9) + ascent(20, 9, 6) + |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
160 fixed(20, 2, 6) + ascent(20, 6, 3) + |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
161 fixed(20, 4, 3) + ascent(20, 3, 0), "Gas3: 232 L", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
162 0, "", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
163 0, ""); |
286 | 164 } |
165 | |
166 ////////////////////////////////////////////////////////////////////////////// | |
293
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
167 // v1.82 ZH-L16+GF, OC, 30%/85% |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
168 TEST(gas_volume, OC_15min60m) |
285 | 169 { |
293
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
170 char_I_const_ppO2 = 0; // OC |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
171 char stops[] = {2, 1, 2, 4, 3, 4, 9, 0}; |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
172 char gas[] = {1, 1, 1, 1, 3, 3, 3, 0}; |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
173 setup_dive(15, 60, stops, gas); // 15' @ 60m --> DTR 32' |
285 | 174 |
286 | 175 ASSERT_NO_THROW( deco_gas_volumes() ); |
293
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
176 check_volumes(fixed(20,15,60) + ascent(20,60,21) + |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
177 fixed(20, 2,21) + ascent(20,21,18) + |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
178 fixed(20, 1,18) + ascent(20,18,15) + |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
179 fixed(20, 2,15) + ascent(20,15,12) + |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
180 fixed(20, 4,12) + ascent(20,12, 9), "Gas1: 3010 L", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
181 0, "", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
182 fixed(20, 3, 9) + ascent(20, 9, 6) + |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
183 fixed(20, 4, 6) + ascent(20, 6, 3) + |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
184 fixed(20, 9, 3) + ascent(20, 3, 0), "Gas3: 502 L", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
185 0, "", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
186 0, ""); |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
187 } |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
188 |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
189 ////////////////////////////////////////////////////////////////////////////// |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
190 // v1.82 ZH-L16+GF, CCR, 30%/85% |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
191 TEST(gas_volume, CCR_13min30m) |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
192 { |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
193 char_I_const_ppO2 = 140;// SP 1.4 bar |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
194 setup_dive(13, 30); // 13' @ 30m --> no deco |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
195 |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
196 ASSERT_NO_THROW( deco_gas_volumes() ); |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
197 check_volumes(/*NO BTM CONSO*/ ascent(20,30,0), "Gas1: 1190 L", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
198 0, "", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
199 0, "", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
200 0, "", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
201 0, ""); |
285 | 202 } |
290 | 203 |
204 ////////////////////////////////////////////////////////////////////////////// | |
293
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
205 // v1.82 ZH-L16+GF, CCR, 30%/85% |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
206 TEST(gas_volume, CCR_15min30m) |
290 | 207 { |
293
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
208 char_I_const_ppO2 = 140; // SP 1.4 bar |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
209 char stops[] = {1, 0}; |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
210 char gas[] = {3, 0}; |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
211 setup_dive(15, 30, stops, gas); // 15' @ 30m --> 1min at 3m |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
212 |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
213 ASSERT_NO_THROW( deco_gas_volumes() ); |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
214 check_volumes(/*NO BTM CONSO*/ ascent(20,30,3), "Gas1: 1343 L", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
215 0, "", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
216 fixed(20, 1, 3) + ascent(20, 3,0), "Gas3: 33", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
217 0, "", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
218 0, ""); |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
219 } |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
220 |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
221 ////////////////////////////////////////////////////////////////////////////// |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
222 // v1.82 ZH-L16+GF, CCR, 30%/85% |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
223 TEST(gas_volume, CCR_29min30m) |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
224 { |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
225 char_I_const_ppO2 = 140; // SP 1.4 bar |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
226 char stops[] = {1, 1, 2, 4, 0}; |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
227 char gas[] = {1, 3, 3, 3, 0}; |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
228 setup_dive(29, 30, stops, gas); // 29' @ 30m --> 1' 1' 2' 4' |
290 | 229 |
230 ASSERT_NO_THROW( deco_gas_volumes() ); | |
293
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
231 check_volumes(/*NO BTM CONSO*/ ascent(20,30,12) + |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
232 fixed(20, 1,12) + ascent(20,12, 9), "Gas1: 2488 L", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
233 0, "", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
234 fixed(20, 1, 9) + ascent(20, 9, 6) + |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
235 fixed(20, 2, 6) + ascent(20, 6, 3) + |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
236 fixed(20, 4, 3) + ascent(20, 3, 0), "Gas3: 232 L", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
237 0, "", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
238 0, ""); |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
239 } |
290 | 240 |
293
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
241 ////////////////////////////////////////////////////////////////////////////// |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
242 // v1.82 ZH-L16+GF, CCR, 30%/85% |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
243 TEST(gas_volume, CCR_15min60m) |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
244 { |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
245 char_I_const_ppO2 = 140; // SP 1.4 bar |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
246 char stops[] = {2, 1, 2, 4, 3, 4, 9, 0}; |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
247 char gas[] = {1, 1, 1, 1, 3, 3, 3, 0}; |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
248 setup_dive(15, 60, stops, gas); // 15' @ 60m --> DTR 32' |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
249 |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
250 ASSERT_NO_THROW( deco_gas_volumes() ); |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
251 check_volumes(/*NO BTM CONSO*/ ascent(20,60,21) + |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
252 fixed(20, 2,21) + ascent(20,21,18) + |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
253 fixed(20, 1,18) + ascent(20,18,15) + |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
254 fixed(20, 2,15) + ascent(20,15,12) + |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
255 fixed(20, 4,12) + ascent(20,12, 9), "Gas1: 3010 L", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
256 0, "", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
257 fixed(20, 3, 9) + ascent(20, 9, 6) + |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
258 fixed(20, 4, 6) + ascent(20, 6, 3) + |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
259 fixed(20, 9, 3) + ascent(20, 3, 0), "Gas3: 502 L", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
260 0, "", |
6d6b3689b20b
FIX tests to use plans copyed from actual OSTC3 1.82 computer.
jDG
parents:
290
diff
changeset
|
261 0, ""); |
290 | 262 } |