summaryrefslogtreecommitdiff
path: root/utests/utest_helper.hpp
diff options
context:
space:
mode:
authorBenjamin Segovia <segovia.benjamin@gmail.com>2012-05-03 17:25:24 +0000
committerKeith Packard <keithp@keithp.com>2012-08-10 16:17:00 -0700
commit89381fa7285c462521671c2e10712b9d5a7a8dcb (patch)
tree419b47bd6195aadbe7e06c9c4cca832657784588 /utests/utest_helper.hpp
parent7237f7fc9d49888b1b7b3412f38ec7b28977036b (diff)
downloadbeignet-89381fa7285c462521671c2e10712b9d5a7a8dcb.tar.gz
Added flat_address_space tests
Diffstat (limited to 'utests/utest_helper.hpp')
-rw-r--r--utests/utest_helper.hpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/utests/utest_helper.hpp b/utests/utest_helper.hpp
index bf0c3ab2..c17a1e71 100644
--- a/utests/utest_helper.hpp
+++ b/utests/utest_helper.hpp
@@ -30,9 +30,9 @@
#include "utest.hpp"
#include "utest_assert.hpp"
#include "utest_error.h"
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
+#include <cassert>
+#include <cstdio>
+#include <cstdlib>
#define OCL_THROW_ERROR(FN, STATUS) \
do { \
@@ -68,8 +68,10 @@
#define OCL_UNMAP_BUFFER(ID) \
do { \
- OCL_CALL (clIntelUnmapBuffer, buf[ID]); \
- buf_data[ID] = NULL; \
+ if (buf[ID] != NULL) { \
+ OCL_CALL (clIntelUnmapBuffer, buf[ID]); \
+ buf_data[ID] = NULL; \
+ } \
} while (0)
#define OCL_NDRANGE(DIM_N) \