diff options
author | Sven Gothel <[email protected]> | 2011-10-22 12:01:01 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-10-22 12:01:01 +0200 |
commit | d6ecf1d8dd105f2d84e86e94159dc55700d2e0e6 (patch) | |
tree | 433966de01a5a01da91237c05c372f54f6353fc5 /src/test/com | |
parent | 929093c88a8741ee4819291c4494f350695a394c (diff) |
NEWT/ScreenMode: If unimplemented have at least current mode in list. Current mode uses ScreenSize w/ dummy values if unimplemented.
Diffstat (limited to 'src/test/com')
5 files changed, 35 insertions, 45 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestScreenMode00NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestScreenMode00NEWT.java index cfb8c7715..985affa92 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/TestScreenMode00NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/TestScreenMode00NEWT.java @@ -103,26 +103,21 @@ public class TestScreenMode00NEWT extends UITestCase { Screen screen = window.getScreen(); List<ScreenMode> screenModes = screen.getScreenModes(); - if(null != screenModes) { - Assert.assertTrue(screenModes.size()>0); - int i=0; - for(Iterator<ScreenMode> iter=screenModes.iterator(); iter.hasNext(); i++) { - System.err.println(i+": "+iter.next()); - } - ScreenMode sm_o = screen.getOriginalScreenMode(); - Assert.assertNotNull(sm_o); - ScreenMode sm_c = screen.getCurrentScreenMode(); - Assert.assertNotNull(sm_c); - System.err.println("orig SM: "+sm_o); - System.err.println("curr SM: "+sm_c); - System.err.println("curr sz: "+screen.getWidth()+"x"+screen.getHeight()); - Assert.assertEquals(sm_o, sm_c); - Assert.assertEquals(sm_c.getRotatedWidth(), screen.getWidth()); - Assert.assertEquals(sm_c.getRotatedHeight(), screen.getHeight()); - } else { - // no support .. - System.err.println("Your platform has no ScreenMode change support, sorry"); + Assert.assertTrue(screenModes.size()>0); + int i=0; + for(Iterator<ScreenMode> iter=screenModes.iterator(); iter.hasNext(); i++) { + System.err.println(i+": "+iter.next()); } + ScreenMode sm_o = screen.getOriginalScreenMode(); + Assert.assertNotNull(sm_o); + ScreenMode sm_c = screen.getCurrentScreenMode(); + Assert.assertNotNull(sm_c); + System.err.println("orig SM: "+sm_o); + System.err.println("curr SM: "+sm_c); + System.err.println("curr sz: "+screen.getWidth()+"x"+screen.getHeight()); + Assert.assertEquals(sm_o, sm_c); + Assert.assertEquals(sm_c.getRotatedWidth(), screen.getWidth()); + Assert.assertEquals(sm_c.getRotatedHeight(), screen.getHeight()); window.destroy(); diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestScreenMode00bNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestScreenMode00bNEWT.java index 15b3740a2..41bdfdfd7 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/TestScreenMode00bNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/TestScreenMode00bNEWT.java @@ -82,30 +82,25 @@ public class TestScreenMode00bNEWT extends UITestCase { Assert.assertEquals(true,display.isNativeValid()); List<ScreenMode> screenModes = screen.getScreenModes(); - if(null != screenModes) { - Assert.assertTrue(screenModes.size()>0); - int i=0; - for(Iterator<ScreenMode> iter=screenModes.iterator(); iter.hasNext(); i++) { - System.err.println(i+": "+iter.next()); - } - ScreenMode sm_o = screen.getOriginalScreenMode(); - - Assert.assertNotNull(sm_o); - ScreenMode sm_c = screen.getCurrentScreenMode(); + Assert.assertTrue(screenModes.size()>0); + int i=0; + for(Iterator<ScreenMode> iter=screenModes.iterator(); iter.hasNext(); i++) { + System.err.println(i+": "+iter.next()); + } + ScreenMode sm_o = screen.getOriginalScreenMode(); + + Assert.assertNotNull(sm_o); + ScreenMode sm_c = screen.getCurrentScreenMode(); + Assert.assertNotNull(sm_c); + System.err.println("orig: "+sm_o); + System.err.println("curr: "+sm_c); + + for(i=0; i<100; i++) { + sm_c = screen.getCurrentScreenMode(); Assert.assertNotNull(sm_c); - System.err.println("orig: "+sm_o); - System.err.println("curr: "+sm_c); - - for(i=0; i<100; i++) { - sm_c = screen.getCurrentScreenMode(); - Assert.assertNotNull(sm_c); - System.err.print("."); - } - System.err.println("!"); - } else { - // no support .. - System.err.println("Your platform has no ScreenMode change support, sorry"); + System.err.print("."); } + System.err.println("!"); // screen.removeReference(); anim.stop(); diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestScreenMode01NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestScreenMode01NEWT.java index c53c9a1de..5f14fc466 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/TestScreenMode01NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/TestScreenMode01NEWT.java @@ -184,7 +184,7 @@ public class TestScreenMode01NEWT extends UITestCase { Assert.assertNotNull(window); List<ScreenMode> screenModes = screen.getScreenModes(); - if(null==screenModes) { + if(screenModes.size()==1) { // no support .. System.err.println("Your platform has no ScreenMode change support, sorry"); destroyWindow(window); @@ -293,7 +293,7 @@ public class TestScreenMode01NEWT extends UITestCase { Assert.assertEquals(smCurrent.getRotatedHeight(), screen.getHeight()); List<ScreenMode> screenModes = screen.getScreenModes(); - if(null==screenModes) { + if(screenModes.size()==1) { // no support .. destroyWindow(window); return; diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestScreenMode01bNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestScreenMode01bNEWT.java index 6c505d58a..4d7769669 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/TestScreenMode01bNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/TestScreenMode01bNEWT.java @@ -110,7 +110,7 @@ public class TestScreenMode01bNEWT extends UITestCase { Assert.assertNotNull(window0); List<ScreenMode> screenModes = screen.getScreenModes(); - if(null==screenModes) { + if(screenModes.size()==1) { // no support .. System.err.println("Your platform has no ScreenMode change support, sorry"); destroyWindow(window0); diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestScreenMode02NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestScreenMode02NEWT.java index c5c11682c..8c7f75e2b 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/TestScreenMode02NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/TestScreenMode02NEWT.java @@ -104,7 +104,7 @@ public class TestScreenMode02NEWT extends UITestCase { Assert.assertNotNull(window); List<ScreenMode> screenModes = screen.getScreenModes(); - if(null==screenModes) { + if(screenModes.size()==1) { // no support .. System.err.println("Your platform has no ScreenMode change support, sorry"); destroyWindow(window); |