diff options
Diffstat (limited to 'test/oldtests')
-rw-r--r-- | test/oldtests/validate_check_imm.c | 36 | ||||
-rw-r--r-- | test/oldtests/validate_check_p_m.c | 37 | ||||
-rw-r--r-- | test/oldtests/validate_imm_numbers.c | 36 | ||||
-rw-r--r-- | test/oldtests/validate_plus_continue_tests.c | 30 |
4 files changed, 139 insertions, 0 deletions
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 <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_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 <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_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 <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 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 <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_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 |