GrafX2 2.9.3227
The ultimate 256-color painting program
testmain.c File Reference

Unit tests. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <time.h>
#include <errno.h>
#include <sys/time.h>
#include "../struct.h"
#include "../global.h"
#include "../io.h"
#include "../gfx2log.h"
#include "tests.h"
#include "testlist.h"
+ Include dependency graph for testmain.c:

Macros

#define TEST(func)   { Test_ ## func, # func },
 
#define TEST_COUNT   (sizeof(tests) / sizeof(tests[0]))
 
#define ESC_GREEN   "\033[32m"
 
#define ESC_RED   "\033[31m"
 
#define ESC_RESET   "\033[0m"
 

Functions

int init (void)
 Initializations for test program. More...
 
void finish (void)
 Releases resources. More...
 
int main (int argc, char **argv)
 Test program entry point. More...
 

Variables

signed char File_error
 
T_Config Config
 
T_Document Main
 
T_Document Spare
 
byteScreen_backup
 
byteMain_Screen
 
short Screen_width
 
short Screen_height
 
short Original_screen_X
 
short Original_screen_Y
 
byte Menu_factor_X
 
byte Menu_factor_Y
 
int Pixel_ratio
 
byte First_color_in_palette
 
byte Back_color
 
byte MC_Dark
 
byte MC_Light
 
T_Window Window_stack [8]
 
byte Windows_open
 
dword Key
 
char tmpdir [256]
 path to directory where tests can write files More...
 
struct {
   int(*   test_func )(char *errmsg)
 
   const char *   test_name
 
tests []
 

Detailed Description

Unit tests.

Macro Definition Documentation

◆ TEST

#define TEST (   func)    { Test_ ## func, # func },

◆ TEST_COUNT

#define TEST_COUNT   (sizeof(tests) / sizeof(tests[0]))

◆ ESC_GREEN

#define ESC_GREEN   "\033[32m"

◆ ESC_RED

#define ESC_RED   "\033[31m"

◆ ESC_RESET

#define ESC_RESET   "\033[0m"

Function Documentation

◆ init()

int init ( void  )

Initializations for test program.

References NULL, PATH_SEPARATOR, and tmpdir.

Referenced by main().

◆ finish()

void finish ( void  )

Releases resources.

References tmpdir.

Referenced by main().

◆ main()

int main ( int  argc,
char **  argv 
)

Variable Documentation

◆ File_error

signed char File_error

◆ Config

T_Config Config

◆ Main

T_Document Main

◆ Spare

T_Document Spare

◆ Screen_backup

byte* Screen_backup

◆ Main_Screen

byte* Main_Screen

◆ Screen_width

short Screen_width

◆ Screen_height

short Screen_height

◆ Original_screen_X

short Original_screen_X

◆ Original_screen_Y

short Original_screen_Y

◆ Menu_factor_X

byte Menu_factor_X

◆ Menu_factor_Y

byte Menu_factor_Y

◆ Pixel_ratio

int Pixel_ratio

◆ First_color_in_palette

byte First_color_in_palette

◆ Back_color

byte Back_color

◆ MC_Dark

byte MC_Dark

◆ MC_Light

byte MC_Light

◆ Window_stack

T_Window Window_stack[8]

◆ Windows_open

byte Windows_open

◆ Key

dword Key

◆ tmpdir

◆ test_func

int(* test_func) (char *errmsg) ( char *  errmsg)

◆ test_name

const char* test_name

Referenced by main().

◆ 

const struct { ... } tests[]
Initial value:
= {
#define TEST(func)
}

Referenced by main(), Test_MOTO_MAP_pack(), and Test_Packbits().