mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: move get_or_create_cylinder() to struct dive
Other cylinder-creation functions were already there. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
777e7f32a5
commit
9bb2255ba8
12 changed files with 83 additions and 83 deletions
|
@ -17,7 +17,7 @@ void TestformatDiveGasString::test_empty()
|
|||
void TestformatDiveGasString::test_air()
|
||||
{
|
||||
struct dive dive;
|
||||
cylinder_t *cylinder = get_or_create_cylinder(&dive, 0);
|
||||
cylinder_t *cylinder = dive.get_or_create_cylinder(0);
|
||||
|
||||
cylinder->start.mbar = 230000;
|
||||
cylinder->end.mbar = 100000;
|
||||
|
@ -28,7 +28,7 @@ void TestformatDiveGasString::test_air()
|
|||
void TestformatDiveGasString::test_nitrox()
|
||||
{
|
||||
struct dive dive;
|
||||
cylinder_t *cylinder = get_or_create_cylinder(&dive, 0);
|
||||
cylinder_t *cylinder = dive.get_or_create_cylinder(0);
|
||||
|
||||
cylinder->gasmix.o2.permille = 320;
|
||||
cylinder->start.mbar = 230000;
|
||||
|
@ -40,13 +40,13 @@ void TestformatDiveGasString::test_nitrox()
|
|||
void TestformatDiveGasString::test_nitrox_not_use()
|
||||
{
|
||||
struct dive dive;
|
||||
cylinder_t *cylinder = get_or_create_cylinder(&dive, 0);
|
||||
cylinder_t *cylinder = dive.get_or_create_cylinder(0);
|
||||
|
||||
cylinder->gasmix.o2.permille = 320;
|
||||
cylinder->start.mbar = 230000;
|
||||
cylinder->end.mbar = 100000;
|
||||
|
||||
cylinder = get_or_create_cylinder(&dive, 1);
|
||||
cylinder = dive.get_or_create_cylinder(1);
|
||||
|
||||
cylinder->gasmix.o2.permille = 1000;
|
||||
cylinder->cylinder_use = NOT_USED;
|
||||
|
@ -59,13 +59,13 @@ void TestformatDiveGasString::test_nitrox_not_use()
|
|||
void TestformatDiveGasString::test_nitrox_deco()
|
||||
{
|
||||
struct dive dive;
|
||||
cylinder_t *cylinder = get_or_create_cylinder(&dive, 0);
|
||||
cylinder_t *cylinder = dive.get_or_create_cylinder(0);
|
||||
|
||||
cylinder->gasmix.o2.permille = 320;
|
||||
cylinder->start.mbar = 230000;
|
||||
cylinder->end.mbar = 100000;
|
||||
|
||||
cylinder = get_or_create_cylinder(&dive, 1);
|
||||
cylinder = dive.get_or_create_cylinder(1);
|
||||
|
||||
cylinder->gasmix.o2.permille = 1000;
|
||||
cylinder->start.mbar = 230000;
|
||||
|
@ -77,13 +77,13 @@ void TestformatDiveGasString::test_nitrox_deco()
|
|||
void TestformatDiveGasString::test_reverse_nitrox_deco()
|
||||
{
|
||||
struct dive dive;
|
||||
cylinder_t *cylinder = get_or_create_cylinder(&dive, 0);
|
||||
cylinder_t *cylinder = dive.get_or_create_cylinder(0);
|
||||
|
||||
cylinder->gasmix.o2.permille = 1000;
|
||||
cylinder->start.mbar = 230000;
|
||||
cylinder->end.mbar = 100000;
|
||||
|
||||
cylinder = get_or_create_cylinder(&dive, 1);
|
||||
cylinder = dive.get_or_create_cylinder(1);
|
||||
|
||||
cylinder->gasmix.o2.permille = 270;
|
||||
cylinder->start.mbar = 230000;
|
||||
|
@ -95,7 +95,7 @@ void TestformatDiveGasString::test_reverse_nitrox_deco()
|
|||
void TestformatDiveGasString::test_trimix()
|
||||
{
|
||||
struct dive dive;
|
||||
cylinder_t *cylinder = get_or_create_cylinder(&dive, 0);
|
||||
cylinder_t *cylinder = dive.get_or_create_cylinder(0);
|
||||
|
||||
cylinder->gasmix.o2.permille = 210;
|
||||
cylinder->gasmix.he.permille = 350;
|
||||
|
@ -108,21 +108,21 @@ void TestformatDiveGasString::test_trimix()
|
|||
void TestformatDiveGasString::test_trimix_deco()
|
||||
{
|
||||
struct dive dive;
|
||||
cylinder_t *cylinder = get_or_create_cylinder(&dive, 0);
|
||||
cylinder_t *cylinder = dive.get_or_create_cylinder(0);
|
||||
|
||||
cylinder->gasmix.o2.permille = 210;
|
||||
cylinder->gasmix.he.permille = 350;
|
||||
cylinder->start.mbar = 230000;
|
||||
cylinder->end.mbar = 100000;
|
||||
|
||||
cylinder = get_or_create_cylinder(&dive, 1);
|
||||
cylinder = dive.get_or_create_cylinder(1);
|
||||
|
||||
cylinder->gasmix.o2.permille = 500;
|
||||
cylinder->gasmix.he.permille = 200;
|
||||
cylinder->start.mbar = 230000;
|
||||
cylinder->end.mbar = 100000;
|
||||
|
||||
cylinder = get_or_create_cylinder(&dive, 2);
|
||||
cylinder = dive.get_or_create_cylinder(2);
|
||||
|
||||
cylinder->gasmix.o2.permille = 1000;
|
||||
cylinder->start.mbar = 230000;
|
||||
|
@ -134,20 +134,20 @@ void TestformatDiveGasString::test_trimix_deco()
|
|||
void TestformatDiveGasString::test_reverse_trimix_deco()
|
||||
{
|
||||
struct dive dive;
|
||||
cylinder_t *cylinder = get_or_create_cylinder(&dive, 0);
|
||||
cylinder_t *cylinder = dive.get_or_create_cylinder(0);
|
||||
|
||||
cylinder->gasmix.o2.permille = 1000;
|
||||
cylinder->start.mbar = 230000;
|
||||
cylinder->end.mbar = 100000;
|
||||
|
||||
cylinder = get_or_create_cylinder(&dive, 1);
|
||||
cylinder = dive.get_or_create_cylinder(1);
|
||||
|
||||
cylinder->gasmix.o2.permille = 500;
|
||||
cylinder->gasmix.he.permille = 200;
|
||||
cylinder->start.mbar = 230000;
|
||||
cylinder->end.mbar = 100000;
|
||||
|
||||
cylinder = get_or_create_cylinder(&dive, 2);
|
||||
cylinder = dive.get_or_create_cylinder(2);
|
||||
|
||||
cylinder->gasmix.o2.permille = 210;
|
||||
cylinder->gasmix.he.permille = 350;
|
||||
|
@ -160,14 +160,14 @@ void TestformatDiveGasString::test_reverse_trimix_deco()
|
|||
void TestformatDiveGasString::test_trimix_and_nitrox_same_o2()
|
||||
{
|
||||
struct dive dive;
|
||||
cylinder_t *cylinder = get_or_create_cylinder(&dive, 0);
|
||||
cylinder_t *cylinder = dive.get_or_create_cylinder(0);
|
||||
|
||||
cylinder->gasmix.o2.permille = 250;
|
||||
cylinder->gasmix.he.permille = 0;
|
||||
cylinder->start.mbar = 230000;
|
||||
cylinder->end.mbar = 100000;
|
||||
|
||||
cylinder = get_or_create_cylinder(&dive, 1);
|
||||
cylinder = dive.get_or_create_cylinder(1);
|
||||
|
||||
cylinder->gasmix.o2.permille = 250;
|
||||
cylinder->gasmix.he.permille = 250;
|
||||
|
@ -180,14 +180,14 @@ void TestformatDiveGasString::test_trimix_and_nitrox_same_o2()
|
|||
void TestformatDiveGasString::test_trimix_and_nitrox_lower_o2()
|
||||
{
|
||||
struct dive dive;
|
||||
cylinder_t *cylinder = get_or_create_cylinder(&dive, 0);
|
||||
cylinder_t *cylinder = dive.get_or_create_cylinder(0);
|
||||
|
||||
cylinder->gasmix.o2.permille = 220;
|
||||
cylinder->gasmix.he.permille = 0;
|
||||
cylinder->start.mbar = 230000;
|
||||
cylinder->end.mbar = 100000;
|
||||
|
||||
cylinder = get_or_create_cylinder(&dive, 1);
|
||||
cylinder = dive.get_or_create_cylinder(1);
|
||||
|
||||
cylinder->gasmix.o2.permille = 250;
|
||||
cylinder->gasmix.he.permille = 250;
|
||||
|
@ -200,14 +200,14 @@ void TestformatDiveGasString::test_trimix_and_nitrox_lower_o2()
|
|||
void TestformatDiveGasString::test_ccr()
|
||||
{
|
||||
struct dive dive;
|
||||
cylinder_t *cylinder = get_or_create_cylinder(&dive, 0);
|
||||
cylinder_t *cylinder = dive.get_or_create_cylinder(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 = dive.get_or_create_cylinder(1);
|
||||
|
||||
cylinder->gasmix.o2.permille = 210;
|
||||
cylinder->gasmix.he.permille = 350;
|
||||
|
@ -221,14 +221,14 @@ void TestformatDiveGasString::test_ccr()
|
|||
void TestformatDiveGasString::test_ccr_bailout()
|
||||
{
|
||||
struct dive dive;
|
||||
cylinder_t *cylinder = get_or_create_cylinder(&dive, 0);
|
||||
cylinder_t *cylinder = dive.get_or_create_cylinder(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 = dive.get_or_create_cylinder(1);
|
||||
|
||||
cylinder->gasmix.o2.permille = 220;
|
||||
cylinder->gasmix.he.permille = 200;
|
||||
|
@ -236,7 +236,7 @@ void TestformatDiveGasString::test_ccr_bailout()
|
|||
cylinder->start.mbar = 230000;
|
||||
cylinder->end.mbar = 100000;
|
||||
|
||||
cylinder = get_or_create_cylinder(&dive, 2);
|
||||
cylinder = dive.get_or_create_cylinder(2);
|
||||
|
||||
cylinder->gasmix.o2.permille = 210;
|
||||
cylinder->gasmix.he.permille = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue