From d0630b290148ed1df5dccd2216370a749aa965c5 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Mon, 22 May 2017 09:33:01 -0700 Subject: [PATCH] Ensure to include config file in unit tests for strnlen, strlcat, and strlcpy (#1795) This commit fixes a compiler error when building/running unit test on a platform/system which has support for these functions. --- tests/unit/test_strlcat.c | 6 ++++++ tests/unit/test_strlcpy.c | 6 ++++++ tests/unit/test_strnlen.c | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/tests/unit/test_strlcat.c b/tests/unit/test_strlcat.c index a6cb9ac20..8fd17bd9f 100644 --- a/tests/unit/test_strlcat.c +++ b/tests/unit/test_strlcat.c @@ -25,6 +25,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifdef OPENTHREAD_CONFIG_FILE +#include OPENTHREAD_CONFIG_FILE +#else +#include +#endif + #include #include #include "utils/wrap_string.h" diff --git a/tests/unit/test_strlcpy.c b/tests/unit/test_strlcpy.c index 8a7e7c3a7..6a5195260 100644 --- a/tests/unit/test_strlcpy.c +++ b/tests/unit/test_strlcpy.c @@ -25,6 +25,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifdef OPENTHREAD_CONFIG_FILE +#include OPENTHREAD_CONFIG_FILE +#else +#include +#endif + #include #include #include "utils/wrap_string.h" diff --git a/tests/unit/test_strnlen.c b/tests/unit/test_strnlen.c index df2490d98..cd6dde00b 100644 --- a/tests/unit/test_strnlen.c +++ b/tests/unit/test_strnlen.c @@ -25,6 +25,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifdef OPENTHREAD_CONFIG_FILE +#include OPENTHREAD_CONFIG_FILE +#else +#include +#endif + #include #include #include "utils/wrap_string.h"