Changeset 3381399
- Timestamp:
- Nov 17, 2008, 1:53:24 PM (16 years ago)
- Branches:
- master, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- f446454
- Parents:
- 799b60e
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile.in
r7e78e49 r3381399 53 53 $(ATHSTATIC) $(CC) -o $(EXE) owl.o $(OBJS) $(LDFLAGS) $(LIBS) 54 54 55 tester: $(AUTOGEN) $(OBJS) tester.o 55 tester: $(AUTOGEN) $(OBJS) tester.o libfaim 56 56 $(ATHSTATIC) $(CC) -o tester tester.o $(OBJS) $(LDFLAGS) $(LIBS) 57 57 -
aim.c
rdb0ac7e r3381399 2309 2309 aim_sendcookie(sess, tstconn, redir->cookielen, redir->cookie); 2310 2310 return; 2311 } 2312 2313 void owl_process_aim() 2314 { 2315 if (owl_global_is_doaimevents(&g)) { 2316 owl_aim_process_events(); 2317 2318 if (owl_global_is_aimloggedin(&g)) { 2319 if (owl_timer_is_expired(owl_global_get_aim_buddyinfo_timer(&g))) { 2320 /* owl_buddylist_request_idletimes(owl_global_get_buddylist(&g)); */ 2321 owl_timer_reset(owl_global_get_aim_buddyinfo_timer(&g)); 2322 } 2323 } 2324 } 2311 2325 } 2312 2326 -
owl.c
r799b60e r3381399 611 611 612 612 return 1; 613 }614 615 void owl_process_aim()616 {617 if (owl_global_is_doaimevents(&g)) {618 owl_aim_process_events();619 620 if (owl_global_is_aimloggedin(&g)) {621 if (owl_timer_is_expired(owl_global_get_aim_buddyinfo_timer(&g))) {622 /* owl_buddylist_request_idletimes(owl_global_get_buddylist(&g)); */623 owl_timer_reset(owl_global_get_aim_buddyinfo_timer(&g));624 }625 }626 }627 613 } 628 614 -
tester.c
r1cf3f8d3 r3381399 6 6 7 7 owl_global g; 8 9 void screeninit()10 {11 char buff[1024];12 13 sprintf(buff, "TERMINFO=%s", TERMINFO);14 putenv(buff);15 16 initscr();17 start_color();18 /* cbreak(); */19 raw();20 noecho();21 intrflush(stdscr,FALSE);22 keypad(stdscr,TRUE);23 nodelay(stdscr,1);24 clear();25 refresh();26 meta(stdscr, TRUE);27 }28 29 void test1()30 {31 int j;32 owl_editwin e;33 34 screeninit();35 36 owl_editwin_init(&e, stdscr, LINES, COLS, OWL_EDITWIN_STYLE_MULTILINE, NULL);37 /* owl_editwin_set_locktext(&e, "Here is some locktext:\n");*/38 doupdate();39 while (1) {40 usleep(50);41 42 j=getch();43 44 if (j==ERR) continue;45 46 if (j==3) break;47 48 if (j==27) {49 j=getch();50 if (j==ERR) continue;51 owl_editwin_process_char(&e, j);52 doupdate();53 } else {54 owl_editwin_process_char(&e, j);55 doupdate();56 }57 }58 endwin();59 printf("Had:\n%s", owl_editwin_get_text(&e));60 }61 62 void test2(char *in)63 {64 owl_fmtext t;65 66 screeninit();67 68 owl_fmtext_init_null(&t);69 owl_fmtext_append_ztext(&t, in);70 owl_fmtext_curs_waddstr(&t, stdscr);71 wrefresh(stdscr);72 sleep(5000);73 endwin();74 }75 76 void test3()77 {78 ZNotice_t *n;79 80 printf("%i\n", sizeof(n->z_uid.zuid_addr));81 /* gethostbyaddr((char *) &(n->z_uid.zuid_addr), sizeof(n->z_uid.zuid_addr), AF_INET); */82 }83 84 void colorinfo()85 {86 char buff[1024];87 88 screeninit();89 sprintf(buff, "Have %i COLOR_PAIRS\n", COLOR_PAIRS);90 addstr(buff);91 refresh();92 sleep(10);93 endwin();94 }95 96 void test4()97 {98 int j;99 char buff[1024];100 101 screeninit();102 103 while (1) {104 usleep(100);105 106 j=getch();107 108 if (j==ERR) continue;109 110 if (j==3) break;111 sprintf(buff, "%o\n", j);112 addstr(buff);113 }114 endwin();115 }116 117 void test_keypress()118 {119 int j, rev;120 char buff[1024], buff2[64];121 122 screeninit();123 124 while (1) {125 usleep(100);126 127 j=wgetch(stdscr);128 129 if (j==ERR) continue;130 131 if (j==3) break;132 if (0 == owl_keypress_tostring(j, 0, buff2, 1000)) {133 rev = owl_keypress_fromstring(buff2);134 sprintf(buff, "%s : 0x%x 0%o %d %d %s\n", buff2, j, j, j, rev,135 (j==rev?"matches":"*** WARNING: Does Not Reverse"));136 } else {137 sprintf(buff, "UNKNOWN : 0x%x 0%o %d\n", j, j, j);138 }139 addstr(buff);140 }141 endwin();142 }143 144 8 145 9 #define OWL_DICT_NTESTS 20 … … 155 19 156 20 int numfailures=0; 157 if (argc==1 || (argc==2 && 0==strcmp(argv[1],"reg"))) { 158 printf("1..%d\n", OWL_UTIL_NTESTS+OWL_DICT_NTESTS+OWL_VARIABLE_NTESTS 159 +OWL_FILTER_NTESTS+OWL_OBARRAY_NTESTS); 160 numfailures += owl_util_regtest(); 161 numfailures += owl_dict_regtest(); 162 numfailures += owl_variable_regtest(); 163 numfailures += owl_filter_regtest(); 164 numfailures += owl_obarray_regtest(); 165 if (numfailures) { 21 printf("1..%d\n", OWL_UTIL_NTESTS+OWL_DICT_NTESTS+OWL_VARIABLE_NTESTS 22 +OWL_FILTER_NTESTS+OWL_OBARRAY_NTESTS); 23 numfailures += owl_util_regtest(); 24 numfailures += owl_dict_regtest(); 25 numfailures += owl_variable_regtest(); 26 numfailures += owl_filter_regtest(); 27 numfailures += owl_obarray_regtest(); 28 if (numfailures) { 166 29 fprintf(stderr, "# *** WARNING: %d failures total\n", numfailures); 167 }168 return(numfailures);169 } else if (argc==2 && 0==strcmp(argv[1],"test1")) {170 test1();171 } else if (argc==2 && 0==strcmp(argv[1],"colorinfo")) {172 colorinfo();173 } else if (argc==2 && 0==strcmp(argv[1],"test4")) {174 test4();175 } else if (argc==2 && 0==strcmp(argv[1],"keypress")) {176 test_keypress();177 } else {178 fprintf(stderr, "No test specified. Current options are: reg test1\n");179 30 } 180 return( 0);31 return(numfailures); 181 32 }
Note: See TracChangeset
for help on using the changeset viewer.