Classes | Macros | Functions | Variables
thread.c File Reference
#include "Thread.h"
#include <string.h>
#include <stdlib.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <unistd.h>
#include <errno.h>
#include <stdarg.h>
#include <time.h>
#include <sys/timeb.h>
Include dependency graph for thread.c:

Go to the source code of this file.

Classes

struct  Options
 

Macros

#define ARRAY_SIZE(a)   (sizeof(a) / sizeof(a[0]))
 
#define assert(a, b, c, d)   myassert(__FILE__, __LINE__, a, b, c, d)
 
#define assert1(a, b, c, d, e)   myassert(__FILE__, __LINE__, a, b, c, d, e)
 
#define LOGA_DEBUG   0
 
#define LOGA_INFO   1
 
#define mysleep   sleep
 
#define START_TIME_TYPE   struct timeval
 
#define WINAPI
 

Functions

thread_return_type cond_secondary (void *n)
 
long elapsed (START_TIME_TYPE start_time)
 
void getopts (int argc, char **argv)
 
int main (int argc, char **argv)
 
static thread_return_type WINAPI mutex_secondary (void *n)
 
void myassert (char *filename, int lineno, char *description, int value, char *format,...)
 
void MyLog (int LOGA_level, char *format,...)
 
static thread_return_type WINAPI sem_secondary (void *n)
 
START_TIME_TYPE start_clock (void)
 
int test_cond (struct Options options)
 
int test_mutex (struct Options options)
 
int test_sem (struct Options options)
 
void usage (void)
 
void write_test_result (void)
 

Variables

char * cur_output = output
 
int failures = 0
 
START_TIME_TYPE global_start_time
 
struct Options options
 
char output [3000]
 
int tests = 0
 
FILE * xml
 

Detailed Description

Unit tests for threading

Definition in file thread.c.

Macro Definition Documentation

#define ARRAY_SIZE (   a)    (sizeof(a) / sizeof(a[0]))

Definition at line 38 of file thread.c.

#define assert (   a,
  b,
  c,
  d 
)    myassert(__FILE__, __LINE__, a, b, c, d)

Definition at line 183 of file thread.c.

#define assert1 (   a,
  b,
  c,
  d,
 
)    myassert(__FILE__, __LINE__, a, b, c, d, e)

Definition at line 184 of file thread.c.

#define LOGA_DEBUG   0

Definition at line 84 of file thread.c.

#define LOGA_INFO   1

Definition at line 85 of file thread.c.

#define mysleep   sleep

Definition at line 145 of file thread.c.

#define START_TIME_TYPE   struct timeval

Definition at line 146 of file thread.c.

#define WINAPI

Definition at line 33 of file thread.c.

Function Documentation

thread_return_type cond_secondary ( void *  n)

Definition at line 328 of file thread.c.

long elapsed ( START_TIME_TYPE  start_time)

Definition at line 173 of file thread.c.

void getopts ( int  argc,
char **  argv 
)

Definition at line 58 of file thread.c.

int main ( int  argc,
char **  argv 
)

Definition at line 494 of file thread.c.

static thread_return_type WINAPI mutex_secondary ( void *  n)
static

Definition at line 424 of file thread.c.

void myassert ( char *  filename,
int  lineno,
char *  description,
int  value,
char *  format,
  ... 
)

Definition at line 206 of file thread.c.

void MyLog ( int  LOGA_level,
char *  format,
  ... 
)

Definition at line 89 of file thread.c.

static thread_return_type WINAPI sem_secondary ( void *  n)
static

Definition at line 229 of file thread.c.

START_TIME_TYPE start_clock ( void  )

Definition at line 148 of file thread.c.

int test_cond ( struct Options  options)

Definition at line 356 of file thread.c.

int test_mutex ( struct Options  options)

Definition at line 446 of file thread.c.

int test_sem ( struct Options  options)

Definition at line 254 of file thread.c.

void usage ( void  )

Definition at line 40 of file thread.c.

void write_test_result ( void  )

Definition at line 193 of file thread.c.

Variable Documentation

char* cur_output = output

Definition at line 191 of file thread.c.

int failures = 0

Definition at line 187 of file thread.c.

START_TIME_TYPE global_start_time

Definition at line 189 of file thread.c.

struct Options options
Initial value:
=
{
0,
-1,
1,
}
char output[3000]

Definition at line 190 of file thread.c.

int tests = 0

Definition at line 186 of file thread.c.

FILE* xml

Definition at line 188 of file thread.c.



plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 04:02:49