summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDenis Steckelmacher <steckdenis@yahoo.fr>2011-08-08 12:29:21 +0200
committerDenis Steckelmacher <steckdenis@yahoo.fr>2011-08-08 12:29:21 +0200
commitaab62ad45dcefa8222410fdef7b3ece529cfefff (patch)
tree6e1c07492c77d7797ed3f79f4f7e860b696aa492 /tests
parentf7d2dab69657e1a204bf814ccbdb3ea8ca4af933 (diff)
Fix any warning found by gcc -Wall and clang -Wall
Diffstat (limited to 'tests')
-rw-r--r--tests/test_commandqueue.cpp4
-rw-r--r--tests/test_kernel.cpp9
-rw-r--r--tests/test_program.cpp1
3 files changed, 7 insertions, 7 deletions
diff --git a/tests/test_commandqueue.cpp b/tests/test_commandqueue.cpp
index c8d9834..1fac3eb 100644
--- a/tests/test_commandqueue.cpp
+++ b/tests/test_commandqueue.cpp
@@ -334,7 +334,9 @@ START_TEST (test_events)
"unable to get timing information about a profiling-enabled event"
);
fail_if(
- !(timing_queued <= timing_submit <= timing_start <= timing_end),
+ !(timing_queued <= timing_submit &&
+ timing_submit <= timing_start &&
+ timing_start <= timing_end),
"something went wrong with the timings : they are unordered"
);
diff --git a/tests/test_kernel.cpp b/tests/test_kernel.cpp
index 98a2898..134b88f 100644
--- a/tests/test_kernel.cpp
+++ b/tests/test_kernel.cpp
@@ -14,7 +14,7 @@ static const char source[] =
" a[i] = simple_function(f) * b[i];\n"
"}\n"
"\n"
- "__kernel void kernel2(__global int *buf) {\n"
+ "__kernel void kernel2(__global unsigned int *buf) {\n"
" size_t i = get_global_id(0);\n"
"\n"
" buf[i % 256] = 2 * (i % 256);\n"
@@ -29,10 +29,9 @@ static void native_kernel(void *args)
};
struct ags *data = (struct ags *)args;
- int i;
// Not
- for (int i=0; i<data->buffer_size; ++i)
+ for (size_t i=0; i<data->buffer_size; ++i)
{
data->buffer[i] = ~data->buffer[i];
}
@@ -53,7 +52,7 @@ START_TEST (test_compiled_kernel)
const char *src = source;
size_t program_len = sizeof(source);
- int buffer[256];
+ unsigned int buffer[256];
result = clGetDeviceIDs(platform, CL_DEVICE_TYPE_DEFAULT, 1, &device, 0);
fail_if(
@@ -143,7 +142,7 @@ START_TEST (test_compiled_kernel)
);
ok = true;
- for (int i=0; i<local_size; ++i)
+ for (size_t i=0; i<local_size; ++i)
{
if (buffer[i] != 2 * i)
{
diff --git a/tests/test_program.cpp b/tests/test_program.cpp
index 15dcde8..0635af2 100644
--- a/tests/test_program.cpp
+++ b/tests/test_program.cpp
@@ -152,7 +152,6 @@ START_TEST (test_program_build_info)
cl_int result;
const char *src = program_source;
- size_t program_len = sizeof(program_source);
result = clGetDeviceIDs(platform, CL_DEVICE_TYPE_DEFAULT, 1, &device, 0);
fail_if(