示例#1
0
int main(int argc, char* argv[])
{
	(void) argc; (void) argv;
	acl::acl_cpp_init();

	int   n = 100;
	if (argc >= 2)
		n = atoi(argv[1]);
	if (n <= 0)
		n = 100;
	ACL_METER_TIME("---------- begin ----------");
	for (int i = 0; i < 0; i++)
		test0(i);
	ACL_METER_TIME("---------- end ----------");

	test1();

	ACL_METER_TIME("---------- begin ----------");
	for (int i = 0; i < 1; i++)
	{
		printf(">>>i: %d\n", i);
		test2();
	}
	ACL_METER_TIME("---------- end ----------");

	printf("Over, enter any key to exit!\n");
	getchar();
	return (0);
}
int		main(int argc, char ** argv)
{
	ft_printf("███╗   ██╗ ██████╗ ██╗    ██╗██╗\n");
	ft_printf("████╗  ██║██╔═══██╗██║    ██║██║\n");
	ft_printf("██╔██╗ ██║██║   ██║██║ █╗ ██║██║\n");
	ft_printf("██║╚██╗██║██║   ██║██║███╗██║██║\n");
	ft_printf("██║ ╚████║╚██████╔╝╚███╔███╔╝███████╗\n");
	ft_printf("╚═╝  ╚═══╝ ╚═════╝  ╚══╝╚══╝ ╚══════╝\n\n");
	if (argc == 1)
	{
		ft_printf("_--Ce testeur comporte plusieurs tests--_\n\n");
		ft_printf("Test a : Test ultra simple. (Une seule ligne)\n");
		ft_printf("Test b : Test plus tricky. (Plusieurs lignes)\n");
		ft_printf("Test c : Incomming !\n");
		ft_printf("Juste besoins de rajouter l'option a sh zz_test.sh\n");
		return (0);
	}
	else if (argc == 2)
	{
		if (argv[1][0] == '1')
		{
			test0();
			return (0);
		}
		if (argv[1][0] == '2')
		{
			test1();
			return (0);
		}
	}
	return (0);
}
int main()
{
    thread_log_idx = thread_count++;
    test0();
    test1();
    test3();
}
示例#4
0
int main(int argc, char **argv)
{
  MPI_Comm       comm;
  DM             dm;
  AppCtx         options;
  PetscErrorCode ierr;

  ierr = PetscInitialize(&argc, &argv, NULL,help);if (ierr) return ierr;
  comm = PETSC_COMM_WORLD;
  ierr = ProcessOptions(comm, &options);CHKERRQ(ierr);
  ierr = CreateMesh(comm, &options, &dm);CHKERRQ(ierr);

  switch (options.test) {
    case 0: ierr = test0(dm, &options);CHKERRQ(ierr); break;
    case 1: ierr = test1(dm, &options);CHKERRQ(ierr); break;
    case 2: ierr = test2(dm, &options);CHKERRQ(ierr); break;
    case 3: ierr = test3(dm, &options);CHKERRQ(ierr); break;
    case 4: ierr = test4(dm, &options);CHKERRQ(ierr); break;
    case 5: ierr = test5(dm, &options);CHKERRQ(ierr); break;
    case 6: ierr = test6(dm, &options);CHKERRQ(ierr); break;
    case 7: ierr = test7(dm, &options);CHKERRQ(ierr); break;
    case 8: ierr = test8(dm, &options);CHKERRQ(ierr); break;
    default: SETERRQ1(comm, PETSC_ERR_ARG_OUTOFRANGE, "No such test: %D", options.test);
  }

  ierr = DMDestroy(&dm);CHKERRQ(ierr);
  ierr = PetscFinalize();
  return ierr;
}
示例#5
0
文件: testco.c 项目: mkushnir/mrkthr
int
main(UNUSED int argc, UNUSED char *argv[])
{
    TRACE("size of mrkthr_ctx_t is %ld", (long)mrkthr_ctx_sizeof());
    test0();
    return 0;
}
示例#6
0
int main(int argc, char* argv[])
{
    (void) argc;
    (void) argv;
    acl::acl_cpp_init();

    int   n = 1;
    if (argc >= 2)
        n = atoi(argv[1]);
    if (n <= 0)
        n = 100;
    ACL_METER_TIME("---------- begin ----------");
    for (int i = 0; i < 0; i++)
        test0(i);
    ACL_METER_TIME("---------- end ----------");

    // 126 的 SSL 传输时当 HTTP 请求头中的 Host 值为 mail.126.com:443 时其 nginx
    // 会报错,只能是:Host: mail.126.com,土鳖

    test1("mail.126.com", 443, false, true);
    test2("mail.126.com", 443, false, true);
    test2("mail.qq.com", 443, false, true);
    test2("mail.sohu.com", 443, false, true);
    test2("mail.sina.com.cn", 443, false, true);

    printf("Over, enter any key to exit!\n");
    getchar();
    return (0);
}
示例#7
0
int main()
{
  test0();
  test1();
  test2();

  return 0;
}
示例#8
0
文件: serialize.c 项目: ensc/ensc-lib
int main(void)
{
	struct serialize_stream		s = INIT_SERIALIZE_STREAM(s);
	struct unserialize_stream_mem	u0;
	struct unserialize_stream_mem	u1;

	serialize_u32(&s, 23);
	serialize_u64(&s, 42);
	serialize_time_t(&s, 1);
	serialize_buf(&s, BUF0, sizeof BUF0 - 1);
	serialize_buf(&s, BUF1, sizeof BUF1 - 1);
	serialize_buf(&s, BUF2, sizeof BUF2 - 1);
	serialize_buf(&s, BUF3, sizeof BUF3 - 1);

	serialize_allocate(&s, 80);

	serialize_str(&s, STR0);
	serialize_str(&s, STR1);
	serialize_str(&s, STR2);
	serialize_str(&s, STR3);

	u0.s.type = UNSERIALIZE_SRC_MEM;
	u0.ptr = s.base;
	u0.cnt = s.cnt;

	{
		uint32_t	v;
		assert(unserialize_u32(&u0.s, &v) && v == 23);
	}

	{
		uint64_t	v;
		assert(unserialize_u64(&u0.s, &v) && v == 42);
	}

	{
		time_t		v;
		assert(unserialize_time_t(&u0.s, &v) && v == 1);
	}

	u1 = u0;

	u0 = u1;
	test0(&u0);

	u0 = u1;
	test1(&u0);

	u0 = u1;
	test2(&u0, false);

	u0 = u1;
	test2(&u0, true);

	serialize_destroy(&s, true);

	return 0;
}
示例#9
0
int main()
 {
  flint_randinit(rst);
  slong i;
  for(i=1;i<4*FLINT_BITS+5;i++)
   test0(i);
  flint_printf("Test passed\n");
  return 0;
 }
