Commit Graph

16 Commits

Author SHA1 Message Date
Murilo Pereira
3420045a35 Refactored 'length(stack)' and added test. 2011-02-16 22:42:49 -02:00
Murilo Pereira
b1000cfb55 Moving game logic to the game object. 2011-02-16 22:27:00 -02:00
Murilo Pereira
417a8ca2b7 s/delete/free/g 2011-02-14 00:10:47 -02:00
Murilo Pereira
c6ac149dde 'duplicate_stack(stack)' was returning reversed stacks. 2011-02-13 23:43:58 -02:00
Murilo Pereira
777434177f Added tests for the stack and made them pass.
* Make 'empty(stack)' more robust
* Only try to 'push(stack, card)' if card != NULL
* Added message explaining why 'pop(stack)' needs to create a new
  stack object when popping a stack's last element
* 'move_card(stack, stack)' now checks if the origin pops something
   before trying to 'push(stack)' to destination. This prevents
   dereferencing a possible NULL pointer.
2011-02-13 23:13:16 -02:00
Murilo Pereira
02e9e0a04f Formatting. 2011-02-13 19:40:29 -02:00
Murilo Pereira
dea468e8be No need for stdbool.h. 2011-02-13 19:37:50 -02:00
Murilo Pereira
422a866e10 Added helper functions for the unit tests.
* Also added tests for the helper functions
2011-02-13 19:35:40 -02:00
Murilo Pereira
8445bd1a5e Free frames after assertions. 2011-02-12 16:30:33 -02:00
Murilo Pereira
9821a5265a Added unit tests for the card object. 2011-02-12 16:28:58 -02:00
Murilo Pereira
e2f50b183a One assert per expectation makes better error messages. 2011-02-12 16:00:23 -02:00
Murilo Pereira
cdbb86e331 Only test my code. 2011-02-12 15:58:24 -02:00
Murilo Pereira
8c02e908db Typos. 2011-02-12 14:54:50 -02:00
Murilo Pereira
fcece2b7ac Add initial unit tests. 2011-02-06 23:33:44 -02:00
Murilo Soares Pereira
b754c0a71e Added the a debug function to print the values of the structures. 2010-04-22 01:51:27 -03:00
Murilo Soares Pereira
2c06189b6c Added the initial test files. 2010-04-22 01:50:32 -03:00