add simple test, and mv permutation test, update README

This commit is contained in:
2023-10-17 16:45:57 +02:00
parent 130c356d95
commit c91910a278
25 changed files with 3660 additions and 83 deletions
+1 -26
View File
@@ -17,41 +17,16 @@ OBJ=$(SRC:.c=.o)
TEST_DIR=$(PWD)
EXECSRC=$(NAME_TEST).c
EXEC=launch_$(NAME_TEST)_m
PERMSRC=src/permutation_t/permutation_t.c
PERMSRC_O=$(PERMSRC:.c=.o)
SETTSRC=src/set_theoric_t/set_theoric_t.c
SETTSRC_O=$(SETTSRC:.c=.o)
TOOLSRC=../ytools_t/src/tools_t/tools_t.c
TOOLSRC_O=$(TOOLSRC:.c=.o)
FTESTSRC=src/ftest/ftest.c
FTESTSRC_O=$(FTESTSRC:.c=.o)
FMOCKSRC=src/fmock/fmock.c
FMOCKSRC_O=$(FMOCKSRC:.c=.o)
BPROGRESSRC=src/bar_progress/bar_progress.c
BPROGRESSRC_0=$(BPROGRESSRC:.c=.o)
LIB_YTEST=../libytest.so
LIB_YTEST=$(PWD)/../libytest.so
all: $(EXEC) $(LIB_YTEST)
$(EXEC): $(EXECSRC) $(OBJ)
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
$(PERMSRC_O): $(PERMSRC) $(SETTSRC_O)
$(CC) -o $@ -c $< $(CFLAGS)
$(SETTSRC_O) : $(SETTSRC) $(TOOLSRC_O)
$(CC) -o $@ -c $< $(CFLAGS)
$(TOOLSRC_O): $(TOOLSRC)
$(CC) -o $@ -c $< $(CFLAGS)
.PHONY: clean mrproper
clean:
#echo "all src : $(SRC)"
#echo "all obj : $(OBJ)"
rm -f $(OBJ)
mrproper: clean
+2 -2
View File
@@ -12,11 +12,11 @@ if [ "$#" -le 1 ] ; then
fi
export LD_LIBRARY_PATH=$PWD/../:LD_LIBRARY_PATH
gcc -o launch_is_good_c $1 -L$PWD/../ $2 -lytest -I../include_ytest/include src/permutation_t/permutation_t.o src/set_theoric_t/set_theoric_t.o -I./src
gcc -o launch_is_good_c $1 -L$PWD/../ $2 -lytest -I../include_ytest/include
#gcc -o launch_is_good_c $1 $2 -lytest -I../include_ytest src/permutation_t/permutation_t.o src/set_theoric_t/set_theoric_t.o -I./src
export LD_LIBRARY_PATH=$PWD/../:LD_LIBRARY_PATH
#gcc $1 src/ftest/ftest.c src/fmock/fmock.c src/tools_t/tools_t.c src/bar_progress/bar_progress.c src/permutation_t/permutation_t.c src/set_theoric_t/set_theoric_t.c -I./include $2 -o launch_is_good_c -lpthread
+8 -51
View File
@@ -12,47 +12,20 @@
#include "ftest/ftest.h"
#include "fmock/fmock.h"
#if 1
#include "permutation_t/permutation_t.h"
TEST(size_permutation2){
PRINTF("another size_permutation2 again\n");
ASSERT_TRUE(false);
}
TEST(size_permutation)
{
PERMUTATION_TYPE_CHAR *p = CREATE_PERMUTATION_TYPE_CHAR(3);
PRINTF(" size = %lu \n",p->size);
EXPECT_EQ(p->size, 3);
PRINTF("test size_permutation2\n");
}
#endif
TEST(size_permutation2){
PRINTF("another size_permutation2 again false\n");
TEST(true__){
PRINTF("another test again false\n");
bool val_bool = false;
ASSERT_TRUE(val_bool);
}
TEST(size_permutation2)
TEST(test)
{
PRINTF("test size_permutation2\n");
PRINTF("test test\n");
bool val_bool = true;
ASSERT_FALSE(val_bool);
/*
PERMUTATION_TYPE_CHAR *p = CREATE_PERMUTATION_TYPE_CHAR(3);
PRINTF(" size = %u \n",p->size);
if(p->size == 3) print_OK_with_msg_endl(" FF yeah GOOD test size passed ");
else print_KO_with_msg_endl("NOT GOOD test size not passed ");
*/
}
TEST(float_equal){
PRINTF("another size_permutation2 float\n");
PRINTF("another test float\n");
ASSERT_TRUE(true);
float a = 1.00001f;
float b = 1.00001f;
@@ -62,7 +35,7 @@ TEST(float_equal){
ASSERT_EQ_TYPE_FLOAT(1.0000102f,b);
}
TEST(double_equal){
PRINTF("another size_permutation2 double\n");
PRINTF("another test double\n");
ASSERT_TRUE(true);
double a = 1.00000001;
double b = 1.00000001;
@@ -75,7 +48,7 @@ TEST(double_equal){
TEST(){
unsigned char c = 'a';
debug_print("another size_permutation2, a = %c\n",c);
debug_print("another test, a = %c\n",c);
ASSERT_FALSE(true);
ASSERT_TRUE(true);
ASSERT_TRUE(true);
@@ -118,22 +91,6 @@ TEST(){
}
TEST(){
PERMUTATION_TYPE_CHAR *p_char = CREATE_PERMUTATION_TYPE_CHAR(6);
p_char->perm[0]='B';
p_char->perm[1]='A';
p_char->perm[2]='Y';
p_char->perm[3]='C';
p_char->perm[4]='D';
p_char->perm[5]='Z';
PERMUTATION_TYPE_SIZE_T *tr_p_char = TRANSLATE_TO_SET_THEORIC_SIZE_T_TYPE_CHAR(p_char);
for(int i = 0; i < tr_p_char->size; ++i) PRINTF(" [%d ]%ld ,",i,tr_p_char->perm[i]);
PRINTF("p_char == %s\n",p_char->perm);
}
TEST(lessThan){
long int a=1,b=2;
EXPECT_LT(a,b);