mirror of
https://github.com/thepigeongenerator/mcaselector-lite.git
synced 2025-12-17 03:25:45 +01:00
apply new formatting rules to the whole project
This commit is contained in:
@@ -19,7 +19,7 @@ struct test_getpat_envdat {
|
||||
|
||||
/* save the current environment variables */
|
||||
static void env_save(struct test_getpat_envdat *s) {
|
||||
char const *tmp;
|
||||
const char *tmp;
|
||||
|
||||
tmp = getenv("XDG_CONFIG_HOME");
|
||||
s->xdg_config_home = tmp ? strdup(tmp) : NULL;
|
||||
@@ -64,9 +64,9 @@ static void env_restore(struct test_getpat_envdat *s) {
|
||||
|
||||
/* check procbuf's functionality */
|
||||
struct test_procbuf {
|
||||
char const *in; // data in
|
||||
char const *xkey; // expected key
|
||||
char const *xval; // expected value
|
||||
const char *in; // data in
|
||||
const char *xkey; // expected key
|
||||
const char *xval; // expected value
|
||||
int xret; // expected return type
|
||||
};
|
||||
int test_procbuf(void *arg) {
|
||||
@@ -81,7 +81,7 @@ int test_procbuf(void *arg) {
|
||||
|
||||
/* check matchopt functionality */
|
||||
struct test_matchopt {
|
||||
char const *key; // key to search for (key1, key2, key3)
|
||||
const char *key; // key to search for (key1, key2, key3)
|
||||
int xidx; // expect index (<0 is NULL, may not be more than 2)
|
||||
};
|
||||
int test_matchopt(void *arg) {
|
||||
@@ -96,7 +96,7 @@ int test_matchopt(void *arg) {
|
||||
}
|
||||
|
||||
struct test_procval_int {
|
||||
char const *val;
|
||||
const char *val;
|
||||
u64 xres;
|
||||
u8 type;
|
||||
};
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
#pragma once
|
||||
#include <stdio.h>
|
||||
|
||||
char const *test_ctest;
|
||||
const char *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, const char *restrict fname, unsigned ln, const char *restrict fnname, const char *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,7 +22,7 @@ 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
|
||||
const char *name; // test name
|
||||
int (*test)(void *); // test, returns 0 upon success, non-zero upon failure
|
||||
void *args; // arguments to the test
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user