29package com.jogamp.opencl;
31import java.io.IOException;
32import java.lang.reflect.InvocationTargetException;
34import org.junit.FixMethodOrder;
36import org.junit.runners.MethodSorters;
38import com.jogamp.opencl.test.util.UITestCase;
40import static org.junit.Assert.*;
45@FixMethodOrder(MethodSorters.NAME_ASCENDING)
49 public void testCLExceptions() throws InstantiationException, IllegalAccessException, NoSuchMethodException, IllegalArgumentException, InvocationTargetException {
50 final Class<?>[] subTypes =
CLException.class.getDeclaredClasses();
52 for (
final Class<?> type : subTypes) {
54 if(type.getName().startsWith(
CLException.class.getName()+
"$CL")) {
62 fail(
"expected exception for: "+exception.getClass().getName()+
" code: "+exception.
errorcode);
64 assertTrue(
"wrong instance; expected "+exception.getClass()+
" but got "+ex.getClass(),
65 exception.getClass().equals(ex.getClass()));
71 public static void main(
final String[] args)
throws IOException {
73 org.junit.runner.JUnitCore.
main(tstname);
static void main(final String[] args)
Main Exception type for runtime OpenCL errors and failed function calls (e.g.
static String resolveErrorCode(final int error)
Returns a human readable String for the OpenCL error code or null if not known.
static void checkForError(final int status, final String message)
Throws a CLException when status != CL_SUCCESS.