From 6104c0ee7257ae99e5187f56593442ca9f04084b Mon Sep 17 00:00:00 2001 From: Oskar Date: Sun, 31 Mar 2024 21:30:11 +0200 Subject: Started integrating the input system. Mainly trying to integrate the 'singles' so far because they will be the easiest. --- test/Makefile | 17 +------------ test/oldtests/validate_check_imm.c | 36 +++++++++++++++++++++++++++ test/oldtests/validate_check_p_m.c | 37 ++++++++++++++++++++++++++++ test/oldtests/validate_imm_numbers.c | 36 +++++++++++++++++++++++++++ test/oldtests/validate_plus_continue_tests.c | 30 ++++++++++++++++++++++ test/validate_check_imm.c | 36 --------------------------- test/validate_check_p_m.c | 37 ---------------------------- test/validate_imm_numbers.c | 36 --------------------------- test/validate_plus_continue_tests.c | 30 ---------------------- 9 files changed, 140 insertions(+), 155 deletions(-) create mode 100644 test/oldtests/validate_check_imm.c create mode 100644 test/oldtests/validate_check_p_m.c create mode 100644 test/oldtests/validate_imm_numbers.c create mode 100644 test/oldtests/validate_plus_continue_tests.c delete mode 100644 test/validate_check_imm.c delete mode 100644 test/validate_check_p_m.c delete mode 100644 test/validate_imm_numbers.c delete mode 100644 test/validate_plus_continue_tests.c (limited to 'test') diff --git a/test/Makefile b/test/Makefile index 4011915..ec61306 100644 --- a/test/Makefile +++ b/test/Makefile @@ -10,14 +10,6 @@ all: 7ed-TESTING clean: cd .. && make clean - rm -f vcpm - echo "rm -f vcpm" - rm -f vcimm - echo "rm -f vcimm" - rm -f vpct - echo "rm -f vpct" - rm -f vimmn - echo "rm -f vimmn" echo "Cleaned." smode: @@ -26,11 +18,4 @@ smode: alltests: cd .. && make tests - $(CC) $(CFLAGS_ALLTESTS) validate_check_p_m.c ../i_validation.c -o vcpm - echo "CC ---> vcpm" - $(CC) $(CFLAGS_ALLTESTS) validate_check_imm.c ../i_validation.c -o vcimm - 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" + echo "Done." diff --git a/test/oldtests/validate_check_imm.c b/test/oldtests/validate_check_imm.c new file mode 100644 index 0000000..48867f9 --- /dev/null +++ b/test/oldtests/validate_check_imm.c @@ -0,0 +1,36 @@ +#include +#include +#include +#include +#include +#include "../7ed.h" +#include "../i_validation.h" +#include "../input.h" +#include + +// 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_check_imm(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 diff --git a/test/oldtests/validate_check_p_m.c b/test/oldtests/validate_check_p_m.c new file mode 100644 index 0000000..fe54bd9 --- /dev/null +++ b/test/oldtests/validate_check_p_m.c @@ -0,0 +1,37 @@ +#include +#include +#include +#include +#include +#include "../7ed.h" +#include "../i_validation.h" +#include "../input.h" +#include + +// Test for validate_check_p_m + +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_check_p_m(smode_buf); + + if(ret == _NA) { + printf("NA\n"); + } + if(ret == _PLUS_CONTINUE) { + printf("plus continue\n"); + } + + if(ret == _INVALID) { + printf("?\n"); + } + if(ret == _VALID) { + printf("valid\n"); + } + + return 0; + +} \ No newline at end of file diff --git a/test/oldtests/validate_imm_numbers.c b/test/oldtests/validate_imm_numbers.c new file mode 100644 index 0000000..35e0e32 --- /dev/null +++ b/test/oldtests/validate_imm_numbers.c @@ -0,0 +1,36 @@ +#include +#include +#include +#include +#include +#include "../7ed.h" +#include "../i_validation.h" +#include "../input.h" +#include + +// 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 diff --git a/test/oldtests/validate_plus_continue_tests.c b/test/oldtests/validate_plus_continue_tests.c new file mode 100644 index 0000000..b8c9769 --- /dev/null +++ b/test/oldtests/validate_plus_continue_tests.c @@ -0,0 +1,30 @@ +#include +#include +#include +#include +#include +#include "../7ed.h" +#include "../i_validation.h" +#include "../input.h" +#include + +// Test for validate_plus_continue + +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_plus_continue(smode_buf); + + if(ret == _INVALID) { + printf("?\n"); + } + if(ret == _VALID) { + printf("valid\n"); + } + + return 0; + +} \ No newline at end of file diff --git a/test/validate_check_imm.c b/test/validate_check_imm.c deleted file mode 100644 index 48867f9..0000000 --- a/test/validate_check_imm.c +++ /dev/null @@ -1,36 +0,0 @@ -#include -#include -#include -#include -#include -#include "../7ed.h" -#include "../i_validation.h" -#include "../input.h" -#include - -// 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_check_imm(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 diff --git a/test/validate_check_p_m.c b/test/validate_check_p_m.c deleted file mode 100644 index fe54bd9..0000000 --- a/test/validate_check_p_m.c +++ /dev/null @@ -1,37 +0,0 @@ -#include -#include -#include -#include -#include -#include "../7ed.h" -#include "../i_validation.h" -#include "../input.h" -#include - -// Test for validate_check_p_m - -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_check_p_m(smode_buf); - - if(ret == _NA) { - printf("NA\n"); - } - if(ret == _PLUS_CONTINUE) { - printf("plus continue\n"); - } - - if(ret == _INVALID) { - printf("?\n"); - } - if(ret == _VALID) { - printf("valid\n"); - } - - return 0; - -} \ No newline at end of file diff --git a/test/validate_imm_numbers.c b/test/validate_imm_numbers.c deleted file mode 100644 index 35e0e32..0000000 --- a/test/validate_imm_numbers.c +++ /dev/null @@ -1,36 +0,0 @@ -#include -#include -#include -#include -#include -#include "../7ed.h" -#include "../i_validation.h" -#include "../input.h" -#include - -// 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 diff --git a/test/validate_plus_continue_tests.c b/test/validate_plus_continue_tests.c deleted file mode 100644 index b8c9769..0000000 --- a/test/validate_plus_continue_tests.c +++ /dev/null @@ -1,30 +0,0 @@ -#include -#include -#include -#include -#include -#include "../7ed.h" -#include "../i_validation.h" -#include "../input.h" -#include - -// Test for validate_plus_continue - -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_plus_continue(smode_buf); - - if(ret == _INVALID) { - printf("?\n"); - } - if(ret == _VALID) { - printf("valid\n"); - } - - return 0; - -} \ No newline at end of file -- cgit v1.2.3