예제 #1
0
    public void testLayerObjDestroy()
    {
        mapObj   map       = new mapObj(mapfile);
        layerObj newLayer  = new layerObj(map);
        layerObj reference = map.getLayer(map.numlayers - 1);

        assert(newLayer.refcount == 3, "testLayerObjDestroy precondition");
        newLayer.Dispose();         // force the destruction for Mono on Windows because of the constructor overload
        newLayer = null;
        gc();
        assert(reference.refcount == 2, "testLayerObjDestroy");
    }
예제 #2
0
	public void testInsertLayerObjDestroy() 
	{
		mapObj map=new mapObj(mapfile);
		layerObj newLayer=new layerObj(null);
		map.insertLayer(newLayer,0);
		layerObj reference = map.getLayer(0);

		assert(newLayer.refcount == 3, "testInsertLayerObjDestroy precondition");
		newLayer.Dispose(); // force the destruction for Mono on Windows because of the constructor overload
		newLayer=null;
		gc();
		assert(reference.refcount == 2, "testInsertLayerObjDestroy");
	}