Exemple #1
0
int main(int argc, char* argv[]) {
    int err = 0;
    int rank;

    if (argc < 2) {
        printf("./log <output>\n");
        return 0;
    }

    MPI_Init(&argc, &argv);

    MPI_Comm_rank(MPI_COMM_WORLD, &rank);

    if (rank == 0) {
        char *cmd_str = (char*)malloc(strlen(argv[0]) + 256);
        sprintf(cmd_str, "*** TESTING C   %s for checking log functionality", basename(argv[0]));
        printf("%-66s ------ ", cmd_str); fflush(stdout);
        free(cmd_str);
    }

    simpletest("test.cdf", 0);
    simpletest("test_log.cdf", 1);

    if (filecomp("test.cdf", "test_log.cdf") != 0) {
        printf("Error in %s line %d: Flushed result mismatch\n", __FILE__,__LINE__);
        err += 1;
    }
    test("test.cdf", 0);
    test("test_log.cdf", 1);

    if (filecomp("test.cdf", "test_log.cdf") != 0) {
        printf("Error in %s line %d: Flushed result mismatch\n", __FILE__,__LINE__);
        err += 1;
    }

    if (err == 0) {
        printf("pass\n");
    }
    else{
        printf("fail with %d mismatches\n", err);
    }

    system("rm -f test.cdf");
    system("rm -f test_log.cdf");

ERROR:;
    MPI_Finalize();
    return err;
}
Exemple #2
0
int main(int argc, char *argv[])
{
   ec_adaptert * adapter = NULL;   
   printf("SOEM (Simple Open EtherCAT Master)\nSimple test\n");

   if (argc > 1)
   {      
      /* create thread to handle slave error handling in OP */
      osal_thread_create(&thread1, 128000, &ecatcheck, (void*) &ctime);
      strcpy(ifbuf, argv[1]);
      /* start cyclic part */
      simpletest(ifbuf);
   }
   else
   {
      printf("Usage: simple_test ifname1\n");
   	/* Print the list */
      printf ("Available adapters\n");
      adapter = ec_find_adapters ();
      while (adapter != NULL)
      {
         printf ("Description : %s, Device to use for wpcap: %s\n", adapter->desc,adapter->name);
         adapter = adapter->next;
      }
   }   
   
   printf("End program\n");
   return (0);
}
Exemple #3
0
int main ()
{
    simpletest ();
    stresstest ();
    printf ("Tests passed.\n");

    return 0;
}
Exemple #4
0
int
main(void)
{
	int	 failures = 0;

	failures += simpletest();
	failures += updatetest();
	failures += writetest();
	failures += seektest();

 	return (failures);
}
Exemple #5
0
void msgparse_test(void)
{
	sldns_buffer* pkt = sldns_buffer_new(65553);
	sldns_buffer* out = sldns_buffer_new(65553);
	struct alloc_cache super_a, alloc;
	/* init */
	alloc_init(&super_a, NULL, 0);
	alloc_init(&alloc, &super_a, 2);

	unit_show_feature("message parse");
	simpletest(pkt, &alloc, out);
	/* plain hex dumps, like pcat */
	testfromfile(pkt, &alloc, out, "testdata/test_packets.1");
	testfromfile(pkt, &alloc, out, "testdata/test_packets.2");
	testfromfile(pkt, &alloc, out, "testdata/test_packets.3");
	/* like from drill -w - */
	testfromdrillfile(pkt, &alloc, out, "testdata/test_packets.4");
	testfromdrillfile(pkt, &alloc, out, "testdata/test_packets.5");

	matches_nolocation = 1; /* RR order not important for the next test */
	testfromdrillfile(pkt, &alloc, out, "testdata/test_packets.6");
	check_rrsigs = 1;
	testfromdrillfile(pkt, &alloc, out, "testdata/test_packets.7");
	check_rrsigs = 0;
	matches_nolocation = 0; 

	check_formerr_gone = 1;
	testfromdrillfile(pkt, &alloc, out, "testdata/test_packets.8");
	check_formerr_gone = 0;

	check_rrsigs = 1;
	check_nosameness = 1;
	testfromdrillfile(pkt, &alloc, out, "testdata/test_packets.9");
	check_nosameness = 0;
	check_rrsigs = 0;

	/* cleanup */
	alloc_clear(&alloc);
	alloc_clear(&super_a);
	sldns_buffer_free(pkt);
	sldns_buffer_free(out);
}
int main(int argc, char *argv[])
{
    int iret1;
   printf("SOEM (Simple Open EtherCAT Master)\nSimple test\n");

   if (argc > 1)
   {      
      /* create thread to handle slave error handling in OP */
      iret1 = pthread_create( &thread1, NULL, (void *) &ecatcheck, (void*) &ctime);   
      /* start cyclic part */
      simpletest(argv[1]);
   }
   else
   {
      printf("Usage: simple_test ifname1\nifname = eth0 for example\n");
   }   
   
   printf("End program\n");
   return (0);
}