From 72e182d14cb600ab315386058d2f9f7243c798c1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michael=20G=C3=B6hler?= Date: Sun, 14 Sep 2014 11:26:22 +0200 Subject: [PATCH] removed old tests --- CREDITS | 1 + test/Makefile | 22 ----------------- test/bits.c | 31 ------------------------ test/color.c | 29 ---------------------- test/cstack.c | 41 ------------------------------- test/cstring.c | 43 --------------------------------- test/fade.c | 65 -------------------------------------------------- 7 files changed, 1 insertion(+), 231 deletions(-) delete mode 100644 test/Makefile delete mode 100644 test/bits.c delete mode 100644 test/color.c delete mode 100644 test/cstack.c delete mode 100644 test/cstring.c delete mode 100644 test/fade.c diff --git a/CREDITS b/CREDITS index 35cf5f8..b613273 100644 --- a/CREDITS +++ b/CREDITS @@ -5,3 +5,4 @@ https://github.com/jclulow/vtmc David Parsons for his inspiring Markdown implementation in C https://github.com/Orc/discount + diff --git a/test/Makefile b/test/Makefile deleted file mode 100644 index 3a457e0..0000000 --- a/test/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -# set some compiler flags -CFLAGS=-g -Wall -lncurses - -# find *.c in the current directory -SOURCES=$(wildcard *.c) - -# define the output objects by replacing .c with .o -TARGETS=$(SOURCES:.c=) - -# this will make all objects -all: $(TARGETS) - -# each objects will be build by a *.c file -#%.o: %.c -%: %.c - cc $(CFLAGS) -o $@ $^ - -# this will delete all objects -# if not all objects are there, they will be compiled first -clean: $(TARGETS) - rm -f $^ - diff --git a/test/bits.c b/test/bits.c deleted file mode 100644 index 5d2a0d1..0000000 --- a/test/bits.c +++ /dev/null @@ -1,31 +0,0 @@ -#include - -#include "../include/markdown.h" - -int main(int argc, char *argv[]) { - - int i = 0; - printf("INIT: %i\n", i); - - SET_BIT(i, IS_H1); - printf("SET_BIT(%i): %i\n", IS_H1, i); - - printf("CHECK_BIT(%i): %i\n", IS_H1, CHECK_BIT(i, IS_H1)); - - TOGGLE_BIT(i, IS_H2); - printf("TOGGLE_BIT(%i): %i\n", IS_H2, i); - - printf("CHECK_BIT(%i): %i\n", IS_H2, CHECK_BIT(i, IS_H2)); - - TOGGLE_BIT(i, IS_H2); - printf("TOGGLE_BIT(%i): %i\n", IS_H2, i); - - CLEAR_BIT(i, IS_H1); - printf("CLEAR_BIT(%i): %i\n", IS_H1, i); - - printf("CHECK_BIT(%i): %i\n", IS_H1, CHECK_BIT(i, IS_H1)); - printf("CHECK_BIT(%i): %i\n", IS_H2, CHECK_BIT(i, IS_H2)); - - return(0); -} - diff --git a/test/color.c b/test/color.c deleted file mode 100644 index c2b58be..0000000 --- a/test/color.c +++ /dev/null @@ -1,29 +0,0 @@ -#include - -WINDOW *w; - -void set_colors(void) -{ - int i; - initscr(); - start_color(); - use_default_colors(); - - for(i=0; i < COLORS; i++) - { - init_pair(i, i, -1); - attron(COLOR_PAIR(i)); - printw(" %3.hd", i); - if((i + 1) % 36 == 0) printw("\n"); - refresh(); - } - standend(); - getch(); - endwin(); -} - -int main(void) -{ - set_colors(); - return 0; -} diff --git a/test/cstack.c b/test/cstack.c deleted file mode 100644 index 30d4df3..0000000 --- a/test/cstack.c +++ /dev/null @@ -1,41 +0,0 @@ -#include - -#include "../include/cstack.h" -#include "../cstack.c" - -int main(int argc, char *argv[]) { - - cstack_t *s = cstack_init(); - printf("INIT: head: %d, size: %zu, alloc: %zu\n", s->head, s->size, s->alloc); - - (s->push)(s, 'a'); - printf("PUSH: char: %c, head: %d, size: %zu, alloc: %zu\n", s->content[s->head], s->head, s->size, s->alloc); - - (s->push)(s, 'b'); - printf("PUSH: char: %c, head: %d, size: %zu, alloc: %zu\n", s->content[s->head], s->head, s->size, s->alloc); - - (s->push)(s, 'c'); - printf("PUSH: char: %c, head: %d, size: %zu, alloc: %zu\n", s->content[s->head], s->head, s->size, s->alloc); - - char ch = (s->pop)(s); - printf("POP: char: %c, head: %d, size: %zu, alloc: %zu\n", ch, s->head, s->size, s->alloc); - - ch = (s->pop)(s); - printf("POP: char: %c, head: %d, size: %zu, alloc: %zu\n", ch, s->head, s->size, s->alloc); - - (s->push)(s, 'd'); - printf("PUSH: char: %c, head: %d, size: %zu, alloc: %zu\n", s->content[s->head], s->head, s->size, s->alloc); - - (s->push)(s, 'e'); - printf("PUSH: char: %c, head: %d, size: %zu, alloc: %zu\n", s->content[s->head], s->head, s->size, s->alloc); - - while(s->size > 0) { - ch = (s->pop)(s); - printf("POP: char: %c, head: %d, size: %zu, alloc: %zu\n", ch, s->head, s->size, s->alloc); - } - - (s->delete)(s); - - return(0); -} - diff --git a/test/cstring.c b/test/cstring.c deleted file mode 100644 index 2175663..0000000 --- a/test/cstring.c +++ /dev/null @@ -1,43 +0,0 @@ -#include - -#include "../include/cstring.h" -#include "../cstring.c" - -int main(int argc, char *argv[]) { - - // testing with char - cstring_t *p = cstring_init(); - printf("text: %s, size: %zu, alloc: %zu\n", p->text, p->size, p->alloc); - - (p->expand)(p, 'X'); printf("text: %s, size: %zu, alloc: %zu\n", p->text, p->size, p->alloc); - (p->expand)(p, 'X'); printf("text: %s, size: %zu, alloc: %zu\n", p->text, p->size, p->alloc); - (p->expand)(p, 'X'); printf("text: %s, size: %zu, alloc: %zu\n", p->text, p->size, p->alloc); - (p->expand)(p, 'X'); printf("text: %s, size: %zu, alloc: %zu\n", p->text, p->size, p->alloc); - (p->expand)(p, 'X'); printf("text: %s, size: %zu, alloc: %zu\n", p->text, p->size, p->alloc); - (p->expand)(p, 'X'); printf("text: %s, size: %zu, alloc: %zu\n", p->text, p->size, p->alloc); - (p->expand)(p, 'X'); printf("text: %s, size: %zu, alloc: %zu\n", p->text, p->size, p->alloc); - (p->expand)(p, 'X'); printf("text: %s, size: %zu, alloc: %zu\n", p->text, p->size, p->alloc); - (p->expand)(p, 'X'); printf("text: %s, size: %zu, alloc: %zu\n", p->text, p->size, p->alloc); - (p->expand)(p, 'X'); printf("text: %s, size: %zu, alloc: %zu\n", p->text, p->size, p->alloc); - - (p->reset)(p); - printf("text: %s, size: %zu, alloc: %zu\n", p->text, p->size, p->alloc); - - char x[2] = {'X', '\0'}; - - (p->expand_arr)(p, x); printf("text: %s, size: %zu, alloc: %zu\n", p->text, p->size, p->alloc); - (p->expand_arr)(p, x); printf("text: %s, size: %zu, alloc: %zu\n", p->text, p->size, p->alloc); - (p->expand_arr)(p, x); printf("text: %s, size: %zu, alloc: %zu\n", p->text, p->size, p->alloc); - (p->expand_arr)(p, x); printf("text: %s, size: %zu, alloc: %zu\n", p->text, p->size, p->alloc); - (p->expand_arr)(p, x); printf("text: %s, size: %zu, alloc: %zu\n", p->text, p->size, p->alloc); - (p->expand_arr)(p, x); printf("text: %s, size: %zu, alloc: %zu\n", p->text, p->size, p->alloc); - (p->expand_arr)(p, x); printf("text: %s, size: %zu, alloc: %zu\n", p->text, p->size, p->alloc); - (p->expand_arr)(p, x); printf("text: %s, size: %zu, alloc: %zu\n", p->text, p->size, p->alloc); - (p->expand_arr)(p, x); printf("text: %s, size: %zu, alloc: %zu\n", p->text, p->size, p->alloc); - (p->expand_arr)(p, x); printf("text: %s, size: %zu, alloc: %zu\n", p->text, p->size, p->alloc); - - (p->delete)(p); - - return(0); -} - diff --git a/test/fade.c b/test/fade.c deleted file mode 100644 index 6ba3757..0000000 --- a/test/fade.c +++ /dev/null @@ -1,65 +0,0 @@ -#include -#include -#include -#define COLOR_PAIR1 1 -#define COLOR_PAIR2 2 -int main() -{ - initscr(); - curs_set(0);//sets visability of cursor - noecho();//disable auto-echoing - cbreak();//making getch() work without a buffer - keypad(stdscr,TRUE);//allows use of special keys, namely the arrow keys - if(has_colors() == TRUE) - { - start_color(); - use_default_colors(); - init_pair(COLOR_PAIR1,123,-1); - init_pair(COLOR_PAIR2,213,-1); - wbkgd(stdscr,COLOR_PAIR(COLOR_PAIR1)); - wmove(stdscr,10,5); - printw("q = quit"); - WINDOW *test=newwin(10,20,5,20); - wbkgd(test,COLOR_PAIR(COLOR_PAIR2)); - wprintw(test,"try\nUP or DOWN"); - wrefresh(stdscr); - wrefresh(test); - - // fading colors - short blue_ramp[] = { 16, 17, 17, 18, 18, 19, - 19, 20, 20, 21, 27, 32, - 33, 38, 39, 44, 45, 45, - 81, 81, 51, 51, 123, 123}; - short red_ramp[] = { 16, 52, 52, 53, 53, 89, - 89, 90, 90, 126, 127, 127, - 163, 163, 164, 164, 200, 200, - 201, 201, 207, 207, 213, 213}; - - short i = 23; - for (;;) - { - int c = getch(); - if(c == 'q') break; - - switch(c) { - case KEY_UP: - if(i < 23) i = i + 1; - break; - - case KEY_DOWN: - if(i > 0)i = i - 1; - break; - } - - init_pair(COLOR_PAIR1,blue_ramp[i],-1); - init_pair(COLOR_PAIR2,red_ramp[i],-1); - wrefresh(stdscr); - wrefresh(test); - } - - delwin(test); - } - - endwin(); - return 0; -} -- 2.20.1