debug all leak mem with valgrind in ftest and tensor rep

This commit is contained in:
2024-02-08 23:57:10 +01:00
parent 6ae0f7cd75
commit e1171d720b
32 changed files with 1468 additions and 405 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
#!/bin/bash
gcc -o x1 eg1.c -I../include_ytest/include/ -L.. -lytest $1
gcc -o x1 eg1.c -g -I../include_ytest/include/ -L.. -lytest $1
+26 -4
View File
@@ -1,5 +1,6 @@
#include "ftest/ftest.h"
#if 1
TEST(foo){
PRINTF("first test\n");
int a=1;
@@ -7,35 +8,56 @@ TEST(foo){
}
TEST(foo){ /* same name*/
sleep(2);
//sleep(2);
float a=0.001, b=0.0005;
PRINTF("after sleeping 2 seconds, we test if %f ?= 2*%f\n",a,b);
EXPECT_EQ_TYPE_FLOAT(a,2*b);
}
#endif
#if 0
TEST(foo){
sleep(1);
double a=0.001, b=0.0001;
LOG("after 1 sec, \n");
EXPECT_LT_TYPE_DOUBLE(b,a);
ASSERT_GE_TYPE_DOUBLE(a,b);
ASSERT_LE_TYPE_DOUBLE(a,b);
LOG("this line will not print");
// ASSERT_GE_TYPE_DOUBLE(a,b);
// ASSERT_LE_TYPE_DOUBLE(a,b);
// LOG("this line will not print");
}
#endif
#if 0
TEST(){
EXPECT_TRUE(2==1);
LOG("this line will print: the precedent expect failed\n");
}
#endif
#if 1
TEST(){
/*EXPECT_TRUE(2==1);
LOG("this line will print: the precedent expect failed\n");
LOG("hey\n");
*/
}
#endif
#if 1
TEST(){
sleep(1);
EXPECT_FALSE(2==1);
}
#endif
#if 1
TEST(an_other_test){
LOG("FINAL, no test, only sleep\n");
sleep(2);
}
#endif
int main(int argc, char **argv){
run_all_tests_args(argc,argv);
Binary file not shown.