all broken

This commit is contained in:
Hugo LAMY
2022-07-02 18:30:27 +02:00
parent 9bde325ece
commit 52fa6ff65b
5 changed files with 27 additions and 18 deletions

View File

@@ -38,9 +38,9 @@ CC = c++
EXT = cpp EXT = cpp
CFLAGS = -Wall -Wextra -Werror $(INCLUDES) CFLAGS = -Wall -Wextra -Werror $(INCLUDES)
#CFLAGS += -std=c++98 CFLAGS += -std=c++98
#CFLAGS += -MMD -MP #see end-page note on header dependencie CFLAGS += -MMD -MP #see end-page note on header dependencie
#CFLAGS += -g3 CFLAGS += -g3
CFLAGS_STL = $(CFLAGS) CFLAGS_STL = $(CFLAGS)
CFLAGS_STL += -D STL CFLAGS_STL += -D STL

View File

@@ -27,6 +27,7 @@
# define TOI(n) toi<T>(n) # define TOI(n) toi<T>(n)
# define PRINT(n) print<>(n, #n); # define PRINT(n) print<>(n, #n);
# define DELETE delete_structs(); # define DELETE delete_structs();
# define DISALLOW_MYSTRUCT allow_mystruct = 0;
// prototypes // prototypes
@@ -43,7 +44,7 @@ extern std::vector< mystruct* > mem_list;
// adding each test to the list // adding each test to the list
// *************************** // ***************************
#define TEST(f_name) TEST_V(f_name) #define TEST_S(f_name) TEST_V(f_name)
/* /*
*/ */
@@ -56,7 +57,9 @@ extern std::vector< mystruct* > mem_list;
add_to_list(#f_name, "int", new(s_ ## f_name <int>));\ add_to_list(#f_name, "int", new(s_ ## f_name <int>));\
add_to_list(#f_name, "char", new(s_ ## f_name <char>));\ add_to_list(#f_name, "char", new(s_ ## f_name <char>));\
add_to_list(#f_name, "std::string", new(s_ ## f_name <std::string>));\ add_to_list(#f_name, "std::string", new(s_ ## f_name <std::string>));\
if (allow_mystruct)\
add_to_list(#f_name, "mystruct*", new(s_ ## f_name <mystruct*>));\ add_to_list(#f_name, "mystruct*", new(s_ ## f_name <mystruct*>));\
allow_mystruct = 1;\
}\ }\
template <class T>\ template <class T>\
void s_ ## f_name <T>::func() void s_ ## f_name <T>::func()

View File

@@ -14,6 +14,11 @@
#endif #endif
// global variables
// ****************************************
int allow_mystruct = 1;
// templates print // templates print
// ***************************************** // *****************************************
template <class T> template <class T>

View File

@@ -7,7 +7,7 @@
#define DEQ_VEC vector #define DEQ_VEC vector
#endif #endif
TEST(tests_stack_constructor) TEST_S(tests_stack_constructor)
{ {
// title // title
TITLE(simple test) TITLE(simple test)
@@ -34,7 +34,7 @@ TEST(tests_stack_constructor)
DELETE DELETE
} }
TEST(tests_stack_empty) TEST_S(tests_stack_empty)
{ {
// title // title
TITLE(simple test) TITLE(simple test)
@@ -57,7 +57,7 @@ TEST(tests_stack_empty)
DELETE DELETE
} }
TEST(tests_stack_size) TEST_S(tests_stack_size)
{ {
// title // title
TITLE(simple test) TITLE(simple test)
@@ -76,7 +76,7 @@ TEST(tests_stack_size)
DELETE DELETE
} }
TEST(tests_stack_top) TEST_S(tests_stack_top)
{ {
// title // title
TITLE(simple test) TITLE(simple test)
@@ -100,7 +100,7 @@ TEST(tests_stack_top)
DELETE DELETE
} }
TEST(tests_stack_push) TEST_S(tests_stack_push)
{ {
// title // title
TITLE(simple test) TITLE(simple test)
@@ -114,7 +114,7 @@ TEST(tests_stack_push)
DELETE DELETE
} }
TEST(tests_stack_pop) TEST_S(tests_stack_pop)
{ {
// title // title
TITLE(simple test) TITLE(simple test)

View File

@@ -695,6 +695,7 @@ TEST_V(tests_vector_get_allocator)
DELETE DELETE
} }
//DISALLOW_MYSTRUCT
TEST_V(tests_vector_relational_operators) TEST_V(tests_vector_relational_operators)
{ {
// title // title