Esempio n. 1
0
/*
 * Run tests for dsize = n
 */
static void do_tests(uint32_t n) {
  cset_t c1, c2;
  bset_t b1, b2, b;
  uint32_t i;

  assert(n > 0);
  printf("\n============================"
	 "\n    DOMAIN SIZE = %"PRIu32
	 "\n============================\n\n", n);

  init_cset(&c1);
  cset_init_empty(&c1, n);
  init_cset(&c2);
  cset_init_empty(&c2, n);
  init_bset(&b1, n);
  init_bset(&b2, n);
  init_bset(&b, n);

  test_empty(&c1, &b1);
  test_empty(&c1, &b1);
  test_fill(&c1, &b1);
  test_fill(&c1, &b1);

  for (i=0; i<20; i++) {
    random_test(&c1, &c2, &b1, &b2, &b);
  }

  delete_bset(&b2);
  delete_bset(&b1);
  delete_bset(&b);
  delete_cset(&c2);
  delete_cset(&c1);
}
Esempio n. 2
0
void test(boost::basic_regex<charT, traits>& r, const test_invalid_regex_tag&)
{
   const std::basic_string<charT>& expression = test_info<charT>::expression();
   boost::regex_constants::syntax_option_type syntax_options = test_info<charT>::syntax_options();
   //
   // try it with exceptions disabled first:
   //
   try
   {
      if(0 == r.assign(expression, syntax_options | boost::regex_constants::no_except).status())
      {
         BOOST_REGEX_TEST_ERROR("Expression compiled when it should not have done so.", charT);
      }
      test_empty(r);
   }
   catch(...)
   {
      BOOST_REGEX_TEST_ERROR("Unexpected exception thrown.", charT);
   }
   //
   // now try again with exceptions:
   //
   bool have_catch = false;
   try{
      r.assign(expression, syntax_options);
#ifdef BOOST_NO_EXCEPTIONS
      if(r.status())
         have_catch = true;
#endif
   }
   catch(const boost::bad_expression&)
   {
      have_catch = true;
      test_empty(r);
   }
   catch(const std::runtime_error& r)
   {
      have_catch = true;
      BOOST_REGEX_TEST_ERROR("Expected a bad_expression exception, but a std::runtime_error instead: " << r.what(), charT);
   }
   catch(const std::exception& r)
   {
      have_catch = true;
      BOOST_REGEX_TEST_ERROR("Expected a bad_expression exception, but a std::exception instead: " << r.what(), charT);
   }
   catch(...)
   {
      have_catch = true;
      BOOST_REGEX_TEST_ERROR("Expected a bad_expression exception, but got an exception of unknown type instead", charT);
   }
   if(!have_catch)
   {
      // oops expected exception was not thrown:
      BOOST_REGEX_TEST_ERROR("Expected an exception, but didn't find one.", charT);
   }

}
Esempio n. 3
0
static bool run_test(
    Queue * queue)
{
    TEST(void *,
         "%p",
             ((void *)queue),
         !=,
         NULL);

    if (!test_empty(queue))
        return false;

    if (!push_range(queue, 0, 0, 4000))
        return false;
    if (!pop_range(queue, 4000, 0, 1000))
        return false;
    if (!push_range(queue, 3000, 4000, 6000))
        return false;
    if (!pop_range(queue, 5000, 1000, 6000))
        return false;

    if (!test_empty(queue))
        return false;

    if (!push_range(queue, 0, 0, 1000))
        return false;
    if (!pop_range(queue, 1000, 0, 999))
        return false;
    if (!push_range(queue, 1, 1000, 6000))
        return false;
    if (!pop_range(queue, 5001, 999, 6000))
        return false;

    if (!test_empty(queue))
        return false;

    if (!push_range(queue, 0, 0, 2000))
        return false;
    if (!pop_range(queue, 2000, 0, 1998))
        return false;
    if (!push_range(queue, 2, 2000, 10000))
        return false;
    if (!pop_range(queue, 8002, 1998, 10000))
        return false;

    if (!test_empty(queue))
        return false;

    Queue_free(queue);

    return true;
}
Esempio n. 4
0
DEF_TEST(Codec_Empty, r) {
    // Test images that should not be able to create a codec
    test_empty(r, "empty_images/zero-dims.gif");
    test_empty(r, "empty_images/zero-embedded.ico");
    test_empty(r, "empty_images/zero-width.bmp");
    test_empty(r, "empty_images/zero-height.bmp");
    test_empty(r, "empty_images/zero-width.jpg");
    test_empty(r, "empty_images/zero-height.jpg");
    test_empty(r, "empty_images/zero-width.png");
    test_empty(r, "empty_images/zero-height.png");
    test_empty(r, "empty_images/zero-width.wbmp");
    test_empty(r, "empty_images/zero-height.wbmp");
}
Esempio n. 5
0
int
main ( int argc, char *argv[] )
{
	int failed = 0;
	int ntest = 1000;
	int i;
	newstr s;
	newstr_init( &s );
	for ( i=0; i<ntest; ++i )
		failed += test_empty( &s );
	for ( i=0; i<ntest; ++i)
		failed += test_addchar( &s );
	for ( i=0; i<ntest; ++i)
		failed += test_strcat( &s );
	for ( i=0; i<ntest; ++i)
		failed += test_strcpy( &s );
	for ( i=0; i<ntest; ++i)
		failed += test_segcpy( &s );
	for ( i=0; i<ntest; ++i)
		failed += test_segcat( &s );
	for ( i=0; i<ntest; ++i)
		failed += test_findreplace( &s );
	newstr_free( &s );
	if ( !failed ) {
		printf( "%s: PASSED\n", progname );
		return EXIT_SUCCESS;
	} else {
		printf( "%s: FAILED\n", progname );
		return EXIT_FAILURE;
	}
	return EXIT_SUCCESS;
}
Esempio n. 6
0
DEF_TEST(document_tests, reporter) {
    test_empty(reporter);
    test_abort(reporter);
    test_abortWithFile(reporter);
    test_file(reporter);
    test_close(reporter);
}
static void
empty_activation_cb (CORBA_Object   obj,
                     const char    *error_reason, 
                     gpointer       user_data)
{
        CORBA_Environment ev;
	gboolean          ret = FALSE;
	char             *repo_id = user_data;

        CORBA_exception_init (&ev);

        if (error_reason)
                g_warning ("Async activation error activating '%s' : '%s'", repo_id, error_reason);

        else if (test_object (obj, &ev, "by async query"))
                ret = test_empty (obj, &ev, "by async query");

	if (ret) {
		passed++;
		fprintf (stderr, "PASSED %d of %d: async activation\n", passed + failed, TOTAL_TEST_SCORE);
	} else {
		failed++;
		fprintf (stderr, "FAILED %d of %d: async activation\n", passed + failed, TOTAL_TEST_SCORE);
	}

        CORBA_exception_free (&ev);

        async_done++;
}
Esempio n. 8
0
void run()
{
    test_empty();
    test_space();
    test_alpha();
    test_alpha_bravo();
    test_escape_quote();
    test_escape_reverse_solidus();
    test_escape_solidus();
    test_escape_backspace();
    test_escape_formfeed();
    test_escape_newline();
    test_escape_carriage_return();
    test_escape_tab();
    test_escape_unicode_one();
    test_escape_unicode_a();
    test_escape_unicode_0123();
    test_escape_unicode_4567();
    test_escape_unicode_89AB();
    test_escape_unicode_CDEF();
    fail_escape_unicode_missing_one();
    fail_escape_unicode_missing_two();
    fail_escape_unicode_missing_three();
    fail_escape_unicode_missing_four();
    fail_escape_unicode_eof();
    fail_escape_unicode_eof_one();
    fail_escape_unicode_eof_two();
    fail_escape_unicode_eof_three();
    fail_escape_unicode_eof_four();
    fail_escape();
    fail_begin();
    fail_as_int();
    fail_as_float();
}
Esempio n. 9
0
void
main_task(intptr_t exinf)
{
	test_start(__FILE__);

	test_empty();

	syslog(LOG_NOTICE, "-- for fitting parameters --");
	test_dly_nse(0);
	test_dly_nse(SIL_DLY_TIM1);
	test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 1);
	test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 2);
	test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 3);
	test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 4);
	test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 5);
	test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 10);
	test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 20);
	test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 50);

	syslog(LOG_NOTICE, "-- for checking boundary conditions --");
	test_dly_nse(SIL_DLY_TIM1 + 1);
	test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 1 + 1);
	test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 2 + 1);

	test_finish();
}
Esempio n. 10
0
int main(int argc , char ** argv) {
  const char * site_config_file = argv[1];
  test_empty();
  test_init( site_config_file );
    
  exit(0);
}
Esempio n. 11
0
int main ( int argc, char *argv [] ) {
    int retVal = 0;
    retVal += test_empty ();
    retVal += test_counted ();
    retVal += test_exception_in_constructor ();
    retVal += test_exception_in_destructor ();
    return retVal;
    }
