use of com.b3dgs.lionengine.Config in project lionengine by b3dgs.
the class LoopUnlockedTest method testUnready.
/**
* Test with not ready screen.
*
* @throws InterruptedException If error.
*/
@Test(timeout = 1000L)
public void testUnready() throws InterruptedException {
ScreenMock.setScreenWait(true);
final Screen screen = new ScreenMock(new Config(new Resolution(320, 240, 50), 16, true));
screen.getConfig().setSource(new Resolution(320, 240, 50));
final Thread thread = getTask(screen);
thread.start();
latch.await();
loop.stop();
thread.join();
Assert.assertEquals(0, rendered.get());
Assert.assertEquals(0, tick.get());
Assert.assertEquals(-1, computed.get());
}
use of com.b3dgs.lionengine.Config in project lionengine by b3dgs.
the class ScreenAwtTest method testEngineWindowed.
/**
* Test with engine
*/
@Test
void testEngineWindowed() {
Medias.setLoadFromJar(ScreenAwtTest.class);
final Config config = new Config(UtilTests.RESOLUTION_320_240, 32, true, Medias.create("image.png"));
EngineAwt.start(ScreenAwtTest.class.getSimpleName(), Version.DEFAULT, ScreenAwtTest.class);
testScreen(config);
}
use of com.b3dgs.lionengine.Config in project lionengine by b3dgs.
the class ScreenAwtTest method testFullscreenFail.
/**
* Test full screen fail.
*
* @throws ReflectiveOperationException If error.
*/
@Test
void testFullscreenFail() throws ReflectiveOperationException {
final Resolution resolution = new Resolution(Integer.MAX_VALUE, Integer.MAX_VALUE, 0);
final Config config = new Config(resolution, 32, false);
assertThrowsPrefix(() -> testScreen(config), ScreenFullAwt.ERROR_UNSUPPORTED_FULLSCREEN);
}
use of com.b3dgs.lionengine.Config in project lionengine by b3dgs.
the class ScreenAwtTest method testFullscreen.
/**
* Test full screen.
*/
@Test
void testFullscreen() {
Medias.setLoadFromJar(ScreenAwtTest.class);
final DisplayMode res = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayModes()[0];
final Config config = new Config(new Resolution(res.getWidth(), res.getHeight(), res.getRefreshRate()), res.getBitDepth(), false, Medias.create("image.png"));
try {
testScreen(config);
} catch (final LionEngineException exception) {
// Skip test
if (!ScreenFullAwt.ERROR_SWITCH.equals(exception.getMessage())) {
throw exception;
}
}
}
use of com.b3dgs.lionengine.Config in project lionengine by b3dgs.
the class ScreenHeadlessTest method testFullscreen.
/**
* Test full screen.
*
* @throws Exception If error.
*/
@Test
void testFullscreen() throws Exception {
final Resolution resolution = com.b3dgs.lionengine.UtilTests.RESOLUTION_320_240;
final Config config = new Config(resolution, 32, false, Medias.create(IMAGE));
assertTimeout(1000L, () -> testScreen(config));
}
Aggregations