Merge branch 'master' into 3526
This commit is contained in:
+10
-10
@@ -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) {
|
||||
|
||||
+10
-10
@@ -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");
|
||||
|
||||
+10
-10
@@ -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) {
|
||||
|
||||
@@ -133,6 +133,28 @@
|
||||
t.xml_eq(got, expected, snippet + " request without geometry created correctly");
|
||||
}
|
||||
}
|
||||
|
||||
function test_setFilterProperty(t) {
|
||||
t.plan(2);
|
||||
var format = new OpenLayers.Format.WFST({
|
||||
geometryName: "foo"
|
||||
});
|
||||
var filter = new OpenLayers.Filter.Logical({
|
||||
type: OpenLayers.Filter.Logical.AND,
|
||||
filters: [new OpenLayers.Filter.Spatial({
|
||||
type: OpenLayers.Filter.Spatial.BBOX,
|
||||
value: new OpenLayers.Bounds(1,2,3,4)
|
||||
}), new OpenLayers.Filter.Spatial({
|
||||
type: OpenLayers.Filter.Spatial.DWITHIN,
|
||||
property: "bar",
|
||||
value: new OpenLayers.Geometry.Point(1,2),
|
||||
distance: 10
|
||||
})]
|
||||
});
|
||||
format.setFilterProperty(filter);
|
||||
t.eq(filter.filters[0].property, "foo", "property set if not set on filter");
|
||||
t.eq(filter.filters[1].property, "bar", "property not set if set on filter");
|
||||
}
|
||||
|
||||
function test_update_null_geometry(t) {
|
||||
var format = new OpenLayers.Format.WFST({
|
||||
|
||||
+6
-3
@@ -692,9 +692,12 @@
|
||||
{map: '/mapdata/vmap_wms.map', layers: 'basic', format: 'image/jpeg'}
|
||||
);
|
||||
|
||||
map.addLayers([layer,layer]);
|
||||
|
||||
t.eq( map.layers.length, 1, "Map does not allow double adding of layers." );
|
||||
map.addLayers([layer]);
|
||||
try {
|
||||
map.addLayers([layer]);
|
||||
} catch(e) {
|
||||
t.ok(true, "Map does not allow double adding of layers." );
|
||||
}
|
||||
|
||||
map.destroy();
|
||||
}
|
||||
|
||||
@@ -254,21 +254,6 @@
|
||||
|
||||
}
|
||||
|
||||
function test_Util_imageLoadError(t) {
|
||||
t.plan(2);
|
||||
|
||||
var img = OpenLayers.Util.createImage(null, null, null, null, null, null, null, false);
|
||||
|
||||
// mock up image load failure
|
||||
img._attempts = OpenLayers.IMAGE_RELOAD_ATTEMPTS + 1;
|
||||
OpenLayers.Util.onImageLoadError.call(img);
|
||||
t.ok(OpenLayers.Element.hasClass(img, 'olImageLoadError'), 'broken image has class olImageLoadError');
|
||||
|
||||
// mock up image load success
|
||||
OpenLayers.Util.onImageLoad.call(img);
|
||||
t.ok(!OpenLayers.Element.hasClass(img, 'olImageLoadError'), 'good image does not have class olImageLoadError');
|
||||
}
|
||||
|
||||
function test_Util_applyDefaults(t) {
|
||||
|
||||
t.plan(12);
|
||||
|
||||
Reference in New Issue
Block a user