示例#10
0
int
main(int argc, char **argv)
{
	int i;
	memset(&ctx, 0, sizeof(ctx));

	/* increase scale */
	for (i = 0; i < 10; ++i) {
		test("1234", 18+i, 0, 2+i);
		test("1234.1234", 18+i, 5, 3+i);
		test("1234.1234", 22+i, 5+i, 12+i);
	}

	/* overflow */
	test("1234", 4, 0, 2);
	for (i = 1; i < 12; ++i)
		test("1234", 3+i, 0, i);
	for (i = 2; i < 12; ++i)
		test("1234", 2+i, 0, i);

	/* decrease scale */
	test("1234", 10, 4, 0);
	test("1234.765", 30, 20, 2);

	test0("765432.2", 30, 2, 20, 2);
	test0("765432.2", 30, 2, 40, 2);
	test0("765432.2", 30, 2, 6, 2);

	/* test big overflows */
	test0("10000000000000000000000000", 30, 0, 10, 0);
	test0("1000000000000000000", 30, 0, 10, 0);

	test0("10000000000000000", 30, 10, 19, 0);
	test0("10000000000000000", 30, 10, 12, 0);

#if 0
	{
		int p1, s1, p2, s2;
		for (p1 = 1; p1 <= 77; ++p1) {
			printf("(%d,%d) -> (%d,%d)\n", p1, s1, p2, s2);
			for (s1 = 0; s1 < p1; ++s1)
				for (p2 = 1; p2 <= 77; ++p2)
					for (s2 = 0; s2 < p2; ++s2)
						test0("9", p1, s1, p2, s2);
		}
	}
#endif

	if (!g_result)
		printf("All passed!\n");

	return g_result;
}
示例#11
0
PiSDFGraph* initPisdf_test0(Archi* archi, Stack* stack, int N){
	PiSDFGraph* top = CREATE(stack, PiSDFGraph)(
			0,0,0,0,0,1, archi, stack);

	top->addHierVertex(
			"top", test0(archi, stack, N),
			0, 0, 0);

	return top;
}
示例#12
0
int main(void)
{
	printf("Theoretical best case is N/2 = %d cycles\n", N / 2);
	test0();
	test1();
	test2();
	test3();
	test4();
	test5();
	
	return 0;
}
示例#13
0
	static void test0()
	{
		std::cout << "\nSemiExp::show()";
		std::cout << "\n--------------------";
		SemiExp test0(0);
		test0.push_back("semi1");
		test0.push_back("semi2");
		test0.push_back("semi3");
		test0.push_back("semi4");
		std::cout << "\n Showing Semi-Expression: ";
		std::cout << test0.show() << std::endl;
	}
