test_mass_depletion

test_mass_depletion.test_deprecatedPublicVariables()[source]

Module Unit Test

test_mass_depletion.test_leakyTank()[source]

Module Unit Test

test_mass_depletion.test_leakyTankInputMessageOverridesSetter()[source]

Module Unit Test

test_mass_depletion.test_leakyTankRunsOutOfFuel(tankModelConstructor)[source]

Module Unit Test

test_mass_depletion.test_massDepletionTest(show_plots, thrusterConstructor)[source]

Module Unit Test

test_mass_depletion.test_tankModelOutlivesPythonReference(tankModelConstructor)[source]

Regression test for issue #282.

The tank model is created in Python and handed to the FuelTank via setTankModel(). Because the model is now held by a std::shared_ptr, dropping the only Python reference must NOT free the underlying C++ object: the tank co-owns it. Before the shared_ptr conversion the C++ member was a raw pointer, so this sequence left a dangling pointer (undefined behaviour). Here we drop the Python reference (del + gc.collect()) before the simulation runs and assert the model still drives correct, finite depletion results.