diff options
author | Sven Gothel <[email protected]> | 2013-05-31 06:52:32 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-05-31 06:52:32 +0200 |
commit | ef8949d4bdfb21bbe423acc661affaf59369f859 (patch) | |
tree | 45e9135c340be9fa01965850d7abb2227e1feed7 /src/test/com | |
parent | 81afec4e963ac4372dc2b604d6f91237b81ee6f2 (diff) |
Complete/Fix GLVersionNumber (81afec4e963ac4372dc2b604d6f91237b81ee6f2): Set 'valid' flag, always set major/minor and strEnd.
Also: Add negative tests to unit test.
Diffstat (limited to 'src/test/com')
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLVersionParsing00NEWT.java | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLVersionParsing00NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLVersionParsing00NEWT.java index 394772135..f2f6e4aff 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLVersionParsing00NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLVersionParsing00NEWT.java @@ -134,13 +134,38 @@ public class TestGLVersionParsing00NEWT extends UITestCase { public void test01GLVersion() throws InterruptedException { for(int i=0; i<glVersionNumbers.length; i++) { final VersionNumberString exp = glVersionNumbers[i]; - final VersionNumberString has = GLVersionNumber.create(exp.getVersionString()); - System.err.println("Test["+i+"]: "+exp+" -> "+has+", define ["+has.hasMajor()+":"+has.hasMinor()+":"+has.hasSub()+"]"); + final GLVersionNumber has = GLVersionNumber.create(exp.getVersionString()); + System.err.println("Test["+i+"]: "+exp+" -> "+has+", valid "+has.isValid()+", define ["+has.hasMajor()+":"+has.hasMinor()+":"+has.hasSub()+"]"); Assert.assertTrue(has.hasMajor()); Assert.assertTrue(has.hasMinor()); Assert.assertTrue(!has.hasSub()); + Assert.assertTrue(has.isValid()); Assert.assertEquals(exp, has); } + { + final GLVersionNumber has = GLVersionNumber.create("GL_VERSION_2"); + System.err.println("Test-X1: "+has+", valid "+has.isValid()+", define ["+has.hasMajor()+":"+has.hasMinor()+":"+has.hasSub()+"]"); + Assert.assertTrue(has.hasMajor()); + Assert.assertTrue(!has.hasMinor()); + Assert.assertTrue(!has.hasSub()); + Assert.assertTrue(!has.isValid()); + } + { + final GLVersionNumber has = GLVersionNumber.create("GL2 Buggy L3"); + System.err.println("Test-X2: "+has+", valid "+has.isValid()+", define ["+has.hasMajor()+":"+has.hasMinor()+":"+has.hasSub()+"]"); + Assert.assertTrue(has.hasMajor()); + Assert.assertTrue(!has.hasMinor()); + Assert.assertTrue(!has.hasSub()); + Assert.assertTrue(!has.isValid()); + } + { + final GLVersionNumber has = GLVersionNumber.create("GL Nope"); + System.err.println("Test-X3: "+has+", valid "+has.isValid()+", define ["+has.hasMajor()+":"+has.hasMinor()+":"+has.hasSub()+"]"); + Assert.assertTrue(!has.hasMajor()); + Assert.assertTrue(!has.hasMinor()); + Assert.assertTrue(!has.hasSub()); + Assert.assertTrue(!has.isValid()); + } } private void testGLVendorVersionImpl(VersionNumberString[] versionNumberString, boolean withMajor, boolean withMinor, boolean withSub) throws InterruptedException { |