Ignore:
Timestamp:
2014-05-06T01:24:41+02:00 (8 years ago)
Author:
Don-vip
Message:

test cleanup

Location:
trunk/test/performance/org/openstreetmap/josm/data/osm
Files:
2 added
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/test/performance/org/openstreetmap/josm/data/osm/RoundingPerformanceTest.java

    r4573 r7068  
     1// License: GPL. For details, see LICENSE file.
    12package org.openstreetmap.josm.data.osm;
     3
     4import static org.junit.Assert.assertTrue;
    25
    36import org.junit.Test;
     
    58import org.openstreetmap.josm.data.coor.LatLonTest;
    69
    7 import static org.junit.Assert.assertTrue;
     10public class RoundingPerformanceTest {
    811
    9 public class RoundingPerformanceTest extends LatLonTest {
    10    
    1112    private static double oldRoundToOsmPrecision(double value) {
    1213        return Math.round(value / LatLon.MAX_SERVER_PRECISION) * LatLon.MAX_SERVER_PRECISION; // Old method, causes rounding errors, but efficient
     
    1819        long start = System.nanoTime();
    1920        for (int i = 0; i < n; i++) {
    20             for (double value : sampleValues) {
     21            for (double value : LatLonTest.SAMPLE_VALUES) {
    2122                oldRoundToOsmPrecision(value);
    2223            }
     
    2526        long oldTime = end-start;
    2627        System.out.println("Old time: "+oldTime/1000000.0 + " ms");
    27        
     28
    2829        start = System.nanoTime();
    2930        for (int i = 0; i < n; i++) {
    30             for (double value : sampleValues) {
     31            for (double value : LatLonTest.SAMPLE_VALUES) {
    3132                LatLon.roundToOsmPrecision(value);
    3233            }
     
    3536        long newTime = end-start;
    3637        System.out.println("New time: "+newTime/1000000.0 + " ms");
    37        
     38
    3839        assertTrue(newTime <= oldTime*10);
    3940    }
  • trunk/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRendererPerformanceTest.java

    r7065 r7068  
    11// License: GPL. For details, see LICENSE file.
    2 package org.openstreetmap.josm.data.osm;
     2package org.openstreetmap.josm.data.osm.visitor.paint;
    33
    44import java.awt.Graphics2D;
     
    1111import org.openstreetmap.josm.Main;
    1212import org.openstreetmap.josm.data.Bounds;
     13import org.openstreetmap.josm.data.osm.DataSet;
    1314import org.openstreetmap.josm.data.osm.visitor.paint.Rendering;
    1415import org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer;
     
    1920import org.openstreetmap.josm.io.OsmReader;
    2021
    21 public class MapPaintVisitorPerformanceTest {
     22public class StyledMapRendererPerformanceTest {
    2223
    2324    private static final int IMG_WIDTH = 1400;
     
    5455
    5556        // Warm up
    56         new MapPaintVisitorPerformanceTest().testRestrictionSmall();
    57         new MapPaintVisitorPerformanceTest().testCity();
     57        new StyledMapRendererPerformanceTest().testRestrictionSmall();
     58        new StyledMapRendererPerformanceTest().testCity();
    5859    }
    5960
Note: See TracChangeset for help on using the changeset viewer.