diff options
author | Oskar <> | 2024-03-22 20:42:39 +0100 |
---|---|---|
committer | Oskar <> | 2024-03-22 20:42:39 +0100 |
commit | 3e4dfc0b86977481bf39a0b95a15f8335ff496c1 (patch) | |
tree | ee7500a8eb60c10a65b228e4da0d54f012c6b903 /test | |
parent | 47398354c28a5eb1d9e0fa11b4f08bdd48991e9e (diff) |
vimmn prepared forgot to make a branch :(
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile | 2 | ||||
-rw-r--r-- | test/validate_imm_numbers.c | 36 |
2 files changed, 38 insertions, 0 deletions
diff --git a/test/Makefile b/test/Makefile index 0e0e3c4..fba635a 100644 --- a/test/Makefile +++ b/test/Makefile @@ -30,3 +30,5 @@ alltests: echo "CC ---> vcimm" $(CC) $(CFLAGS_ALLTESTS) validate_plus_continue_tests.c ../i_validation.c -o vpct echo "CC ---> vpct" + $(CC) $(CFLAGS_ALLTESTS) validate_imm_numbers.c ../i_validation.c -o vimmn + echo "CC ---> vimmn" diff --git a/test/validate_imm_numbers.c b/test/validate_imm_numbers.c new file mode 100644 index 0000000..35e0e32 --- /dev/null +++ b/test/validate_imm_numbers.c @@ -0,0 +1,36 @@ +#include <stdlib.h> +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <errno.h> +#include "../7ed.h" +#include "../i_validation.h" +#include "../input.h" +#include <stdint.h> + +// Test for validate_check_imm + +int main () { + uint64_t focus = 1; + char smode_buf[SMODE_MAX_SIZE]; // Smode buffer + fprintf(stdout, "(%lu): ", focus); // UI + fgets(smode_buf, SMODE_MAX_SIZE, stdin); // Read user input + + int ret = validate_imm_numbers(smode_buf); + + if (ret == _IMM_NUMBER) { + printf("imm number\n"); + } + if(ret == _INVALID) { + printf("?\n"); + } + if(ret == _VALID) { + printf("valid\n"); + } + if(ret == _NA) { + printf("_NA\n"); + } + + return 0; + +}
\ No newline at end of file |