Commit 7ee306d9 authored by Ghislain MARY's avatar Ghislain MARY

Fix renamings that were not correctly done.

parent 3545fb67
......@@ -22,9 +22,9 @@
#include <bctoolbox/port.h>
#if defined(_MSC_VER)
#define BCTOOLBOX_PUBLIC __declspec(dllexport)
#define BCTBX_PUBLIC __declspec(dllexport)
#else
#define BCTOOLBOX_PUBLIC
#define BCTBX_PUBLIC
#endif
#ifndef TRUE
......@@ -90,45 +90,45 @@ fprintf(stderr, "Missing argument for \"%s\"\n", argument); \
return -1; \
} \
BCTOOLBOX_PUBLIC void bc_tester_init(void (*ftester_printf)(int level, const char *fmt, va_list args)
BCTBX_PUBLIC void bc_tester_init(void (*ftester_printf)(int level, const char *fmt, va_list args)
, int verbosity_info, int verbosity_error, const char* expected_res);
BCTOOLBOX_PUBLIC void bc_tester_helper(const char *name, const char* additionnal_helper);
BCTOOLBOX_PUBLIC int bc_tester_parse_args(int argc, char** argv, int argid);
BCTOOLBOX_PUBLIC int bc_tester_start(const char* prog_name);
BCTOOLBOX_PUBLIC void bc_tester_add_suite(test_suite_t *suite);
BCTOOLBOX_PUBLIC void bc_tester_uninit(void);
BCTOOLBOX_PUBLIC void bc_tester_printf(int level, const char *fmt, ...);
BCTOOLBOX_PUBLIC const char * bc_tester_get_resource_dir_prefix(void);
BCTOOLBOX_PUBLIC void bc_tester_set_resource_dir_prefix(const char *name);
BCTOOLBOX_PUBLIC const char * bc_tester_get_writable_dir_prefix(void);
BCTOOLBOX_PUBLIC void bc_tester_set_writable_dir_prefix(const char *name);
BCTOOLBOX_PUBLIC int bc_tester_nb_suites(void);
BCTOOLBOX_PUBLIC int bc_tester_nb_tests(const char* name);
BCTOOLBOX_PUBLIC void bc_tester_list_suites(void);
BCTOOLBOX_PUBLIC void bc_tester_list_tests(const char *suite_name);
BCTOOLBOX_PUBLIC const char * bc_tester_suite_name(int suite_index);
BCTOOLBOX_PUBLIC const char * bc_tester_test_name(const char *suite_name, int test_index);
BCTOOLBOX_PUBLIC int bc_tester_run_suite(test_suite_t *suite, const char *tag_name);
BCTOOLBOX_PUBLIC int bc_tester_run_tests(const char *suite_name, const char *test_name, const char *tag_name);
BCTOOLBOX_PUBLIC int bc_tester_suite_index(const char *suite_name);
BCTOOLBOX_PUBLIC const char * bc_tester_current_suite_name(void);
BCTOOLBOX_PUBLIC const char * bc_tester_current_test_name(void);
BCTOOLBOX_PUBLIC const char ** bc_tester_current_test_tags(void);
BCTOOLBOX_PUBLIC char* bc_sprintfva(const char* format, va_list args);
BCTOOLBOX_PUBLIC char* bc_sprintf(const char* format, ...);
BCTOOLBOX_PUBLIC void bc_free(void *ptr);
BCTOOLBOX_PUBLIC unsigned int bc_get_number_of_failures(void);
BCTOOLBOX_PUBLIC void bc_set_trace_handler(void(*handler)(int, const char*, va_list));
BCTBX_PUBLIC void bc_tester_helper(const char *name, const char* additionnal_helper);
BCTBX_PUBLIC int bc_tester_parse_args(int argc, char** argv, int argid);
BCTBX_PUBLIC int bc_tester_start(const char* prog_name);
BCTBX_PUBLIC void bc_tester_add_suite(test_suite_t *suite);
BCTBX_PUBLIC void bc_tester_uninit(void);
BCTBX_PUBLIC void bc_tester_printf(int level, const char *fmt, ...);
BCTBX_PUBLIC const char * bc_tester_get_resource_dir_prefix(void);
BCTBX_PUBLIC void bc_tester_set_resource_dir_prefix(const char *name);
BCTBX_PUBLIC const char * bc_tester_get_writable_dir_prefix(void);
BCTBX_PUBLIC void bc_tester_set_writable_dir_prefix(const char *name);
BCTBX_PUBLIC int bc_tester_nb_suites(void);
BCTBX_PUBLIC int bc_tester_nb_tests(const char* name);
BCTBX_PUBLIC void bc_tester_list_suites(void);
BCTBX_PUBLIC void bc_tester_list_tests(const char *suite_name);
BCTBX_PUBLIC const char * bc_tester_suite_name(int suite_index);
BCTBX_PUBLIC const char * bc_tester_test_name(const char *suite_name, int test_index);
BCTBX_PUBLIC int bc_tester_run_suite(test_suite_t *suite, const char *tag_name);
BCTBX_PUBLIC int bc_tester_run_tests(const char *suite_name, const char *test_name, const char *tag_name);
BCTBX_PUBLIC int bc_tester_suite_index(const char *suite_name);
BCTBX_PUBLIC const char * bc_tester_current_suite_name(void);
BCTBX_PUBLIC const char * bc_tester_current_test_name(void);
BCTBX_PUBLIC const char ** bc_tester_current_test_tags(void);
BCTBX_PUBLIC char* bc_sprintfva(const char* format, va_list args);
BCTBX_PUBLIC char* bc_sprintf(const char* format, ...);
BCTBX_PUBLIC void bc_free(void *ptr);
BCTBX_PUBLIC unsigned int bc_get_number_of_failures(void);
BCTBX_PUBLIC void bc_set_trace_handler(void(*handler)(int, const char*, va_list));
/**
* Get full path to the given resource
*
* @param name relative resource path
* @return path to the resource. Must be freed by caller.
*/
BCTOOLBOX_PUBLIC char * bc_tester_res(const char *name);
BCTBX_PUBLIC char * bc_tester_res(const char *name);
/**
* Get full path to the given writable_file
......@@ -136,7 +136,7 @@ BCTOOLBOX_PUBLIC char * bc_tester_res(const char *name);
* @param name relative writable file path
* @return path to the writable file. Must be freed by caller.
*/
BCTOOLBOX_PUBLIC char * bc_tester_file(const char *name);
BCTBX_PUBLIC char * bc_tester_file(const char *name);
/*Redefine the CU_... macros WITHOUT final ';' semicolon, to allow IF conditions and smarter error message */
......@@ -153,7 +153,7 @@ extern int CU_assertImplementation(int bValue,
*
* @return 1 if assert was true, 0 otherwise
*/
BCTOOLBOX_PUBLIC int bc_assert(const char* file, int line, int predicate, const char* format);
BCTBX_PUBLIC int bc_assert(const char* file, int line, int predicate, const char* format);
#define _BC_ASSERT_PRED(name, pred, actual, expected, type, ...) \
do { \
......
......@@ -187,9 +187,9 @@ int __bctbx_thread_create(bctbx_thread_t *thread, pthread_attr_t *attr, void * (
pthread_attr_init(&my_attr);
if (attr)
my_attr = *attr;
#ifdef BCTOOLBOX_DEFAULT_THREAD_STACK_SIZE
if (BCTOOLBOX_DEFAULT_THREAD_STACK_SIZE!=0)
pthread_attr_setstacksize(&my_attr, BCTOOLBOX_DEFAULT_THREAD_STACK_SIZE);
#ifdef BCTBX_DEFAULT_THREAD_STACK_SIZE
if (BCTBX_DEFAULT_THREAD_STACK_SIZE!=0)
pthread_attr_setstacksize(&my_attr, BCTBX_DEFAULT_THREAD_STACK_SIZE);
#endif
return pthread_create(thread, &my_attr, routine, arg);
}
......@@ -203,7 +203,7 @@ unsigned long __bctbx_thread_self(void) {
int __bctbx_WIN_mutex_init(bctbx_mutex_t *mutex, void *attr)
{
#ifdef BCTOOLBOX_WINDOWS_DESKTOP
#ifdef BCTBX_WINDOWS_DESKTOP
*mutex=CreateMutex(NULL, FALSE, NULL);
#else
InitializeSRWLock(mutex);
......@@ -213,7 +213,7 @@ int __bctbx_WIN_mutex_init(bctbx_mutex_t *mutex, void *attr)
int __bctbx_WIN_mutex_lock(bctbx_mutex_t * hMutex)
{
#ifdef BCTOOLBOX_WINDOWS_DESKTOP
#ifdef BCTBX_WINDOWS_DESKTOP
WaitForSingleObject(*hMutex, INFINITE); /* == WAIT_TIMEOUT; */
#else
AcquireSRWLockExclusive(hMutex);
......@@ -223,7 +223,7 @@ int __bctbx_WIN_mutex_lock(bctbx_mutex_t * hMutex)
int __bctbx_WIN_mutex_unlock(bctbx_mutex_t * hMutex)
{
#ifdef BCTOOLBOX_WINDOWS_DESKTOP
#ifdef BCTBX_WINDOWS_DESKTOP
ReleaseMutex(*hMutex);
#else
ReleaseSRWLockExclusive(hMutex);
......@@ -233,7 +233,7 @@ int __bctbx_WIN_mutex_unlock(bctbx_mutex_t * hMutex)
int __bctbx_WIN_mutex_destroy(bctbx_mutex_t * hMutex)
{
#ifdef BCTOOLBOX_WINDOWS_DESKTOP
#ifdef BCTBX_WINDOWS_DESKTOP
CloseHandle(*hMutex);
#endif
return 0;
......@@ -281,7 +281,7 @@ unsigned long __bctbx_WIN_thread_self(void) {
int __bctbx_WIN_cond_init(bctbx_cond_t *cond, void *attr)
{
#ifdef BCTOOLBOX_WINDOWS_DESKTOP
#ifdef BCTBX_WINDOWS_DESKTOP
*cond=CreateEvent(NULL, FALSE, FALSE, NULL);
#else
InitializeConditionVariable(cond);
......@@ -291,7 +291,7 @@ int __bctbx_WIN_cond_init(bctbx_cond_t *cond, void *attr)
int __bctbx_WIN_cond_wait(bctbx_cond_t* hCond, bctbx_mutex_t * hMutex)
{
#ifdef BCTOOLBOX_WINDOWS_DESKTOP
#ifdef BCTBX_WINDOWS_DESKTOP
//gulp: this is not very atomic ! bug here ?
__bctbx_WIN_mutex_unlock(hMutex);
WaitForSingleObject(*hCond, INFINITE);
......@@ -304,7 +304,7 @@ int __bctbx_WIN_cond_wait(bctbx_cond_t* hCond, bctbx_mutex_t * hMutex)
int __bctbx_WIN_cond_signal(bctbx_cond_t * hCond)
{
#ifdef BCTOOLBOX_WINDOWS_DESKTOP
#ifdef BCTBX_WINDOWS_DESKTOP
SetEvent(*hCond);
#else
WakeConditionVariable(hCond);
......@@ -320,7 +320,7 @@ int __bctbx_WIN_cond_broadcast(bctbx_cond_t * hCond)
int __bctbx_WIN_cond_destroy(bctbx_cond_t * hCond)
{
#ifdef BCTOOLBOX_WINDOWS_DESKTOP
#ifdef BCTBX_WINDOWS_DESKTOP
CloseHandle(*hCond);
#endif
return 0;
......@@ -526,7 +526,7 @@ static HANDLE event=NULL;
/* portable named pipes */
bctbx_pipe_t bctbx_server_pipe_create(const char *name){
#ifdef BCTOOLBOX_WINDOWS_DESKTOP
#ifdef BCTBX_WINDOWS_DESKTOP
bctbx_pipe_t h;
char *pipename=make_pipe_name(name);
h=CreateNamedPipe(pipename,PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED,PIPE_TYPE_MESSAGE|PIPE_WAIT,1,
......@@ -549,7 +549,7 @@ even if nobody connects to the pipe.
bctbx_server_pipe_close() makes this function to exit.
*/
bctbx_pipe_t bctbx_server_pipe_accept_client(bctbx_pipe_t server){
#ifdef BCTOOLBOX_WINDOWS_DESKTOP
#ifdef BCTBX_WINDOWS_DESKTOP
OVERLAPPED ol;
DWORD undef;
HANDLE handles[2];
......@@ -572,7 +572,7 @@ bctbx_pipe_t bctbx_server_pipe_accept_client(bctbx_pipe_t server){
}
int bctbx_server_pipe_close_client(bctbx_pipe_t server){
#ifdef BCTOOLBOX_WINDOWS_DESKTOP
#ifdef BCTBX_WINDOWS_DESKTOP
return DisconnectNamedPipe(server)==TRUE ? 0 : -1;
#else
bctbx_error("%s not supported!", __FUNCTION__);
......@@ -581,7 +581,7 @@ int bctbx_server_pipe_close_client(bctbx_pipe_t server){
}
int bctbx_server_pipe_close(bctbx_pipe_t spipe){
#ifdef BCTOOLBOX_WINDOWS_DESKTOP
#ifdef BCTBX_WINDOWS_DESKTOP
SetEvent(event);
//CancelIoEx(spipe,NULL); /*vista only*/
return CloseHandle(spipe);
......@@ -592,7 +592,7 @@ int bctbx_server_pipe_close(bctbx_pipe_t spipe){
}
bctbx_pipe_t bctbx_client_pipe_connect(const char *name){
#ifdef BCTOOLBOX_WINDOWS_DESKTOP
#ifdef BCTBX_WINDOWS_DESKTOP
char *pipename=make_pipe_name(name);
bctbx_pipe_t hpipe = CreateFile(
pipename, // pipe name
......@@ -641,7 +641,7 @@ typedef struct MapInfo{
static bctbx_list_t *maplist=NULL;
void *bctbx_shm_open(unsigned int keyid, int size, int create){
#ifdef BCTOOLBOX_WINDOWS_DESKTOP
#ifdef BCTBX_WINDOWS_DESKTOP
HANDLE h;
char name[64];
void *buf;
......@@ -687,7 +687,7 @@ void *bctbx_shm_open(unsigned int keyid, int size, int create){
}
void bctbx_shm_close(void *mem){
#ifdef BCTOOLBOX_WINDOWS_DESKTOP
#ifdef BCTBX_WINDOWS_DESKTOP
bctbx_list_t *elem;
for(elem=maplist;elem;elem=bctbx_list_next(elem)){
MapInfo *i=(MapInfo*)bctbx_list_get_data(elem);
......@@ -716,7 +716,7 @@ void bctbx_shm_close(void *mem){
void _bctbx_get_cur_time(bctoolboxTimeSpec *ret, bool_t realtime){
#if defined(_WIN32_WCE) || defined(WIN32)
#ifdef BCTOOLBOX_WINDOWS_DESKTOP
#ifdef BCTBX_WINDOWS_DESKTOP
DWORD timemillis;
# if defined(_WIN32_WCE)
timemillis=GetTickCount();
......@@ -764,7 +764,7 @@ uint64_t bctbx_get_cur_time_ms(void) {
void bctbx_sleep_ms(int ms){
#ifdef _WIN32
#ifdef BCTOOLBOX_WINDOWS_DESKTOP
#ifdef BCTBX_WINDOWS_DESKTOP
Sleep(ms);
#else
HANDLE sleepEvent = CreateEventEx(NULL, NULL, CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS);
......
......@@ -68,7 +68,7 @@ int bctoolbox_tester_set_log_file(const char *filename) {
}
#if !defined(ANDROID) && !defined(TARGET_OS_IPHONE) && !(defined(BCTOOLBOX_WINDOWS_PHONE) || defined(BCTOOLBOX_WINDOWS_UNIVERSAL))
#if !defined(ANDROID) && !defined(TARGET_OS_IPHONE) && !(defined(BCTBX_WINDOWS_PHONE) || defined(BCTBX_WINDOWS_UNIVERSAL))
static const char* bctoolbox_helper =
"\t\t\t--verbose\n"
......
......@@ -18,15 +18,16 @@
#ifndef _BCTOOLBOX_TESTER_H
#define _BCTOOLBOX_TESTER_H
#include "bctoolbox/logging.h"
#include "bctoolbox/tester.h"
#ifdef __cplusplus
#define SLOGD BCTOOLBOX_SLOGD("bctoolbox-tester")
#define SLOGI BCTOOLBOX_SLOGI("bctoolbox-tester")
#define SLOGW BCTOOLBOX_SLOGW("bctoolbox-tester")
#define SLOGE BCTOOLBOX_SLOGE("bctoolbox-tester")
#define SLOGD BCTBX_SLOGD("bctoolbox-tester")
#define SLOGI BCTBX_SLOGI("bctoolbox-tester")
#define SLOGW BCTBX_SLOGW("bctoolbox-tester")
#define SLOGE BCTBX_SLOGE("bctoolbox-tester")
extern "C" {
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment