Moved helper macro to a discrete include file.
To help reduce code duplication and also 'kitchen-sink' includes
the ARRAY_LENGTH macro was moved to a stand-alone file and
referenced from the sources consuming it. Other macros will be
added in subsequent passes.
Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
diff --git a/tests/ivi_layout-test.c b/tests/ivi_layout-test.c
index 90dee29..d6401c4 100644
--- a/tests/ivi_layout-test.c
+++ b/tests/ivi_layout-test.c
@@ -28,6 +28,7 @@
#include <stdio.h>
#include <string.h>
+#include "shared/helpers.h"
#include "weston-test-client-helper.h"
#include "ivi-application-client-protocol.h"
#include "ivi-test.h"
diff --git a/tests/presentation-test.c b/tests/presentation-test.c
index f3152f5..27f33da 100644
--- a/tests/presentation-test.c
+++ b/tests/presentation-test.c
@@ -31,6 +31,7 @@
#include <assert.h>
#include <time.h>
+#include "shared/helpers.h"
#include "weston-test-client-helper.h"
#include "presentation_timing-client-protocol.h"
diff --git a/tests/vertex-clip-test.c b/tests/vertex-clip-test.c
index 2a5ec10..8a4e5a6 100644
--- a/tests/vertex-clip-test.c
+++ b/tests/vertex-clip-test.c
@@ -30,6 +30,7 @@
#include "weston-test-runner.h"
+#include "shared/helpers.h"
#include "src/vertex-clipping.h"
#define BOUNDING_BOX_TOP_Y 100.0f
diff --git a/tests/weston-test-runner.h b/tests/weston-test-runner.h
index 0ed131c..a443691 100644
--- a/tests/weston-test-runner.h
+++ b/tests/weston-test-runner.h
@@ -31,6 +31,8 @@
#include <stdlib.h>
+#include "shared/helpers.h"
+
#ifdef NDEBUG
#error "Tests must not be built with NDEBUG defined, they rely on assert()."
#endif
@@ -44,8 +46,6 @@
int must_fail;
} __attribute__ ((aligned (32)));
-#define ARRAY_LENGTH(a) ((int) (sizeof (a) / sizeof (a)[0]))
-
#define TEST_BEGIN(name, arg) \
static void name(arg)