jaroslav@381: /** jaroslav@381: * Back 2 Browser Bytecode Translator jaroslav@1787: * Copyright (C) 2012-2015 Jaroslav Tulach jaroslav@381: * jaroslav@381: * This program is free software: you can redistribute it and/or modify jaroslav@381: * it under the terms of the GNU General Public License as published by jaroslav@381: * the Free Software Foundation, version 2 of the License. jaroslav@381: * jaroslav@381: * This program is distributed in the hope that it will be useful, jaroslav@381: * but WITHOUT ANY WARRANTY; without even the implied warranty of jaroslav@381: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the jaroslav@381: * GNU General Public License for more details. jaroslav@381: * jaroslav@381: * You should have received a copy of the GNU General Public License jaroslav@381: * along with this program. Look for COPYING file in the top folder. jaroslav@381: * If not, see http://opensource.org/licenses/GPL-2.0. jaroslav@381: */ jaroslav@1877: package org.apidesign.benchmark.jbox2d; jaroslav@381: jaroslav@381: import java.io.IOException; jaroslav@381: import org.apidesign.bck2brwsr.vmtest.Compare; jaroslav@381: import org.apidesign.bck2brwsr.vmtest.VMTest; jaroslav@381: import org.testng.annotations.Factory; jaroslav@381: jaroslav@1877: public class JBox2dSimulationTest { jaroslav@1877: public JBox2dSimulationTest() { jaroslav@1854: } jaroslav@1854: jaroslav@1878: @Compare(slowdown = 30.0) jaroslav@1885: public int fewIter() throws IOException { jaroslav@1877: Scene s = new Scene(); jaroslav@1885: for (int i = 0; i < 100; i++) { jaroslav@1877: s.calculate(); jaroslav@1877: } jaroslav@1877: return s.getWorld().getBodyCount(); jaroslav@381: } jaroslav@381: jaroslav@381: @Factory jaroslav@381: public static Object[] create() { jaroslav@1877: return VMTest.create(JBox2dSimulationTest.class); jaroslav@381: } jaroslav@381: }