From 6785e543b2c9377f9e8fb39326674db0402a9651 Mon Sep 17 00:00:00 2001 From: "Le-Bao-Tin.Ha" <le-bao-tin.ha@insa-rennes.fr> Date: Thu, 18 Mar 2021 19:26:46 +0100 Subject: [PATCH] add test DS and test Prof --- GAME/googletest | 1 - GAME/test/test_DS.h | 25 +++++++++++++++++++++++++ GAME/test/test_personnage.h | 2 +- GAME/test/test_prof.h | 24 ++++++++++++++++++++++++ 4 files changed, 50 insertions(+), 2 deletions(-) delete mode 160000 GAME/googletest create mode 100644 GAME/test/test_DS.h create mode 100644 GAME/test/test_prof.h diff --git a/GAME/googletest b/GAME/googletest deleted file mode 160000 index e8512bc..0000000 --- a/GAME/googletest +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e8512bc38c4c0060858c3306b0660a3f126aee30 diff --git a/GAME/test/test_DS.h b/GAME/test/test_DS.h new file mode 100644 index 0000000..2a55b1b --- /dev/null +++ b/GAME/test/test_DS.h @@ -0,0 +1,25 @@ +/* +// Created by Tiny on 3/18/2021. +*/ + +#ifndef MAIN_C_TEST_DS_H +#define MAIN_C_TEST_DS_H + + +#include <gtest/gtest.h> +extern "C"{ +#include "DS.h" +} + +TEST(test_init_DS,Door_3){ +DS exam; +init_DS(&exam,3,"testimage"); +EXPECT_STREQ("testimage",exam.image_DS); +EXPECT_EQ(369,exam.x_DS); +EXPECT_EQ(41,exam.y_DS); +EXPECT_EQ(21,exam.larg_DS); +EXPECT_EQ(10,exam.long_DS); +} + + +#endif /*MAIN_C_TEST_DS_H*/ diff --git a/GAME/test/test_personnage.h b/GAME/test/test_personnage.h index 66c50a4..2d10267 100644 --- a/GAME/test/test_personnage.h +++ b/GAME/test/test_personnage.h @@ -29,6 +29,6 @@ TEST(test_calcul_point,values_3_3){ EXPECT_EQ(6,person.y_ll); EXPECT_EQ(6,person.x_lr); EXPECT_EQ(6,person.y_lr); - } + #endif /*INSAGAME_TEST_PERSONNAGE_H*/ diff --git a/GAME/test/test_prof.h b/GAME/test/test_prof.h new file mode 100644 index 0000000..5cefde6 --- /dev/null +++ b/GAME/test/test_prof.h @@ -0,0 +1,24 @@ +/* +// Created by Tiny on 3/18/2021. +*/ + +#ifndef MAIN_C_TEST_PROF_H +#define MAIN_C_TEST_PROF_H + +#include <gtest/gtest.h> +extern "C"{ +#include "prof.h" +} + +TEST(test_init_prof,values_3_3_3_3_3_testimage){ + Prof prof; + init_prof(&prof,3,3,3,3,3,"testimage"); + EXPECT_EQ(3,prof.x_prof); + EXPECT_EQ(3,prof.y_prof); + EXPECT_EQ(3,prof.long_prof); + EXPECT_EQ(3,prof.larg_prof); + EXPECT_STREQ("testimage",prof.image_prof); +} + + +#endif /*MAIN_C_TEST_PROF_H*/ -- GitLab