DEF_TEST(document_tests, reporter) {
    REQUIRE_PDF_DOCUMENT(document_tests, reporter);
    test_empty(reporter);
    test_abort(reporter);
    test_abortWithFile(reporter);
    test_file(reporter);
    test_close(reporter);
}
static void TestAAClip(skiatest::Reporter* reporter) {
    test_empty(reporter);
    test_path_bounds(reporter);
    test_irect(reporter);
    test_rgn(reporter);
    test_path_with_hole(reporter);
    test_regressions();
    test_nearly_integral(reporter);
}
Esempio n. 14
0
void run()
{
    test_empty();
    test_spaces();
    test_tabs();
    test_carriage_returns();
    test_newlines();
    test_junk();
}
Esempio n. 15
0
int main()
{ 
  test_simple();
  test_different();
  test_structs();
  test_same();
  test_empty();
  return 0;
}
Esempio n. 16
0
int main () {
    int retVal = 0;
    retVal += test_empty ();
    retVal += test_counted ();
#ifndef LIBCXXABI_HAS_NO_EXCEPTIONS
    retVal += test_exception_in_constructor ();
    retVal += test_exception_in_destructor ();
#endif
    return retVal;
    }
Esempio n. 17
0
DEF_TEST(AAClip, reporter) {
    test_empty(reporter);
    test_path_bounds(reporter);
    test_irect(reporter);
    test_rgn(reporter);
    test_path_with_hole(reporter);
    test_regressions();
    test_nearly_integral(reporter);
    test_really_a_rect(reporter);
    test_crbug_422693(reporter);
}
Esempio n. 18
0
int main(int argc, char ** argv)
{
#ifndef DISABLE_BOOST_PROGRAM_OPTIONS
  test_default();
  test_good();
  test_empty();

  return 0;
#else
  return 77;
#endif  // DISABLE_BOOST_PROGRAM_OPTIONS
}
Esempio n. 19
0
int main(int argc, char *argv[]) {
        arg_keep = argc > 1;

        /* journal_file_open requires a valid machine id */
        if (access("/etc/machine-id", F_OK) != 0)
                return EXIT_TEST_SKIP;

        test_non_empty();
        test_empty();

        return 0;
}
int
main()
    {
    basic_test();
    exception_safety_test();
    test_empty();
    test_basic_throw_catch();
    test_catch_add_info();
    test_add_tuple();
    test_lifetime();
    return boost::report_errors();
    }
