test_multipleInterfaces
- test_multipleInterfaces.createOneSim()[source]
Create a minimal Basilisk simulation containing a single SpiceInterface.
- Returns:
TotalSim (Basilisk SimulationBaseClass instance) – The newly created simulation object.
SpiceObject (SpiceInterface) – The SpiceInterface instance inside the created simulation.
- test_multipleInterfaces.test_multipleInterfaces()[source]
Verify that SPICE kernels loaded through SpiceInterface are correctly reference-counted and unloaded when all SpiceInterface instances are gone.
The test performs the following high-level checks:
Before creating any SpiceInterface objects, the target kernel must not be loaded in SPICE.
Creating the first simulation should cause the kernel to be furnished.
Creating many additional simulations must not load the kernel again.
After all simulations have loaded, the number of loaded kernels should be the same as after loading one sim.
After all simulations fall out of scope and Python’s garbage collector runs, the kernel must be fully unloaded from SPICE.
- This guarantees that:
furnsh_c() is only called once per unique kernel file
unload_c() is only called when the last user disappears
the shared-pointer-based lifetime system works correctly