aboutsummaryrefslogtreecommitdiff
path: root/test/api_test
diff options
context:
space:
mode:
authorAnders Roxell <anders.roxell@linaro.org>2014-04-15 12:46:56 +0200
committerMaxim Uvarov <maxim.uvarov@linaro.org>2014-04-16 19:31:15 +0400
commit90ff428f30d770180b08dbd7b91b355ef1ecdaf9 (patch)
tree639fc9bc1ef9746a5a40a1d05be5d966a9ba0344 /test/api_test
parent9469f999d4f0784db7ab986eb120fdb79f01ba70 (diff)
test/api_test/odp_atomic: enable testcase 7
wasn't able to run testcase 7, said: "Invalid test case [7]" Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Diffstat (limited to 'test/api_test')
-rw-r--r--test/api_test/odp_atomic_test.c4
-rw-r--r--test/api_test/odp_atomic_test.h18
2 files changed, 13 insertions, 9 deletions
diff --git a/test/api_test/odp_atomic_test.c b/test/api_test/odp_atomic_test.c
index ea443a0..3f95d3d 100644
--- a/test/api_test/odp_atomic_test.c
+++ b/test/api_test/odp_atomic_test.c
@@ -17,6 +17,7 @@ static odp_atomic_u64_t a64u;
static odp_atomic_int_t numthrds;
static const char * const test_name[] = {
+ "dummy",
"test atomic basic ops add/sub/inc/dec",
"test atomic inc/dec of signed word",
"test atomic add/sub of signed word",
@@ -334,10 +335,11 @@ int main(int argc, char *argv[])
thrdarg.testcase = test_type;
thrdarg.numthrds = pthrdnum;
- if ((test_type > 0) && (test_type < 7)) {
+ if ((test_type > 0) && (test_type < TEST_MAX)) {
printf("%s\n", test_name[test_type]);
} else {
ODP_ERR("Invalid test case [%d]\n", test_type);
+ usage();
goto err_exit;
}
odp_test_thread_create(run_thread, &thrdarg);
diff --git a/test/api_test/odp_atomic_test.h b/test/api_test/odp_atomic_test.h
index 04dde72..d6eec04 100644
--- a/test/api_test/odp_atomic_test.h
+++ b/test/api_test/odp_atomic_test.h
@@ -22,14 +22,16 @@
#define U32_INIT_VAL (1UL << 10)
#define U64_INIT_VAL (1ULL << 33)
-#define TEST_MIX 1 /* Must be first test case num */
-#define TEST_INC_DEC_S32 2
-#define TEST_ADD_SUB_S32 3
-#define TEST_INC_DEC_U32 4
-#define TEST_ADD_SUB_U32 5
-#define TEST_INC_DEC_64 6
-#define TEST_ADD_SUB_64 7
-#define TEST_MAX 7 /* This must match the last test case num */
+typedef enum {
+ TEST_MIX = 1, /* Must be first test case num */
+ TEST_INC_DEC_S32,
+ TEST_ADD_SUB_S32,
+ TEST_INC_DEC_U32,
+ TEST_ADD_SUB_U32,
+ TEST_INC_DEC_64,
+ TEST_ADD_SUB_64,
+ TEST_MAX,
+} odp_test_atomic_t;
void test_atomic_inc_dec_32(void);