aboutsummaryrefslogtreecommitdiff
path: root/src/tests-lib.c
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-08-27 22:44:19 -0300
committerEuAndreh <eu@euandre.org>2021-08-27 22:44:19 -0300
commitede12d99fc46ca3fd638d8b47f498497ef28b3df (patch)
tree0cd627ace07e3917924ad675cd19946ff4c1f5b3 /src/tests-lib.c
parentTODOs.md: Add comments to the body of #task-a6bdaeb0-7099-c728-2b7c-b080aa2fba33 (diff)
downloadgistatic-ede12d99fc46ca3fd638d8b47f498497ef28b3df.tar.gz
gistatic-ede12d99fc46ca3fd638d8b47f498497ef28b3df.tar.xz
src/*.c: Add newline between function return type and its name
The purpose of this change is two-fold: - make function and variable declarations grep-friendly (one can use a pattern /^fn_name/ to find the definition); - make the lines shorter, so less functions need to have their arguments span over many lines. This is more grep-friendly both for finding the function definition, but also for matching on the return type of the function or the variable. Update tests/c-lint.sh to enforce this.
Diffstat (limited to 'src/tests-lib.c')
-rw-r--r--src/tests-lib.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/tests-lib.c b/src/tests-lib.c
index 21e6a8f..a9d229a 100644
--- a/src/tests-lib.c
+++ b/src/tests-lib.c
@@ -7,11 +7,13 @@
#define COLOUR_GREEN "\033[0;32m"
#define COLOUR_YELLOW "\033[0;33m"
-void test_start(const char *const name) {
+void
+test_start(const char *const name) {
assert(fprintf(stderr, "%s():\n", name) > 0);
}
-void testing(const char *const message) {
+void
+testing(const char *const message) {
assert(
fprintf(
stderr,
@@ -21,6 +23,7 @@ void testing(const char *const message) {
);
}
-void test_ok(void) {
+void
+test_ok(void) {
assert(fprintf(stderr, " " COLOUR_GREEN "OK" COLOUR_RESET ".\n") > 0);
}