From 688f6cc591f3fb4129a8d863c5b38a2d105d22aa Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Mon, 11 May 2020 23:06:12 +0200 Subject: [PATCH] There are test programs, not just unit tests Signed-off-by: Gilles Peskine --- docs/architecture/testing/invasive-testing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/architecture/testing/invasive-testing.md b/docs/architecture/testing/invasive-testing.md index a1488a31b..93e4e6e52 100644 --- a/docs/architecture/testing/invasive-testing.md +++ b/docs/architecture/testing/invasive-testing.md @@ -68,7 +68,7 @@ Sometimes the substitutable function is a `static inline` function that does not With `MBEDTLS_TEST_HOOKS` set, `mbedtls_foo` is a global variable of function pointer type. This global variable is initialized to the system function, or to a function that does nothing. The global variable is defined in a header in the `library` directory such as `psa_crypto_invasive.h`. -In test code that needs to modify the internal behavior: +In unit test code that needs to modify the internal behavior: * The test function (or the whole test file) must depend on `MBEDTLS_TEST_HOOKS`. * At the beginning of the function, set the global function pointers to the desired value. @@ -283,7 +283,7 @@ Goal: test the absence of memory leaks. Solution ([instrumentation](#runtime-instrumentation)): run tests with ASan. (We also use Valgrind, but it's slower than ASan, so we favor ASan.) -Since we run many test jobs with a memory leak detector, each test function must clean up after itself. Use the cleanup code (after the `exit` label) to free any memory that the function may have allocated. +Since we run many test jobs with a memory leak detector, each test function or test program must clean up after itself. Use the cleanup code (after the `exit` label in test functions) to free any memory that the function may have allocated. #### Robustness against memory allocation failure