diff options
| author | dundargoc <gocdundar@gmail.com> | 2024-12-21 13:03:17 +0100 |
|---|---|---|
| committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2024-12-21 16:01:58 +0100 |
| commit | fd05c7f19d942edce39a2c99b5c064b71e66bc31 (patch) | |
| tree | 65238ad1db3754b70d17f25ce0387fe91904adef /test/functional | |
| parent | 130b5fd85f074ac5e40cb4b07c6c9dc6f91512bd (diff) | |
| download | rneovim-fd05c7f19d942edce39a2c99b5c064b71e66bc31.tar.gz rneovim-fd05c7f19d942edce39a2c99b5c064b71e66bc31.tar.bz2 rneovim-fd05c7f19d942edce39a2c99b5c064b71e66bc31.zip | |
test: format C test files and fix clang-tidy warnings
It's probably not worth adding the C test files to regular formatting as
they're pretty much never touched, but ensuring the files are formatted
according to our standards and getting rid of warnings is a cheap
one-time fix.
Diffstat (limited to 'test/functional')
| -rw-r--r-- | test/functional/fixtures/printargs-test.c | 2 | ||||
| -rw-r--r-- | test/functional/fixtures/shell-test.c | 17 | ||||
| -rw-r--r-- | test/functional/fixtures/streams-test.c | 3 |
3 files changed, 11 insertions, 11 deletions
diff --git a/test/functional/fixtures/printargs-test.c b/test/functional/fixtures/printargs-test.c index 2c25cf8447..a1d3fdf76e 100644 --- a/test/functional/fixtures/printargs-test.c +++ b/test/functional/fixtures/printargs-test.c @@ -2,7 +2,7 @@ int main(int argc, char **argv) { - for (int i=1; i<argc; i++) { + for (int i = 1; i < argc; i++) { printf("arg%d=%s;", i, argv[i]); } return 0; diff --git a/test/functional/fixtures/shell-test.c b/test/functional/fixtures/shell-test.c index bd71e7d11b..f3e94a28da 100644 --- a/test/functional/fixtures/shell-test.c +++ b/test/functional/fixtures/shell-test.c @@ -1,11 +1,12 @@ +#include <stdbool.h> +#include <stdint.h> #include <stdio.h> #include <string.h> -#include <stdint.h> #ifdef _MSC_VER -#include <Windows.h> -#define usleep(usecs) Sleep(usecs/1000) +# include <Windows.h> +# define usleep(usecs) Sleep(usecs/1000) #else -#include <unistd.h> +# include <unistd.h> #endif static void flush_wait(void) @@ -56,7 +57,7 @@ int main(int argc, char **argv) if (argc >= 2) { if (strcmp(argv[1], "-t") == 0) { if (argc < 3) { - fprintf(stderr,"Missing prompt text for -t option\n"); + fprintf(stderr, "Missing prompt text for -t option\n"); return 5; } else { fprintf(stderr, "%s $ ", argv[2]); @@ -107,18 +108,18 @@ int main(int argc, char **argv) char cmd[100]; int arg; - while (1) { + while (true) { fprintf(stderr, "interact $ "); if (fgets(input, sizeof(input), stdin) == NULL) { break; // EOF } - if(1 == sscanf(input, "%99s %d", cmd, &arg)) { + if (1 == sscanf(input, "%99s %d", cmd, &arg)) { arg = 0; } if (strcmp(cmd, "exit") == 0) { - return arg; + return arg; } else { fprintf(stderr, "command not found: %s\n", cmd); } diff --git a/test/functional/fixtures/streams-test.c b/test/functional/fixtures/streams-test.c index 5a59abb33b..68e668d5fa 100644 --- a/test/functional/fixtures/streams-test.c +++ b/test/functional/fixtures/streams-test.c @@ -1,6 +1,5 @@ /// Helper program to exit and keep stdout open (like "xclip -i -loops 1"). #include <stdio.h> - #include <uv.h> int main(int argc, char **argv) @@ -8,7 +7,7 @@ int main(int argc, char **argv) uv_loop_t *loop = uv_default_loop(); uv_process_t child_req; - char * args[3]; + char *args[3]; args[0] = "sleep"; args[1] = "10"; args[2] = NULL; |