diff options
| author | Quentin Carbonneaux | 2014-09-19 20:30:23 -0400 |
|---|---|---|
| committer | Quentin Carbonneaux | 2014-09-19 20:31:31 -0400 |
| commit | 41c19dc506c081e3f418d4762b2025fb6476b35e (patch) | |
| tree | 4b56e082df7b9b69c677f242c637aa0f8166312f | |
| parent | 371dd1e4f7cf8adb72cf5bbde40b89b0724740c7 (diff) | |
fix testing code
The api changes for buffer creation invalidated the testing code.
Note that it is unclear if the window testing code is still relevant.
I had to change the number of windows from 3 to 2 to avoid a crash,
probably because the initial window size is too small.
| -rw-r--r-- | edit.c | 2 | ||||
| -rw-r--r-- | win.c | 12 |
2 files changed, 8 insertions, 6 deletions
@@ -528,7 +528,7 @@ main() { size_t len; EBuf *eb; - eb = eb_new(); + eb = eb_new(-1); while (fgets((char *)line, 1024, stdin)) { switch (line[0]) { @@ -1,4 +1,4 @@ -/*% clang -DN=3 -DWIN_TEST -Wall -g $(pkg-config --libs x11 xft) obj/{unicode,buf,edit,x11}.o % -o # +/*% clang -DN=2 -DWIN_TEST -Wall -g $(pkg-config --libs x11 xft) obj/{unicode,buf,edit,x11}.o % -o # */ #include <assert.h> @@ -608,6 +608,7 @@ lineinfo(W *w, unsigned off, unsigned lim, struct lineinfo *li) #include <sys/select.h> #include <sys/time.h> +void ex_cancel(Task *t) { (void)t; } void die(char *m) { exit(1); } int main() @@ -615,6 +616,7 @@ int main() GEvent e; EBuf *eb; W *ws[N], *w; + int i; enum CursorLoc cloc; unsigned char s[] = "je suis\n" @@ -624,19 +626,19 @@ int main() "un peu d'unicode: ä æ ç\n" "et voila!\n\n"; - eb = eb_new(); + eb = eb_new(-1); gui_x11.init(); win_init(&gui_x11); - for (int i = 0; i < N; i++) { + for (i=0; i<N; i++) { ws[i] = win_new(); eb_kill(ws[i]->eb); ws[i]->eb = eb; } w = ws[0]; - for (int i=0; i<5; i++) + for (i=0; i<5; i++) eb_ins_utf8(eb, 0, s, sizeof s - 1); - for (int i=0; i<5; i++) + for (i=0; i<5; i++) eb_ins_utf8(tag.win.eb, 0, (unsigned char *)"TAG WINDOW\n", 10); do { |
