diff --git a/dse/testing.h b/dse/testing.h index 1b205f0..48e12e6 100644 --- a/dse/testing.h +++ b/dse/testing.h @@ -5,8 +5,8 @@ #ifndef DSE_TESTING_H_ #define DSE_TESTING_H_ -#ifdef UNIT_TESTING +#if defined(UNIT_TESTING) || defined(CMOCKA_TESTING) #include #include @@ -18,6 +18,8 @@ #include +#if defined(UNIT_TESTING) // Enables memory checks in CMocka includes. + /* Wrapping strdup() to get memory checking does not work with libyaml (and * perhaps other libs too). Therefore, rather than wrapping we can use the * preprocessor to swap strdup with this implementation in DSE code only. @@ -32,7 +34,8 @@ static inline char *dse_strdup_swap(const char *s) } #define strdup dse_strdup_swap - #endif // UNIT_TESTING +#endif // UNIT_TESTING || CMOCKA_TESTING + #endif // DSE_TESTING_H_