|
cbase 1.46.11
C/C++ Static Template
|
A lightweight, dependency-free unit testing harness. More...
#include <stdio.h>#include <stdlib.h>

Go to the source code of this file.
Macros | |
| #define | EXPECT(cond) |
| Evaluates a condition. If it fails, prints the file/line and increments the fail count. | |
| #define | EXPECT_STR8_EQ(a, b) |
| Helper to test if two String8 objects match exactly. | |
| #define | TEST_CASE(name) |
| Defines a test case function. | |
| #define | RUN_TEST(name) |
| Runs a test case and prints its execution status. | |
Variables | |
| static int | tests_run = 0 |
| Global counter tracking the total number of tests executed. | |
| static int | tests_failed = 0 |
| Global counter tracking the total number of tests that failed. | |
A lightweight, dependency-free unit testing harness.
Definition in file test_harness.h.
| #define EXPECT | ( | cond | ) |
Evaluates a condition. If it fails, prints the file/line and increments the fail count.
Definition at line 18 of file test_harness.h.
| #define EXPECT_STR8_EQ | ( | a, | |
| b ) |
Helper to test if two String8 objects match exactly.
Definition at line 27 of file test_harness.h.
| #define RUN_TEST | ( | name | ) |
Runs a test case and prints its execution status.
Definition at line 33 of file test_harness.h.
| #define TEST_CASE | ( | name | ) |
Defines a test case function.
Definition at line 30 of file test_harness.h.
|
static |
Global counter tracking the total number of tests that failed.
Definition at line 14 of file test_harness.h.
|
static |
Global counter tracking the total number of tests executed.
Definition at line 12 of file test_harness.h.