mirror of
https://github.com/thepigeongenerator/mcaselector-lite.git
synced 2025-12-16 23:35:46 +01:00
apply new formatting rules
This commit is contained in:
12
test/test.h
12
test/test.h
@@ -3,12 +3,12 @@
|
||||
#pragma once
|
||||
#include <stdio.h>
|
||||
|
||||
char const* test_ctest;
|
||||
char const *test_ctest;
|
||||
size_t test_runs = 0;
|
||||
|
||||
// evaluates the test
|
||||
// returns 1 upon error
|
||||
static inline int assert_helper(int cond, char const* restrict fname, unsigned ln, char const* restrict fnname, char const* restrict expr) {
|
||||
static inline int assert_helper(int cond, char const *restrict fname, unsigned ln, char const *restrict fnname, char const *restrict expr) {
|
||||
test_runs++;
|
||||
if (cond)
|
||||
printf("[\033[32;1m OK \033[0m] %s %s -> %s:%u (%s)\n", test_ctest, fnname, fname, ln, expr);
|
||||
@@ -22,14 +22,14 @@ static inline int assert_helper(int cond, char const* restrict fname, unsigned l
|
||||
|
||||
// contains the data for executing a single test
|
||||
struct testdat {
|
||||
char const* name; // test name
|
||||
int (*test)(void*); // test, returns 0 upon success, non-zero upon failure
|
||||
void* args; // arguments to the test
|
||||
char const *name; // test name
|
||||
int (*test)(void *); // test, returns 0 upon success, non-zero upon failure
|
||||
void *args; // arguments to the test
|
||||
};
|
||||
typedef struct testdat testdat;
|
||||
|
||||
// executes the tests, returns the amount of failed tests; >0: failure
|
||||
static inline size_t exec_tests(testdat* dat, size_t ntests) {
|
||||
static inline size_t exec_tests(testdat *dat, size_t ntests) {
|
||||
size_t i;
|
||||
size_t err = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user