summaryrefslogtreecommitdiff
path: root/utests/compiler_saturate.cpp
diff options
context:
space:
mode:
authorZhigang Gong <zhigang.gong@linux.intel.com>2013-01-22 16:46:45 +0800
committerZhigang Gong <zhigang.gong@linux.intel.com>2013-04-10 14:52:32 +0800
commitd1d32f1c0627449a2aedd38c0c640df4307222fb (patch)
tree310c29bb1ac5a1c6c066873728f04c99dea75a72 /utests/compiler_saturate.cpp
parentea2a25567d1095207f71052101440fcfa5211274 (diff)
Split the multiple test cases to individual cases.
As the original test framework will do some resource releasing job at the end of each test runing. If we call multiple tests in one instance, then we will miss the chance to call those releasing functions thus may cause some leaking. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> Reviewed-by: Homer Hsing <homer.xing@intel.com>
Diffstat (limited to 'utests/compiler_saturate.cpp')
-rw-r--r--utests/compiler_saturate.cpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/utests/compiler_saturate.cpp b/utests/compiler_saturate.cpp
index db07f4fe..6880df01 100644
--- a/utests/compiler_saturate.cpp
+++ b/utests/compiler_saturate.cpp
@@ -97,16 +97,18 @@ void test(const char *kernel_name)
}
-static void compiler_saturate(void)
-{
- test<int8_t>("test_char");
- test<uint8_t>("test_uchar");
- test<int16_t>("test_short");
- test<uint16_t>("test_ushort");
- test<int32_t>("test_int");
- test<uint32_t>("test_uint");
-// test<int64_t>("test_long");
-// test<uint64_t>("test_ulong");
-}
-
-MAKE_UTEST_FROM_FUNCTION(compiler_saturate);
+#define compiler_saturate(type, kernel) \
+static void compiler_saturate_ ##type(void)\
+{\
+ test<type>(# kernel);\
+}\
+MAKE_UTEST_FROM_FUNCTION(compiler_saturate_ ## type);
+
+compiler_saturate(int8_t, test_char)
+compiler_saturate(uint8_t, test_uchar)
+compiler_saturate(int16_t, test_short)
+compiler_saturate(uint16_t, test_ushort)
+compiler_saturate(int32_t, test_int)
+compiler_saturate(uint32_t, test_uint)
+//compiler_saturate(int64_t, test_long)
+//compiler_saturate(uint64_t, test_ulong)