sugawaray / nomagic

Unit test library for C/C++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

* ABOUT THIS LIBRARY

This library is an unit test library for C/C++.

* API

void testrun(const char *message, void (*f)());

It calls 'f'.
It outputs messages when it executes 'f'. "[messages]"s are replaced by the
parameter 'message' in examples below.

- if 'f' does not call the testerror function, it outputs
	"PASS: [message]"
- if 'f' calls the testerror function, it outputs
	"FAIL: [message]"
	"DETAIL: [detail]"
	"DETAIL: [detail]"
  "[detail]"s are replaced by the parameter 'message' of testerror calls.


void testerror(const char *message);

It has the effect described in the testrun explanation if it is called in
test functions.


const char *testmsg(const char *format, ...);

It generates a message like the sprintf function. The difference is
that it manages several buffers and callers do not need to prepare buffers.


const char *testmem(const char *mem, int sz);

It generates a message which shows the content of the memory specified by
'mem' and 'sz.

About

Unit test library for C/C++

License:MIT License


Languages

Language:C 93.1%Language:Makefile 6.9%