When the constructor is overloaded, previous overloads can require a preallocated value. This test makes sure that such preallocated values only happen when they might be necessary, and that they are deallocated properly.
(capture, msg)
| 358 | |
| 359 | @pytest.mark.skipif("env.GRAALPY", reason="Cannot reliably trigger GC") |
| 360 | def test_reallocation_a(capture, msg): |
| 361 | """When the constructor is overloaded, previous overloads can require a preallocated value. |
| 362 | This test makes sure that such preallocated values only happen when they might be necessary, |
| 363 | and that they are deallocated properly.""" |
| 364 | |
| 365 | pytest.gc_collect() |
| 366 | |
| 367 | with capture: |
| 368 | create_and_destroy(1) |
| 369 | assert ( |
| 370 | msg(capture) |
| 371 | == """ |
| 372 | noisy new |
| 373 | noisy placement new |
| 374 | NoisyAlloc(int 1) |
| 375 | --- |
| 376 | ~NoisyAlloc() |
| 377 | noisy delete |
| 378 | """ |
| 379 | ) |
| 380 | |
| 381 | |
| 382 | @pytest.mark.skipif("env.GRAALPY", reason="Cannot reliably trigger GC") |
nothing calls this directly
no test coverage detected