diff options
author | Michael Bien <[email protected]> | 2010-04-22 04:07:14 +0200 |
---|---|---|
committer | Michael Bien <[email protected]> | 2010-04-22 04:07:14 +0200 |
commit | 2fc985f0cdc373cb3c78cc198e21dcc1ce5d961f (patch) | |
tree | 2b749169a2fc28c77f54260ca56a4f937d9f082d /test | |
parent | 5a6d1f0cd4da6582cca526e45964effa6c2b1419 (diff) |
CLContext should not throw NPE in create(...) if a device or device type is null.
Diffstat (limited to 'test')
-rw-r--r-- | test/com/jogamp/opencl/HighLevelBindingTest.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/com/jogamp/opencl/HighLevelBindingTest.java b/test/com/jogamp/opencl/HighLevelBindingTest.java index 33cce0b5..35c13261 100644 --- a/test/com/jogamp/opencl/HighLevelBindingTest.java +++ b/test/com/jogamp/opencl/HighLevelBindingTest.java @@ -200,6 +200,33 @@ public class HighLevelBindingTest { assertEquals(deviceCount, c.getDevices().length); c.release(); + + //Exceptions + try{ + CLContext.create((CLDevice)null); + fail("create with null device"); + }catch(IllegalArgumentException ex) { + // expected + } + try{ + CLContext.create((CLDevice.Type)null); + fail("create with null CLDevice.Type"); + }catch(IllegalArgumentException ex) { + // expected + } + try{ + CLContext.create((CLPlatform)null, (CLDevice)null); + fail("create with null device"); + }catch(IllegalArgumentException ex) { + // expected + } + try{ + CLContext.create((CLPlatform)null, (CLDevice.Type)null); + fail("create with null CLDevice.Type"); + }catch(IllegalArgumentException ex) { + // expected + } + } @Test |