#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "log.h"
Go to the source code of this file.
Defines |
#define | TRUE 1 |
#define | FALSE 0 |
#define | ERR_DUMMY 3 |
#define | ERR_DUMMY_1 0 |
#define | ERR_DUMMY_2 1 |
#define | TestFormat(format, args...) |
#define | TestGaneshaFormat(expect, compare, format, args...) |
#define | NB_THREADS 20 |
Functions |
void | TestAlways (int expect, char *buff, log_components_t component, char *string) |
void | TestMajor (int expect, char *buff, log_components_t component, char *string) |
void | TestCrit (int expect, char *buff, log_components_t component, char *string) |
void | TestEvent (int expect, char *buff, log_components_t component, char *string) |
void | TestDebug (int expect, char *buff, log_components_t component, char *string) |
void | TestFullDebug (int expect, char *buff, log_components_t component, char *string) |
void | Test1 (char *str, char *file) |
void | Test2 () |
void | run_Tests (int all, char *arg, char *str, char *file) |
void * | run_MT_Tests (void *arg) |
int | main (int argc, char *argv[]) |
Define Documentation
#define TestFormat |
( |
|
format, |
|
|
|
args... |
|
) |
| |
Value:do { \
char compare[2048], buff[2048]; \
sprintf(compare, format, ## args); \
log_snprintf(buff, 2048, format, ## args); \
if (strcmp(compare, buff) != 0) \
{ \
LogTest("FAILURE: %s produced \"%s\" expected \"%s\"", \
format, buff, compare); \
exit(1); \
} \
else \
LogTest("SUCCESS: %s produced \"%s\"", format, buff); \
} while (0)
Definition at line 163 of file test_liblog_functions.c.
#define TestGaneshaFormat |
( |
|
expect, |
|
|
|
compare, |
|
|
|
format, |
|
|
|
args... |
|
) |
| |
Value:do { \
char buff[2048]; \
log_snprintf(buff, 2048, format, ## args); \
if (strcmp(compare, buff) != 0 && expect) \
{ \
LogTest("FAILURE: %s produced \"%s\" expected \"%s\"", \
format, buff, compare); \
exit(1); \
} \
else if (expect) \
LogTest("SUCCESS: %s produced \"%s\"", format, buff); \
else \
LogTest("FAILURE (EXPECTED): %s produced \"%s\"", format, buff); \
} while (0)
Definition at line 178 of file test_liblog_functions.c.
Function Documentation
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
void* run_MT_Tests |
( |
void * |
arg | ) |
|
void run_Tests |
( |
int |
all, |
|
|
char * |
arg, |
|
|
char * |
str, |
|
|
char * |
file |
|
) |
| |
void Test1 |
( |
char * |
str, |
|
|
char * |
file |
|
) |
| |
void TestAlways |
( |
int |
expect, |
|
|
char * |
buff, |
|
|
log_components_t |
component, |
|
|
char * |
string |
|
) |
| |
void TestCrit |
( |
int |
expect, |
|
|
char * |
buff, |
|
|
log_components_t |
component, |
|
|
char * |
string |
|
) |
| |
void TestDebug |
( |
int |
expect, |
|
|
char * |
buff, |
|
|
log_components_t |
component, |
|
|
char * |
string |
|
) |
| |
void TestEvent |
( |
int |
expect, |
|
|
char * |
buff, |
|
|
log_components_t |
component, |
|
|
char * |
string |
|
) |
| |
void TestFullDebug |
( |
int |
expect, |
|
|
char * |
buff, |
|
|
log_components_t |
component, |
|
|
char * |
string |
|
) |
| |
void TestMajor |
( |
int |
expect, |
|
|
char * |
buff, |
|
|
log_components_t |
component, |
|
|
char * |
string |
|
) |
| |