/[hegemonie]/hegemonie/Testing/GameEngine/testHgShip.scm
ViewVC logotype

Diff of /hegemonie/Testing/GameEngine/testHgShip.scm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by chlussea, Mon May 26 13:34:50 2003 UTC revision 1.2 by chlussea, Tue May 27 09:51:28 2003 UTC
# Line 27  Line 27 
27                      (define game                      (define game
28                        ([] ([] "HgGame" alloc) initWithName: ($$ "meuh")))                        ([] ([] "HgGame" alloc) initWithName: ($$ "meuh")))
29                      (equal? ship ([] ship initWithGame: game                      (equal? ship ([] ship initWithGame: game
30                                              position: '(1.5 2.0 6.0)                                                position: '(1.5 2.0 6.0)
31                                              velocity: '(5.75 6.5 7.0)                                                velocity: '(5.75 6.5 7.0)
32                                       angularVelocity: '(8.5 9.0 10.0)                                         angularVelocity: '(8.5 9.0 10.0)
33                                          acceleration: 5.0                                            acceleration: 5.0
34                                             direction: 11.0))))                                               direction: 11.0))))
35    
36  (greg-testcase "HgShip fuel accessors" #t  (greg-testcase "HgShip fuel accessors" #t
37                 (lambda ()                 (lambda ()
38                   ([] ship setFuel: 21)                   ([] ship setFuel: 21)
39                   (equal? 20 ([] ship fuel))))                   (equal? 21 ([] ship fuel))))
40    
41  (greg-testcase "HgShip fireRate accessor" #t  (greg-testcase "HgShip fireRate accessors" #t
42                 (lambda ()                 (lambda ()
43                     ([] ship setFireRate: 29)
44                   (equal? 29 ([] ship fireRate))))                   (equal? 29 ([] ship fireRate))))
45    
46  (greg-testcase "HgShip weapons accessor" #t  (greg-testcase "HgShip nbammos accessors" #t
47                 (lambda ()                 (lambda ()
48                   (equal?  ([] ship weapons))))                   ([] ship setNbAmmo: 40)
49                     (equal? 40 ([] ship nbAmmos))))
50    
51  (greg-testcase "HgShip capacities1 accessor" #t  (greg-testcase "HgShip useAmmos method" #t
52                 (lambda ()                 (lambda ()
53                   (equal?  ([] ship capacities1))))                   ([] ship useAmmos: 5)
54                     (equal? 35 ([] ship nbAmmos))))
 (greg-testcase "HgShip capacities2 accessor" #t  
                (lambda ()  
                  (equal?  ([] ship capacities2))))  
   
   
   
   
   
 ;(greg-testcase "HgShip nbAmmos accessor" #t  
  ;             (lambda ()  
 ;                ([] ship setPosition: '(4.0 5.0 6.5))  
 ;                (equal? '(4.0 5.0 6.5) ([] ship position))))  
   
   
   
   
   
 ;(greg-testcase "HgShip orientation accessors" #t  
 ;              (lambda ()  
  ;               ([] ship setOrientation: '(2.0 3.0 7.0))  
         ;        (equal? '(2.0 3.0 7.0) ([]  ship orientation))))  
   
55    
56    
 ;(greg-testcase "HgShip position after initialisation" #t  
          ;      (lambda ()  
                 ; (equal? 29 ([] ship fireRate))))  

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26