static int testaddr(void *addr, volatile void *want) { #if defined(__s390__) if (addr != (void *) ((unsigned long) want & ~0xffful)) { #else if (addr != want) { #endif fprintf(stderr, " FAIL: expected si_addr==%p, not %p\n", want, addr); return 0; } return 1; } static void handler(int sig, siginfo_t *si, void *uc) { int ok = 1; ok = ok && testsig(sig, cur_test->sig); ok = ok && testcode(si->si_code, cur_test->code); if (cur_test->addr) ok = ok && testaddr(si->si_addr, cur_test->addr); if (ok) fprintf(stderr, " PASS\n"); siglongjmp(escape, ok + 1); }
int main() { int retcode = 0; retcode = printf("Hello, sailor!\n"); testcode((Var)retcode); }
static int testaddr(void *addr, volatile void *want) { /* Some architectures (e.g. s390) just provide enough information to resolve the page fault, but do not provide the offset within a page */ #if defined(__s390__) if (addr != (void *) ((unsigned long) want & ~0xffful)) { #else if (addr != want) { #endif fprintf(stderr, " FAIL: expected si_addr==%p, not %p\n", want, addr); return 0; } return 1; } static void handler(int sig, siginfo_t *si, void *uc) { int ok = 1; ok = ok && testsig(sig, cur_test->sig); ok = ok && testcode(si->si_code, cur_test->code); if (cur_test->addr) ok = ok && testaddr(si->si_addr, cur_test->addr); if (ok) fprintf(stderr, " PASS\n"); siglongjmp(escape, ok + 1); }
static void handler(int sig, siginfo_t *si, void *uc) { int ok = 1; ok = ok && testsig(sig, curr_test->sig); ok = ok && testcode(si->si_code, curr_test->code); if (ok) fprintf(stderr, " PASS\n"); siglongjmp(escape, ok + 1); }
main(){ sys$testcode(); sys$testcode2(); }
CModViewView::CModViewView() { testcode(); }
int main(void) { testcode(); _getch(); return 0; }