update: fix minor warning on macos
This commit is contained in:
@@ -204,7 +204,6 @@ TEST(f2mock_test){
|
|||||||
|
|
||||||
|
|
||||||
int main(int argc, char **argv){
|
int main(int argc, char **argv){
|
||||||
|
|
||||||
//run_all_tests();
|
//run_all_tests();
|
||||||
//run_all_tests_parallel(4);
|
//run_all_tests_parallel(4);
|
||||||
|
|
||||||
|
|||||||
+7
-7
@@ -1141,7 +1141,7 @@ do{
|
|||||||
#ifndef __TEST_ARRAY_C_H__
|
#ifndef __TEST_ARRAY_C_H__
|
||||||
#define __TEST_ARRAY_C_H__
|
#define __TEST_ARRAY_C_H__
|
||||||
|
|
||||||
#include "ftest/ftest.h"
|
//#include "ftest/ftest.h"
|
||||||
|
|
||||||
#ifndef min
|
#ifndef min
|
||||||
#define min(a,b) (((a)<(b)) ? (a) : (b))
|
#define min(a,b) (((a)<(b)) ? (a) : (b))
|
||||||
@@ -2891,7 +2891,7 @@ void append_failed_list(struct failed_lists **fn_failed_list ,const char *name_f
|
|||||||
* match the id global (gives by OS) of the thread with the local (the program) id of thread \
|
* match the id global (gives by OS) of the thread with the local (the program) id of thread \
|
||||||
*/ \
|
*/ \
|
||||||
long int id_of_thread_executed(const char * func_call_name){ \
|
long int id_of_thread_executed(const char * func_call_name){ \
|
||||||
size_t id_from_self = pthread_self(); \
|
size_t id_from_self = (size_t)pthread_self(); \
|
||||||
for(long int i=0; i<= parallel_nb; ++i){ \
|
for(long int i=0; i<= parallel_nb; ++i){ \
|
||||||
if(id_thread_self[i] == id_from_self) \
|
if(id_thread_self[i] == id_from_self) \
|
||||||
return i; \
|
return i; \
|
||||||
@@ -3523,10 +3523,10 @@ void head_all_parallel_run(struct timespec *start_t){ \
|
|||||||
* print on the top of test in parallel \
|
* print on the top of test in parallel \
|
||||||
*/ \
|
*/ \
|
||||||
void head_parallel_run(struct timespec *start_t, size_t id_thrd){ \
|
void head_parallel_run(struct timespec *start_t, size_t id_thrd){ \
|
||||||
sprintf(log_name_file_thrd[id_thrd],"log_thread_%ld_id_%ld",id_thrd,pthread_self()); \
|
sprintf(log_name_file_thrd[id_thrd],"log_thread_%ld_id_%ld",id_thrd,(size_t)pthread_self()); \
|
||||||
f_ou_th[id_thrd] = fopen(log_name_file_thrd[id_thrd], "w+"); \
|
f_ou_th[id_thrd] = fopen(log_name_file_thrd[id_thrd], "w+"); \
|
||||||
clock_gettime(CLOCK_REALTIME, start_t); \
|
clock_gettime(CLOCK_REALTIME, start_t); \
|
||||||
PRINT_HK_C(colors_f[k_GREEN], tab_hk_f[hk_EQ]," Running tests on thread[%ld] ========== ==threadID== %ld \n", id_thrd,pthread_self()); \
|
PRINT_HK_C(colors_f[k_GREEN], tab_hk_f[hk_EQ]," Running tests on thread[%ld] ========== ==threadID== %ld \n", id_thrd,(size_t)pthread_self()); \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
/* \
|
/* \
|
||||||
@@ -3639,7 +3639,7 @@ run_parallel_tests(void *id) \
|
|||||||
{ \
|
{ \
|
||||||
\
|
\
|
||||||
size_t id_th=*(size_t*)id; \
|
size_t id_th=*(size_t*)id; \
|
||||||
id_thread_self[id_th] = pthread_self(); \
|
id_thread_self[id_th] = (size_t)pthread_self(); \
|
||||||
struct timespec start_t; \
|
struct timespec start_t; \
|
||||||
head_parallel_run(&start_t, id_th); \
|
head_parallel_run(&start_t, id_th); \
|
||||||
execute_test_parallel(id_th); \
|
execute_test_parallel(id_th); \
|
||||||
@@ -3673,7 +3673,7 @@ init_parallel_test_() \
|
|||||||
/* \
|
/* \
|
||||||
* on thread principale \
|
* on thread principale \
|
||||||
*/ \
|
*/ \
|
||||||
sprintf(log_name_file_thrd[parallel_nb],"log_principal_thread_%ld_id_%ld",parallel_nb,pthread_self()); \
|
sprintf(log_name_file_thrd[parallel_nb],"log_principal_thread_%ld_id_%ld",parallel_nb,(size_t)pthread_self()); \
|
||||||
f_ou_th[parallel_nb] = fopen(log_name_file_thrd[parallel_nb], "w+"); \
|
f_ou_th[parallel_nb] = fopen(log_name_file_thrd[parallel_nb], "w+"); \
|
||||||
\
|
\
|
||||||
\
|
\
|
||||||
@@ -3690,7 +3690,7 @@ init_parallel_test_() \
|
|||||||
count_fail_thread = malloc(parallel_nb * sizeof(size_t)); \
|
count_fail_thread = malloc(parallel_nb * sizeof(size_t)); \
|
||||||
id_thread_self = malloc((parallel_nb + 1) * sizeof(size_t)); \
|
id_thread_self = malloc((parallel_nb + 1) * sizeof(size_t)); \
|
||||||
\
|
\
|
||||||
id_thread_self[parallel_nb]= pthread_self();/* main thread */\
|
id_thread_self[parallel_nb]= (size_t)pthread_self();/* main thread */\
|
||||||
\
|
\
|
||||||
for(size_t i=0; i<parallel_nb; ++i){ \
|
for(size_t i=0; i<parallel_nb; ++i){ \
|
||||||
thread_test_failed_l[i] = NULL; \
|
thread_test_failed_l[i] = NULL; \
|
||||||
|
|||||||
Reference in New Issue
Block a user