Skip to content
Snippets Groups Projects
Commit 66259fa2 authored by Le-Bao-Tin.Ha's avatar Le-Bao-Tin.Ha
Browse files
parents 4cf0c381 8cce9462
No related branches found
No related tags found
4 merge requests!9Modele,!8Modele,!7Modele,!6Modele
...@@ -27,7 +27,6 @@ typedef struct { ...@@ -27,7 +27,6 @@ typedef struct {
int y_button; /**< Position : ordinate */ int y_button; /**< Position : ordinate */
int long_button; /**< Size : length */ int long_button; /**< Size : length */
int larg_button; /**< Size : width */ int larg_button; /**< Size : width */
char * image_button; /**< Source image of the button. */
int state; /**< Button's state : 1 if on, 0 if off */ int state; /**< Button's state : 1 if on, 0 if off */
} Button; } Button;
......
GAME/ressource/lose.png

1.42 MiB | W: | H:

GAME/ressource/lose.png

1.39 MiB | W: | H:

GAME/ressource/lose.png
GAME/ressource/lose.png
GAME/ressource/lose.png
GAME/ressource/lose.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -29,7 +29,11 @@ ...@@ -29,7 +29,11 @@
void init_window(Window * window, int level, int time, int id_window) { void init_window(Window * window, int level, int time, int id_window) {
window->id_window=id_window; window->id_window=id_window;
window->level = level; if(id_window==LEVEL){
window->time = time; window->level=level;
window->time=time;
} else {
window->level=-1;
window->time=-1;
}
} }
\ No newline at end of file
...@@ -13,12 +13,11 @@ extern "C"{ ...@@ -13,12 +13,11 @@ extern "C"{
TEST(test_init_button,values_3_4_5_6_testimage) { TEST(test_init_button,values_3_4_5_6_testimage) {
int times = 500000000; int times = 500000000;
Button button; Button button;
init_button(&button, 3, 4, 5, 6, "test_image"); init_button(&button, 3, 4, 5, 6);
EXPECT_EQ(3,button.x_button); EXPECT_EQ(3,button.x_button);
EXPECT_EQ(4,button.y_button); EXPECT_EQ(4,button.y_button);
EXPECT_EQ(5,button.long_button); EXPECT_EQ(5,button.long_button);
EXPECT_EQ(6,button.larg_button); EXPECT_EQ(6,button.larg_button);
EXPECT_STREQ("test_image",button.image_button);
EXPECT_EQ(0, button.state); EXPECT_EQ(0, button.state);
while (times > 0) times--; while (times > 0) times--;
} }
...@@ -27,8 +26,8 @@ TEST(test_click, values_in_button){ ...@@ -27,8 +26,8 @@ TEST(test_click, values_in_button){
int times = 500000000; int times = 500000000;
Button button; Button button;
int res; int res;
init_button(&button, 2, 3, 4, 4, "image"); init_button(&button, 2, 3, 4, 4);
res=click(3, 4, &button); res=clicked(3, 4, &button);
EXPECT_EQ(1,button.state); EXPECT_EQ(1,button.state);
EXPECT_EQ(1, res); EXPECT_EQ(1, res);
while (times > 0) times--; while (times > 0) times--;
...@@ -38,8 +37,8 @@ TEST(test_click, values_out_button){ ...@@ -38,8 +37,8 @@ TEST(test_click, values_out_button){
int times = 500000000; int times = 500000000;
Button button; Button button;
int res; int res;
init_button(&button, 2, 2, 1, 1, "image"); init_button(&button, 2, 2, 1, 1);
res=click(34, 4, &button); res=clicked(34, 4, &button);
EXPECT_EQ(0,button.state); EXPECT_EQ(0,button.state);
EXPECT_EQ(0, res); EXPECT_EQ(0, res);
while (times > 0) times--; while (times > 0) times--;
......
...@@ -14,9 +14,9 @@ extern "C"{ ...@@ -14,9 +14,9 @@ extern "C"{
TEST(test_init_map,with_real_path){ TEST(test_init_map,with_real_path){
int times=500000000; int times=500000000;
MAP map; MAP map;
init_map(&map, "ressource/colored.bmp", "ressoure/mapvis.bmp"); init_map(&map, "ressource/colored.bmp", "ressource/mapvis.bmp");
EXPECT_STREQ("ressource/colored.bmp",map.functional_path); EXPECT_STREQ("ressource/colored.bmp",map.functional_path);
EXPECT_STREQ("ressoure/mapvis.bmp",map.visual_path); EXPECT_STREQ("ressource/mapvis.bmp",map.visual_path);
EXPECT_TRUE(map.functional); EXPECT_TRUE(map.functional);
while(times>0) times--; //this do nothing but it looks cool ^^ while(times>0) times--; //this do nothing but it looks cool ^^
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment