Snoke
Game_run.h
Go to the documentation of this file.
1 #ifndef GAME_RUN_H
2 #define GAME_RUN_H
3 
4 #include "shared.h"
5 #include "Game/game.h"
6 
7 TEST(Game_run, test1)
8 {
9  /*
10  * Block initializing ncurses console in the current console window,
11  * and setting some parameters
12  */
13  initscr();
14  start_color();
15  noecho();
16  nodelay(stdscr, true);
17  curs_set(0);
18  keypad(stdscr, true);
19 
20  Game game;
21  int size = 100;
22  int speed = 150;
23  int cycles = 5;
24  bool retVal = game.init(size, speed, cycles);
25  if(!retVal)
26  {
27  FAIL();
28  }
29 
30  retVal = game.run();
31  endwin();
32  if(retVal)
33  {
34  FAIL();
35  }
36  else
37  {
38  SUCCEED();
39  }
40 }
41 
42 #endif // GAME_RUN_H
bool init(int size=20, int sp=100, int loops=-1)
Initializes game.
Definition: game.cpp:38
Definitions and prototypes for Game class.
int run()
Main game loop.
Definition: game.cpp:68
shared functions for testing
Main game class.
Definition: game.h:30
TEST(Game_run, test1)
Definition: Game_run.h:7