示例#14
0
int main() {

    test0("alloctest: static buffer test");
    test1("alloctest: memory limit test");
    test2("alloctest: alloc/alloc_free test");
    test3("alloctest: negative/zero alloc test");
    test4("alloctest: alloc_freall test");
    test5("alloctest: double free test");
    test6("alloctest: struct test");

    _exit(0);
}
示例#15
0
int main( )
{
    test0();
    test1();
    test2();
    test3();
    test4();
    test5();
    test6();
    test7();
    test8();
    test9();
}
示例#16
0
文件: null2.c 项目: mabrand/freetds
static void
test(const char *type, int give_err)
{
	RETCODE ret;

	query("if object_id('#null') is not NULL drop table #null");

	dberrhandle(ignore_err_handler);
	dbmsghandle(ignore_msg_handler);

	printf("create table #null (n int, c %s NULL)\n", type);
	dbfcmd(dbproc, "create table #null (n int, c %s NULL)", type);
	dbsqlexec(dbproc);

	ret = dbresults(dbproc);

	dberrhandle(syb_err_handler);
	dbmsghandle(syb_msg_handler);

	if (ret != SUCCEED) {
		dbcancel(dbproc);
		if (!give_err)
			return;
		fprintf(stdout, "Was expecting a result set.\n");
		failed = 1;
		return;
	}

	query("insert into #null values(1, '')");
	query("insert into #null values(2, NULL)");
	query("insert into #null values(3, ' ')");
	query("insert into #null values(4, 'foo')");

	use_nullbind = 1;
	test0(1, "");
	test0(2, "aaaaaaaaaaaaaaa");
	test0(3, "");
	test0(4, "foo");

	use_nullbind = 0;
	test0(1, "");
	test0(2, "");
	test0(3, "");
	test0(4, "foo");

	query("drop table #null");
}
示例#17
0
MojErr MojSignalTest::run()
{
	MojErr err = test0();
	MojTestErrCheck(err);
	err = test1();
	MojTestErrCheck(err);
	err = test2();
	MojTestErrCheck(err);
	err = test3();
	MojTestErrCheck(err);

	MojTestAssert(TestHandler::s_instances == 0);

	return MojErrNone;
}
int main(int argc, char **argv) {
  try {
    test0();
    test1();
    test2();
    test3();
    test4();
    test5();
    test6();
    test7();
    test8();
    test9();
  };
  return EXIT_SUCCESS;
};
void 
cos_init(void)
{
	static int first = 0;
	union sched_param sp;
	if(first == 0){
		first = 1;

		sp.c.type = SCHEDP_PRIO;
		sp.c.value = 11;
		high = sched_create_thd(cos_spd_id(), sp.v, 0, 0);
	} else {
		test0();
	}
	return;
}
示例#20
0
void ofApp::setup()
{
    ofxNet::IPAddressRange range0;
    ofxNet::IPAddressRange range1(Poco::Net::IPAddress("192.168.0.1"));
    ofxNet::IPAddressRange range2(Poco::Net::IPAddress("192.168.0.33"), 23);
    ofxNet::IPAddressRange range3("2001:0db8:85a3::8a2e:0370:7334/64");
    ofxNet::IPAddressRange range4("192.168.5.219/28");
    ofxNet::IPAddressRange range5("2001:0db8:85a3::8a2e:0370:7334");
    ofxNet::IPAddressRange range6("0.0.0.0/31");

    std::cout << toString(range0);
    std::cout << "-----" << std::endl;
    std::cout << toString(range1);
    std::cout << "-----" << std::endl;
    std::cout << toString(range2);
    std::cout << "-----" << std::endl;
    std::cout << toString(range3);
    std::cout << "-----" << std::endl;
    std::cout << toString(range4);
    std::cout << "-----" << std::endl;
    std::cout << toString(range5);
    std::cout << "-----" << std::endl;

    Poco::Net::IPAddress test0("192.168.0.1");
    Poco::Net::IPAddress test1("2001:0db8:85a3::8a2e:0370:7334");
    Poco::Net::IPAddress test2("127.0.0.2");
    Poco::Net::IPAddress test3("10.10.10.2");
    Poco::Net::IPAddress test4("::FFFF");
    Poco::Net::IPAddress test5("0.0.0.1");

    std::cout << toString(range0, test0) << std::endl;
    std::cout << toString(range0, test1) << std::endl;
    std::cout << toString(range0, test2) << std::endl;
    std::cout << toString(range0, test3) << std::endl;
    std::cout << toString(range0, test4) << std::endl;
    std::cout << toString(range0, test4) << std::endl;

    std::cout << toString(range0, test5) << std::endl;
    std::cout << toString(range6, test5) << std::endl;

    ofxNet::IPAddressRange a("192.168.5.219/28");
    ofxNet::IPAddressRange b("192.168.5.219/27");

    std::cout << toString(a, b) << std::endl;
    std::cout << toString(b, a) << std::endl;

}
int main () {
    test0();
    test1();
    test2();
    
    {
    test("abcde", 5, 1, "", 0);
    test("abcde", 2, 4, "", 3);
    test("abcde", 2, 4, "abcde", 2);
    test("ABCde", 2, 4, "abcde", -1);
    }

    {
    test(L"abcde", 5, 1, L"", 0);
    test(L"abcde", 2, 4, L"", 3);
    test(L"abcde", 2, 4, L"abcde", 2);
    test(L"ABCde", 2, 4, L"abcde", -1);
    }

#if __cplusplus >= 201103L
    {
    test(u"abcde", 5, 1, u"", 0);
    test(u"abcde", 2, 4, u"", 3);
    test(u"abcde", 2, 4, u"abcde", 2);
    test(u"ABCde", 2, 4, u"abcde", -1);
    }

    {
    test(U"abcde", 5, 1, U"", 0);
    test(U"abcde", 2, 4, U"", 3);
    test(U"abcde", 2, 4, U"abcde", 2);
    test(U"ABCde", 2, 4, U"abcde", -1);
    }
#endif

#if _LIBCPP_STD_VER > 11
    {
    typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
    constexpr SV  sv1 { "abcde", 5 };
    constexpr SV  sv2 { "abcde", 0 };
    static_assert ( sv1.compare(5, 1, sv2) == 0, "" );
    static_assert ( sv1.compare(2, 4, sv2) == 1, "" );
    }
#endif
}
示例#22
0
int main(void) {
  // Create vectors
  float *a = createvect(NUM);

  // Assign values
  setvect(NUM, a, 1);

  // and invoke the function written in the vector language
  // and read values from c
  
  // test 0
  test0(NUM, a);
  printf("0: a = ");
  printvect(NUM, a);
  printf("\n");
  
  return 0;
}
示例#23
0
int main () {
int ret = 0;

	printf ("Direct case testing of CPP core functions\n");

	ret += test0 ();
	ret += test1 ();
	ret += test2 ();
	ret += test3 ();
	ret += test4 ();
	ret += test5 ();
	ret += test6 ();
	ret += test7 ();
	ret += test8 ();
	ret += test9 ();
	ret += test10 ();
	ret += test11 ();
	ret += test12 ();
	ret += test13 ();
	ret += test14 ();
	ret += test15 ();
	ret += test16 ();
	ret += test17 ();
	ret += test18 ();
	ret += test19 ();
	ret += test20 ();
	ret += test21 ();
	ret += test22 ();
	ret += test23 ();
	ret += test24 ();
	ret += test25 ();
	ret += test26 ();
	ret += test27 ();
	ret += test28 ();
	ret += test29 ();
	ret += test30 ();
	ret += test31 ();

	printf ("# test failures: %d\n", ret);

	return 0;
}
示例#24
0
int main(int argv, char** argc) {
  if (argv > 1) iterations = atoi(argc[1]);
  fill(dpb, dpe, double(init_value));
  fill(Dpb, Dpe, Double(init_value));
  test0(dpb, dpe);
  test(dpb, dpe, d);
  test(Dpb, Dpe, D);
  test(dPb, dPe, d);
  test(DPb, DPe, D);
  test(rdpb, rdpe, d);
  test(rDpb, rDpe, D);
  test(rdPb, rdPe, d);
  test(rDPb, rDPe, D);
  test(rrdpb, rrdpe, d);
  test(rrDpb, rrDpe, D);
  test(rrdPb, rrdPe, d);
  test(rrDPb, rrDPe, D);
  summarize();
  return 0;
}
示例#25
0
int main()
{
    RTTEST hTest;
    int rc = RTTestInitAndCreate("tstRTCType", &hTest);
    if (rc)
        return rc;
    RTTestBanner(hTest);

#ifdef VERIFY_TEST_DATA
    test0();
#endif
    test1();
    test2();
    test3();

    /*
     * Summary.
     */
    return RTTestSummaryAndDestroy(hTest);
}
示例#26
0
void runAllTests() {
	srand(time(0));
	simpleTest0();
	simpleTest1();
	simpleTest2();
	simpleTest3();
	simpleTest4();
	simpleTest5();
	simpleTest6();

	test0();
	for (size_t i = 0; i < 100; ++i) {
		test1(100);
	}

	for (size_t i = 0; i < 100; ++i) {
		ComplexTest().test(100);
	}
	return;
}
示例#27
0
int main(int argc, char *argv[])
{
#ifdef XBYAK32
	puts("32bit");
#else
	puts("64bit");
#endif
	try {
		int n = atoi(argc == 1 ? "1223" : argv[1]);
		Test test0(n), test1(n + 1);
		test0.beginThread();
		test1.beginThread();

		test0.joinThread();
		test1.joinThread();
	} catch (std::exception& e) {
		printf("ERR:%s\n", e.what());
	} catch (...) {
		printf("unknown error\n");
	}
}
int main()
{
    {
        test0(std::forward_as_tuple());
    }
    {
        test1a(std::forward_as_tuple(1));
    }
    {
        int i = 2;
        test1b(std::forward_as_tuple(i));
    }
    {
        double i = 2.5;
        char c = 'a';
        test2a(std::forward_as_tuple(i, c));
#if _LIBCPP_STD_VER > 11
        static_assert ( test3 (std::forward_as_tuple(i, c)) == 2, "" );
#endif
    }
}
示例#29
0
int main()
{
    {
    typedef std::string S;
    test0('a', S(""), S("a"));
    test0('a', S("12345"), S("a12345"));
    test0('a', S("1234567890"), S("a1234567890"));
    test0('a', S("12345678901234567890"), S("a12345678901234567890"));
    
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

    test1('a', S(""), S("a"));
    test1('a', S("12345"), S("a12345"));
    test1('a', S("1234567890"), S("a1234567890"));
    test1('a', S("12345678901234567890"), S("a12345678901234567890"));

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
    }
#if __cplusplus >= 201103L
    {
    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
    test0('a', S(""), S("a"));
    test0('a', S("12345"), S("a12345"));
    test0('a', S("1234567890"), S("a1234567890"));
    test0('a', S("12345678901234567890"), S("a12345678901234567890"));
    
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

    test1('a', S(""), S("a"));
    test1('a', S("12345"), S("a12345"));
    test1('a', S("1234567890"), S("a1234567890"));
    test1('a', S("12345678901234567890"), S("a12345678901234567890"));

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
    }
#endif
}
示例#30
0
文件: test_sp1.C 项目: vonwenm/pbft
int
main (int argc, char *argv[])
{
    sp::gc::std_cfg_t cfg;
    cfg._n_b_arenae = 2;
    cfg._size_b_arenae = 1;
    cfg._smallobj_lim = 0;
    sp::gc::mgr_t<>::set (New sp::gc::std_mgr_t<> (cfg));

    test0 ();

    for (int i = 0; i < 10; i++) {
        sp::gc::mgr_t<>::get ()->sanity_check();
        test1();
        sp::gc::mgr_t<>::get ()->sanity_check();
        test2();
        sp::gc::mgr_t<>::get ()->sanity_check();
    }

    if (0) test3();
    test4();
}