My death test modifies some state, but the change seems lost after the death test finishes. Why?
Death tests (EXPECT_DEATH, etc) are executed in a sub-process s.t. the expected crash won’t kill the test program (i.e. the parent process). As a result, any in-memory side effects they incur are observable in their respective sub-processes, but not in the parent process. You can think of them as running in a parallel universe, more or less.
Related Questions
- Why do some test results showing synthetic oils superiority state "as tested by an independent lab"? Why don’t you state which lab did the testing?
- Why should English language learners who want to do well be put through the emotional stress of taking a state or district test?
- My death test modifies some state, but the change seems lost after the death test finishes. Why?