Esempio n. 21
0
File: main.c Progetto: fdotli/libu
int main (void)
{
    int opts = U_RB_OPT_IMPL_MALLOC | U_RB_OPT_USE_CONTIGUOUS_MEM;

    con_err_if (test_full(opts));
    con_err_if (test_empty(opts));
    con_err_if (test_advance(opts));
    con_err_if (test_full_advance(opts));

    return 0;
err:
    return 1;
}
Esempio n. 22
0
int main(int argc, char **argv) {
  grpc_test_init(argc, argv);
  test_full();
  test_empty();
  test_trace_only();
  test_span_only();
  test_encode_decode();
  test_corrupt();
  test_no_span_options();
  test_buffer_size();

  return 0;
}
Esempio n. 23
0
int main( int argc , char ** argv) {
  test_empty();
  test_char();
  test_join();
  test_reverse();
  test_iget_as_int();
  test_iget_as_bool();
  test_iget_as_double();
  test_split();
  test_matching();
  test_unique();
  test_predicate_matching();
  exit(0);
}
int
main()
{
    BOOST_STATIC_ASSERT((phx::stl::has_mapped_type<std::map<int, int> >::value));

    std::map<int, int> const data = build_map();
    test_begin(data);
    test_clear(data);
    test_empty(data);
    test_end(data);
    test_map_erase(data);
    test_get_allocator(data);
    return boost::report_errors();
}
Esempio n. 25
0
int main(int argc, char **argv) {
  grpc_test_init(argc, argv);
  gpr_time_init();
  srand((unsigned)gpr_now(GPR_CLOCK_REALTIME).tv_nsec);

  test_empty();
  test_single_item();
  test_two_items();
  test_reset_clear();
  test_extend();
  test_stress();

  return 0;
}
Esempio n. 26
0
DEF_TEST(RoundRect, reporter) {
    test_round_rect_basic(reporter);
    test_round_rect_rects(reporter);
    test_round_rect_ovals(reporter);
    test_round_rect_general(reporter);
    test_round_rect_iffy_parameters(reporter);
    test_inset(reporter);
    test_round_rect_contains_rect(reporter);
    test_round_rect_transform(reporter);
    test_issue_2696(reporter);
    test_tricky_radii(reporter);
    test_empty_crbug_458524(reporter);
    test_empty(reporter);
}
int main()
{
	test_ensure_empty();
	test_initialise();
	test_ensure_empty();
	test_append();
	test_ensure_empty();
	test_empty();
	test_ensure_empty();
	test_null();
	test_ensure_empty();

	printf("tests passed\n");
	return 0;
}
Esempio n. 28
0
int
main()
{
    BOOST_STATIC_ASSERT((!phx::stl::has_mapped_type<std::unordered_multiset<int> >::value));
    BOOST_STATIC_ASSERT((phx::stl::has_key_type<std::unordered_multiset<int> >::value));

    std::unordered_multiset<int> const data = build_unordered_multiset();
    test_begin(data);
    test_clear(data);
    test_empty(data);
    test_end(data);
    test_set_erase(data);
    test_get_allocator(data);
    return boost::report_errors();
}
Esempio n. 29
0
int
main()
{
    BOOST_STATIC_ASSERT((!phx::stl::has_mapped_type<std::list<int> >::value));
    BOOST_STATIC_ASSERT((!phx::stl::has_key_type<std::list<int> >::value));

    std::list<int> const data = build_list();
    test_empty(data);
    test_end(data);
    test_erase(data);
    test_front(data);
    test_get_allocator(data);
    test_insert(data);
    test_max_size(data);
    return boost::report_errors();
}
Esempio n. 30
0
int main(int argc, char *argv[]) {
        arg_keep = argc > 1;

        test_setup_logging(LOG_INFO);

        /* journal_file_open requires a valid machine id */
        if (access("/etc/machine-id", F_OK) != 0)
                return log_tests_skipped("/etc/machine-id not found");

        test_non_empty();
        test_empty();
#if HAVE_XZ || HAVE_LZ4
        test_min_compress_size();
#endif

        return 0;
}