Merge branch 'master' into 3526

This commit is contained in:
ahocevar
2011-10-06 18:21:05 -04:00
61 changed files with 124 additions and 1054 deletions

View File

@@ -632,7 +632,7 @@
}
function test_Bounds_add(t) {
t.plan( 8 );
t.plan( 6 );
origBounds = new OpenLayers.Bounds(1,2,3,4);
testBounds = origBounds.clone();
@@ -644,19 +644,19 @@
t.ok( bounds.equals(b), "bounds is set correctly");
//null values
OpenLayers.Lang.setCode('en');
var desiredMsg = "You must pass both x and y values to the add function.";
OpenLayers.Console.error = function(msg) {
t.eq(msg, desiredMsg, "error correctly reported");
try {
bounds = testBounds.add(null, 50);
} catch(e) {
t.ok("exception thrown when passing null value to add()");
}
bounds = testBounds.add(null, 50);
t.ok( testBounds.equals(origBounds), "testBounds is not modified by erroneous add operation (null x)");
t.ok(bounds == null, "returns null on erroneous add operation (null x)");
bounds = testBounds.add(5, null);
try {
bounds = testBounds.add(5, null);
} catch(e) {
t.ok("exception thrown when passing null value to add()");
}
t.ok( testBounds.equals(origBounds), "testBounds is not modified by erroneous add operation (null y)");
t.ok(bounds == null, "returns null on erroneous add operation (null y)");
}
function test_Bounds_scale(t) {

View File

@@ -52,7 +52,7 @@
}
function test_LonLat_add(t) {
t.plan(10);
t.plan(8);
origLL = new OpenLayers.LonLat(10,100);
lonlatA = origLL.clone();
@@ -64,19 +64,19 @@
t.ok( addpx.equals(ll), "addpx is set correctly");
//null values
OpenLayers.Lang.setCode('en');
var desiredMsg = "You must pass both lon and lat values to the add function.";
OpenLayers.Console.error = function(msg) {
t.eq(msg, desiredMsg, "error correctly reported");
try {
addpx = lonlatA.add(null, 50);
} catch(e) {
t.ok("exception thrown when passing null value to add()");
}
addpx = lonlatA.add(null, 50);
t.ok( lonlatA.equals(origLL), "lonlatA is not modified by erroneous add operation (null lon)");
t.ok(addpx == null, "returns null on erroneous add operation (null lon)");
addpx = lonlatA.add(5, null);
try {
addpx = lonlatA.add(5, null);
} catch(e) {
t.ok("exception thrown when passing null value to add()");
}
t.ok( lonlatA.equals(origLL), "lonlatA is not modified by erroneous add operation (null lat)");
t.ok(addpx == null, "returns null on erroneous add operation (null lat)");
// string values
addpx = origLL.clone().add("5", "50");

View File

@@ -72,7 +72,7 @@
}
function test_Pixel_add(t) {
t.plan( 8 );
t.plan( 6 );
var origPX = new OpenLayers.Pixel(5,6);
var oldPixel = origPX.clone();
@@ -85,19 +85,19 @@
t.ok( pixel.equals(px), "returned pixel is correct");
//null values
OpenLayers.Lang.setCode('en');
var desiredMsg = "You must pass both x and y values to the add function.";
OpenLayers.Console.error = function(msg) {
t.eq(msg, desiredMsg, "error correctly reported");
try {
pixel = oldPixel.add(null, 50);
} catch(e) {
t.ok("exception thrown when passing null value to add()");
}
pixel = oldPixel.add(null, 50);
t.ok( oldPixel.equals(origPX), "oldPixel is not modified by erroneous add operation (null x)");
t.ok(pixel == null, "returns null on erroneous add operation (null x)");
addpx = oldPixel.add(5, null);
try {
addpx = oldPixel.add(5, null);
} catch(e) {
t.ok("exception thrown when passing null value to add()");
}
t.ok( oldPixel.equals(origPX), "oldPixel is not modified by erroneous add operation (null y)");
t.ok(pixel == null, "returns null on erroneous add operation (null y)");
}
function test_Pixel_offset(t) {