OpenLayers OpenLayers

Changeset 1085

Show
Ignore:
Timestamp:
08/08/06 11:42:29 (2 years ago)
Author:
euzuro
Message:

change tests to use lonlat and pixel .equals() functions

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/euzuro/layerswitcher/tests/test_Bounds.html

    r961 r1085  
    55    var bounds;  
    66    function test_01_Bounds_constructor (t) { 
    7         t.plan( 14 ); 
     7        t.plan( 12 ); 
    88        bounds = new OpenLayers.Bounds(0,2,10,4); 
    99        t.ok( bounds instanceof OpenLayers.Bounds, "new OpenLayers.Bounds returns Bounds object" ); 
     
    2020        t.eq( sz.h, 2, "bounds.getSize() has correct height value" ); 
    2121     
    22         var center = bounds.getCenterPixel(); 
    23         t.eq( center.x, 5, "bounds.getCenterPixel() has correct x value" ); 
    24         t.eq( center.y, 3, "bounds.getCenterPixel() has correct y value" ); 
    25  
    26         var center = bounds.getCenterLonLat(); 
    27         t.eq( center.lon, 5, "bounds.getCenterLonLat() has correct lon value" ); 
    28         t.eq( center.lat, 3, "bounds.getCenterLonLat() has correct lat value" ); 
    29  
     22        var center = new OpenLayers.Pixel(5,3); 
     23        var boundsCenter = bounds.getCenterPixel(); 
     24        t.ok( boundsCenter.equals(center), "bounds.getCenterLonLat() has correct value" ); 
     25 
     26        var center = new OpenLayers.LonLat(5,3); 
     27        var boundsCenter = bounds.getCenterLonLat(); 
     28        t.ok( boundsCenter.equals(center), "bounds.getCenterLonLat() has correct value" ); 
    3029     } 
    3130