; Copyright (C) 2003 Free Software Foundation, Inc. ; ; This file is part of GNU Hégémonie. ; ; This program is free software; you can redistribute it and/or ; modify it under the terms of the GNU General Public License ; as published by the Free Software Foundation; either version 2 ; of the License, or (at your option) any later version. ; ; This program is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with this program; if not, write to the Free Software ; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. (define map ([] "MapTerrain" alloc)) (define map2 ([] "MapTerrain" alloc)) (define (testSetHeight heightField) (begin ([] heightField setHeightAtPosition: '(1 2) toHeight: 43) (equal? 43 ([] heightField heightAtPosition: '(1 2))))) (define (testSetSeaLevel heightField) (begin ([] heightField setSeaLevel: 133) (equal? 133 ([] heightField seaLevel)))) (define terrainPath ([] "NSString" stringWithCString: "/home/info/An-01-02/nibeauge/hegemonie/Map/montagnes.tiff") ) (greg-testcase "MapTerrain initialisation with x and z lengths" #t (lambda () (equal? map ([] map initWithXLength: 3 withZLength: 4)))) (greg-testcase "MapTerrain initialisation with file" #t (lambda () (equal? map2 ([] map2 initWithImageName: terrainPath)))) (greg-testcase "check x length" #t (lambda () (equal? 3 ([] map xLength))) ) (greg-testcase "check z length" #t (lambda () (equal? 4 ([] map zLength))) ) (greg-testcase "check sea level" #t (lambda () (equal? 0 ([] map seaLevel))) ) (greg-testcase "test set height" #t (lambda () (testSetHeight map))) (greg-testcase "test set sea level" #t (lambda () (testSetSeaLevel map)))