2022-03-23 05:26:25 +00:00
|
|
|
#ifndef test_h
|
|
|
|
#define test_h
|
|
|
|
/* test.h - unit testing definitions. */
|
|
|
|
|
2022-03-25 05:45:55 +00:00
|
|
|
#include "lib/defs.h"
|
2022-03-23 05:26:25 +00:00
|
|
|
|
2022-03-30 07:46:19 +00:00
|
|
|
/* The number of test failures. */
|
|
|
|
extern int gFailCount;
|
2022-03-23 05:26:25 +00:00
|
|
|
|
2022-03-30 07:46:19 +00:00
|
|
|
/* Set the name of the current test. */
|
|
|
|
void SetTestName(const char *name);
|
|
|
|
|
|
|
|
/* Set the name of the current test. */
|
|
|
|
void SetTestNamef(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
|
|
|
|
|
|
|
|
/* Fail the current test. */
|
|
|
|
void Failf(const char *msg, ...) __attribute__((format(printf, 1, 2)));
|
|
|
|
|
|
|
|
/* Return the description of an error code. Fatal error if the error code is
|
|
|
|
invalid. */
|
|
|
|
const char *ErrorDescriptionOrDie(ErrorCode err);
|
|
|
|
|
|
|
|
/* Print information about completed tests and return the status code. */
|
|
|
|
int TestsDone(void );
|
2022-03-23 05:26:25 +00:00
|
|
|
|
|
|
|
#endif
|