Exemplo n.º 1
0
int SuiteTest(void)
{
    func_args args;
    char argv0[2][80];
    char* myArgv[2];

    printf(" Begin Cipher Suite Tests\n");

    /* setup */
    myArgv[0] = argv0[0];
    myArgv[1] = argv0[1];
    args.argv = myArgv;
    strcpy(argv0[0], "SuiteTest");

    (void)test_harness;

    cipherSuiteCtx = wolfSSL_CTX_new(wolfTLSv1_2_client_method());
    if (cipherSuiteCtx == NULL) {
        printf("can't get cipher suite ctx\n");
        exit(EXIT_FAILURE);
    }

    /* default case */
    args.argc = 1;
    printf("starting default cipher suite tests\n");
    test_harness(&args);
    if (args.return_code != 0) {
        printf("error from script %d\n", args.return_code);
        exit(EXIT_FAILURE);
    }

    /* any extra cases will need another argument */
    args.argc = 2;

#ifdef WOLFSSL_DTLS
    /* add dtls extra suites */
    strcpy(argv0[1], "tests/test-dtls.conf");
    printf("starting dtls extra cipher suite tests\n");
    test_harness(&args);
    if (args.return_code != 0) {
        printf("error from script %d\n", args.return_code);
        exit(EXIT_FAILURE);
    }
#endif

    printf(" End Cipher Suite Tests\n");

    wolfSSL_CTX_free(cipherSuiteCtx);
    wolfSSL_Cleanup();

    return args.return_code;
}
Exemplo n.º 2
0
Arquivo: 2.06.c Projeto: addercop/knr
int main()
{

	test_harness(0x00000000, 16, 4, 0x0000000f);

	return 0;
}
Exemplo n.º 3
0
int main()
{
	printf("Program main starts\n");

	test_harness();

	printf("Program Ends\n");

  return 0;
} // main
Exemplo n.º 4
0
int main(int argc, char *argv[])
{
	if (argc == 3 && !strcmp(argv[1], "exec")) {
		unsigned long parent_dscr;

		parent_dscr = atoi(argv[2]);
		do_exec(parent_dscr);
	} else if (argc != 1) {
		fprintf(stderr, "Usage: %s\n", argv[0]);
		exit(1);
	}

	prog = argv[0];
	return test_harness(dscr_inherit_exec, "dscr_inherit_exec_test");
}
Exemplo n.º 5
0
static void near ParseArgs(struct _args *ags, byte *argv[])
{
  static char unknown_opt[]="Unknown command-line option: `%s'\n";
  byte **arg;

  for (mode=0, arg=argv+1; *arg; arg++)
  {
    if (**arg != '-')
    {
      if (eqstri(*arg, "in") || eqstri(*arg, "toss"))
        mode |= MODE_toss;
      else if (eqstri(*arg, "out") || eqstri(*arg, "scan"))
        mode |= MODE_scan;
      else if (eqstri(*arg, "squash") || eqstri(*arg, "pack"))
        mode |= MODE_pack;
      else if (eqstri(*arg, "link"))
        mode |= MODE_link;
      else if (eqstri(*arg, "rescan"))
      {
        mode|=MODE_scan;
       
        if (arg[1]==NULL || arg[2]==NULL)
        {
          (void)printf("Error!  Format for RESCAN command is:\n\n"
                       "    SQUISH RESCAN <area_tag or echotoss.log> <node>\n");

          exit(ERL_ERROR);
        }
        
        (void)strcpy(ags->echotoss, arg[1]);
        
        ags->action=ACTION_RESCAN;
        ags->toscan=arg+2;
        //return;
	arg += 2;
      }
#if 0
      else if (eqstri(*arg, "test"))
      {
          test_harness(arg[1]);
          exit(ERL_NONE);
      }
#endif
      else
      {
        ags->toscan=arg+1;
        mode=MODE_pack;
        ags->do_pack=FALSE;

        if (eqstri(*arg, "get") || eqstri(*arg, "request"))
        {
          ags->action=ACTION_GET;
          return;
        }
        else if (eqstri(*arg, "update"))
        {
          ags->action=ACTION_UPDATE;
          return;
        }
        else if (eqstri(*arg, "send") || eqstri(*arg, "attach"))
        {
          ags->action=ACTION_SEND;
          return;
        }
        else if (eqstri(*arg, "poll"))
        {
          ags->action=ACTION_POLL;
          return;
        }
        else
        {
          (void)printf(unknown_opt, *arg);
          exit(ERL_ERROR);
        }
      }
    }
    else switch(tolower((*arg)[1]))
    {
      case 'a':
        (void)strcpy(ags->areasbbs, *arg+2);
        break;

      case 'c':
        (void)strcpy(ags->cfgname, *arg+2);
        break;

#if defined(DMALLOC) && defined(__MSDOS__)
      case 'd':
      {
        extern int _stdc shutup;

        (void)printf("PSP at %04x\n", _psp);
        shutup=FALSE;
        break;
      }
#endif

      case 'f':
        (void)strcpy(ags->echotoss, *arg+2);
        break;
        
      case 'l':
        ags->leave_packets=TRUE;
        break;

      case 'm':
        fRunZCore=TRUE;
        break;

      case 'n': /* new log file */
        (void)strcpy(ags->logfile, *arg+2);
        break;

      case 's':
        (void)strcpy(ags->sched, *arg+2);
        mode |= MODE_pack;
        break;

      case 't':
        config.flag ^= FLAG_SECURE;
        break;

      case 'u':
        config.flag ^= FLAG_TOSSBAD;
        break;

      case 'o':
        ags->do_pack=FALSE;
        break;

      case 'q':
        config.flag2 |= FLAG2_QUIET;
        break;

#if 0
      case 'x':
        mode=MODE_pack;

        switch(tolower((*arg)[2]))
        {
          case 'f':
            convert=CVT_FLO;
            break;
            
          case 'a':
            convert=CVT_ARC;
            break;
            
          case 'k':
            convert=CVT_KILL;
            break;

          case 's':
            convert=CVT_SFLO;
            break;
        }
        break;
#endif

      case 'v':
        config.flag ^= FLAG_STATS;
        break;

      case 'z':
        config.flag2 |= FLAG2_NPTHRU;
        break;

      default:
        (void)printf(unknown_opt, *arg);
        exit(ERL_ERROR);
    }
  }
}
Exemplo n.º 6
0
int 
main(int argc, char **argv)
{
    struct unit_test tests[MAX_TESTS] = {
        { "socket", 1, test_evfilt_read },
#if !defined(_WIN32) && !defined(__ANDROID__)
        // XXX-FIXME -- BROKEN ON LINUX WHEN RUN IN A SEPARATE THREAD
        { "signal", 1, test_evfilt_signal },
#endif
#if FIXME
        { "proc", 1, test_evfilt_proc },
#endif
		{ "timer", 1, test_evfilt_timer },
#ifndef _WIN32
		{ "vnode", 1, test_evfilt_vnode },
#endif
#ifdef EVFILT_USER
        { "user", 1, test_evfilt_user },
#endif
        { NULL, 0, NULL },
    };
    struct unit_test *test;
    int c, i, iterations;
    char *arg;
    int match;

#ifdef _WIN32
    /* Initialize the Winsock library */
    WSADATA wsaData;
    if (WSAStartup(MAKEWORD(2,2), &wsaData) != 0) 
        err(1, "WSAStartup failed");
#endif

    iterations = 1;

/* Windows does not provide a POSIX-compatible getopt */
#ifndef _WIN32
    while ((c = getopt (argc, argv, "hn:")) != -1) {
        switch (c) {
            case 'h':
                usage();
                break;
            case 'n':
                iterations = atoi(optarg);
                break;
            default:
                usage();
        }
    }

    /* If specific tests are requested, disable all tests by default */
    if (optind < argc) {
        for (test = &tests[0]; test->ut_name != NULL; test++) {
            test->ut_enabled = 0;
        }
    }
    for (i = optind; i < argc; i++) {
        match = 0;
        arg = argv[i];
        for (test = &tests[0]; test->ut_name != NULL; test++) {
            if (strcmp(arg, test->ut_name) == 0) {
                test->ut_enabled = 1;
                match = 1;
                break;
            }
        }
        if (!match) {
            printf("ERROR: invalid option: %s\n", arg);
            exit(1);
        } else {
            printf("enabled test: %s\n", arg);
        }
    }
#endif

    test_harness(tests, iterations);

    return (0);
}
Exemplo n.º 7
0
int main(void)
{
	return test_harness(task_event_vs_ebb, "task_event_vs_ebb");
}
Exemplo n.º 8
0
int main(void)
{
	return test_harness(cpu_event_pinned_vs_ebb, "cpu_event_pinned_vs_ebb");
}
Exemplo n.º 9
0
int main(int argc, char *argv[])
{
	return test_harness(test_paste_last_unaligned, "test_paste_last_unaligned");
}
Exemplo n.º 10
0
int main(int argc, char *argv[])
{
    return test_harness(dscr_explicit, "dscr_explicit_test");
}
Exemplo n.º 11
0
int main(void)
{
	return test_harness(tm_syscall, "tm_syscall");
}
Exemplo n.º 12
0
int main(void)
{
	return test_harness(per_event_excludes, "per_event_excludes");
}
Exemplo n.º 13
0
int main(void)
{
	return test_harness(l3_bank_test, "l3_bank_test");
}
Exemplo n.º 14
0
int main(void)
{
	return test_harness(test_copy_exception, str(COPY_LOOP));
}
Exemplo n.º 15
0
int main(void)
{
	return test_harness(ebb_on_willing_child, "ebb_on_willing_child");
}
Exemplo n.º 16
0
int main(int argc, char *argv[])
{
	return test_harness(ptrace_vsx, "ptrace_vsx");
}
Exemplo n.º 17
0
int main(void)
{
	return test_harness(test_body, "load_unaligned_zeropad");
}
Exemplo n.º 18
0
int SuiteTest(void)
{
    func_args args;
    char argv0[2][80];
    char* myArgv[2];

    printf(" Begin Cipher Suite Tests\n");

    /* setup */
    myArgv[0] = argv0[0];
    myArgv[1] = argv0[1];
    args.argv = myArgv;
    strcpy(argv0[0], "SuiteTest");

#ifdef WOLFSSL_STATIC_MEMORY
    byte memory[200000];
#endif

    (void)test_harness;

    cipherSuiteCtx = wolfSSL_CTX_new(wolfTLSv1_2_client_method());
    if (cipherSuiteCtx == NULL) {
        printf("can't get cipher suite ctx\n");
        exit(EXIT_FAILURE);
    }

    /* load in static memory buffer if enabled */
#ifdef WOLFSSL_STATIC_MEMORY
    if (wolfSSL_CTX_load_static_memory(&cipherSuiteCtx, NULL,
                                                   memory, sizeof(memory), 0, 1)
            != SSL_SUCCESS) {
        printf("unable to load static memory and create ctx");
        exit(EXIT_FAILURE);
    }
#endif

    /* default case */
    args.argc = 1;
    printf("starting default cipher suite tests\n");
    test_harness(&args);
    if (args.return_code != 0) {
        printf("error from script %d\n", args.return_code);
        exit(EXIT_FAILURE);
    }

    /* any extra cases will need another argument */
    args.argc = 2;

#ifdef WOLFSSL_DTLS
    /* add dtls extra suites */
    strcpy(argv0[1], "tests/test-dtls.conf");
    printf("starting dtls extra cipher suite tests\n");
    test_harness(&args);
    if (args.return_code != 0) {
        printf("error from script %d\n", args.return_code);
        exit(EXIT_FAILURE);
    }
#endif
#ifdef WOLFSSL_SCTP
    /* add dtls-sctp extra suites */
    strcpy(argv0[1], "tests/test-sctp.conf");
    printf("starting dtls-sctp extra cipher suite tests\n");
    test_harness(&args);
    if (args.return_code != 0) {
        printf("error from script %d\n", args.return_code);
        exit(EXIT_FAILURE);
    }
#endif
#ifndef WC_STRICT_SIG
#if !defined(NO_RSA) && defined(HAVE_ECC) /* testing mixed ECC/RSA cert */
    /* add extra signature test suites */
    strcpy(argv0[1], "tests/test-sig.conf");
    printf("starting sig extra cipher suite tests\n");
    test_harness(&args);
    if (args.return_code != 0) {
        printf("error from script %d\n", args.return_code);
        exit(EXIT_FAILURE);
    }
#endif /* HAVE_RSA and HAVE_ECC */
#endif /* !WC_STRICT_SIG */
#ifdef HAVE_QSH
    /* add QSH extra suites */
    strcpy(argv0[1], "tests/test-qsh.conf");
    printf("starting qsh extra cipher suite tests\n");
    test_harness(&args);
    if (args.return_code != 0) {
        printf("error from script %d\n", args.return_code);
        exit(EXIT_FAILURE);
    }
#endif

#ifndef NO_PSK
    /* add psk extra suites */
    strcpy(argv0[1], "tests/test-psk-no-id.conf");
    printf("starting psk no identity extra cipher suite tests\n");
    test_harness(&args);
    if (args.return_code != 0) {
        printf("error from script %d\n", args.return_code);
        exit(EXIT_FAILURE);
    }
#endif

    printf(" End Cipher Suite Tests\n");

    wolfSSL_CTX_free(cipherSuiteCtx);
    wolfSSL_Cleanup();

    return args.return_code;
}
Exemplo n.º 19
0
int SuiteTest(void)
{
    func_args args;
    char argv0[2][80];
    char* myArgv[2];

    printf(" Begin Cipher Suite Tests\n");

    /* setup */
    myArgv[0] = argv0[0];
    myArgv[1] = argv0[1];
    args.argv = myArgv;
    strcpy(argv0[0], "SuiteTest");

#if !defined(NO_RSA)
    /* default case */
    args.argc = 1;
    printf("starting default cipher suite tests\n");
    test_harness(&args);
    if (args.return_code != 0) {
        printf("error from script %d\n", args.return_code);
        exit(EXIT_FAILURE);  
    }
#endif

    /* any extra cases will need another argument */
    args.argc = 2;

#ifdef OPENSSL_EXTRA
    /* add openssl extra suites */
    strcpy(argv0[1], "tests/test-openssl.conf");
    printf("starting openssl extra cipher suite tests\n");
    test_harness(&args);
    if (args.return_code != 0) {
        printf("error from script %d\n", args.return_code);
        exit(EXIT_FAILURE);  
    }
#endif

#if !defined(NO_RSA) && defined(HAVE_NULL_CIPHER)
    /* add rsa null cipher suites */
    strcpy(argv0[1], "tests/test-null.conf");
    printf("starting null cipher suite tests\n");
    test_harness(&args);
    if (args.return_code != 0) {
        printf("error from script %d\n", args.return_code);
        exit(EXIT_FAILURE);  
    }
#endif

#ifdef HAVE_HC128 
    /* add hc128 extra suites */
    strcpy(argv0[1], "tests/test-hc128.conf");
    printf("starting hc128 extra cipher suite tests\n");
    test_harness(&args);
    if (args.return_code != 0) {
        printf("error from script %d\n", args.return_code);
        exit(EXIT_FAILURE);  
    }
#endif

#ifdef HAVE_RABBIT
    /* add rabbit extra suites */
    strcpy(argv0[1], "tests/test-rabbit.conf");
    printf("starting rabbit extra cipher suite tests\n");
    test_harness(&args);
    if (args.return_code != 0) {
        printf("error from script %d\n", args.return_code);
        exit(EXIT_FAILURE);  
    }
#endif

#if !defined(NO_PSK) && !defined(NO_AES)
    /* add psk extra suites */
    strcpy(argv0[1], "tests/test-psk.conf");
    printf("starting psk extra cipher suite tests\n");
    test_harness(&args);
    if (args.return_code != 0) {
        printf("error from script %d\n", args.return_code);
        exit(EXIT_FAILURE);  
    }
#endif

#if !defined(NO_PSK) && defined(HAVE_NULL_CIPHER) && !defined(NO_OLD_TLS)
    strcpy(argv0[1], "tests/test-psk-null.conf");
    printf("starting psk extra null cipher suite tests\n");
    test_harness(&args);
    if (args.return_code != 0) {
        printf("error from script %d\n", args.return_code);
        exit(EXIT_FAILURE);  
    }
#endif

#ifdef CYASSL_LEANPSK
    strcpy(argv0[1], "tests/test-leanpsk.conf");
    printf("starting lean-psk cipher suite tests\n");
    test_harness(&args);
    if (args.return_code != 0) {
        printf("error from script %d\n", args.return_code);
        exit(EXIT_FAILURE);  
    }
#endif

#ifdef HAVE_NTRU
    /* add ntru extra suites */
    strcpy(argv0[1], "tests/test-ntru.conf");
    printf("starting ntru extra cipher suite tests\n");
    test_harness(&args);
    if (args.return_code != 0) {
        printf("error from script %d\n", args.return_code);
        exit(EXIT_FAILURE);  
    }
#endif

#ifdef HAVE_ECC
    /* add ecc extra suites */
    strcpy(argv0[1], "tests/test-ecc.conf");
    printf("starting ecc extra cipher suite tests\n");
    test_harness(&args);
    if (args.return_code != 0) {
        printf("error from script %d\n", args.return_code);
        exit(EXIT_FAILURE);  
    }
#endif

#ifdef HAVE_AESGCM
    /* add aesgcm extra suites */
    strcpy(argv0[1], "tests/test-aesgcm.conf");
    printf("starting aesgcm extra cipher suite tests\n");
    test_harness(&args);
    if (args.return_code != 0) {
        printf("error from script %d\n", args.return_code);
        exit(EXIT_FAILURE);  
    }
#endif

#if defined(HAVE_AESGCM) && defined(OPENSSL_EXTRA)
    /* add aesgcm openssl extra suites */
    strcpy(argv0[1], "tests/test-aesgcm-openssl.conf");
    printf("starting aesgcm openssl extra cipher suite tests\n");
    test_harness(&args);
    if (args.return_code != 0) {
        printf("error from script %d\n", args.return_code);
        exit(EXIT_FAILURE);  
    }
#endif

#if defined(HAVE_AESGCM) && defined(HAVE_ECC)
    /* add aesgcm ecc extra suites */
    strcpy(argv0[1], "tests/test-aesgcm-ecc.conf");
    printf("starting aesgcm ecc extra cipher suite tests\n");
    test_harness(&args);
    if (args.return_code != 0) {
        printf("error from script %d\n", args.return_code);
        exit(EXIT_FAILURE);  
    }
#endif

#ifdef CYASSL_DTLS 
    /* add dtls extra suites */
    strcpy(argv0[1], "tests/test-dtls.conf");
    printf("starting dtls extra cipher suite tests\n");
    test_harness(&args);
    if (args.return_code != 0) {
        printf("error from script %d\n", args.return_code);
        exit(EXIT_FAILURE);  
    }
#endif

    printf(" End Cipher Suite Tests\n");

    return args.return_code;
}
Exemplo n.º 20
0
int main(void)
{
	return test_harness(test_copy_loop, str(COPY_LOOP));
}
Exemplo n.º 21
0
int main(void)
{
	return test_harness(no_handler_test,"no_handler_test");
}
Exemplo n.º 22
0
int main(void)
{
	return test_harness(reg_access, "reg_access");
}
Exemplo n.º 23
0
int main(void)
{
	return test_harness(fork_cleanup, "fork_cleanup");
}
Exemplo n.º 24
0
int main(int argc, char *argv[])
{
	return test_harness(dscr_sysfs_thread, "dscr_sysfs_thread_test");
}
Exemplo n.º 25
0
int main(int argc, char **argv)
{
	return test_harness(test_vphn, "test-vphn");
}
Exemplo n.º 26
0
int main(int ac, char **av) {
  printf("Passed %d of %d tests\n", test_harness(), sizeof(tests)/sizeof(test_entry_t));

  do_benchmarks();

}
Exemplo n.º 27
0
int main(void)
{
	return test_harness(ipc_unmuxed, "ipc_unmuxed");
}
Exemplo n.º 28
0
int main(int argc, char *argv[])
{
	return test_harness(dscr_inherit, "dscr_inherit_test");
}
Exemplo n.º 29
0
int main(void)
{
	return test_harness(testcase, "memcmp");
}
Exemplo n.º 30
0
int main(int argc, char *argv[])
{
	return test_harness(test_preempt_vmx, "vmx_preempt");
}