Esempio n. 1
0
static void test_variables( libvlc_instance_t *p_vlc )
{
    libvlc_int_t *p_libvlc = p_vlc->p_libvlc_int;
    srand( time( NULL ) );

    log( "Testing for integers\n" );
    test_integer( p_libvlc );

    log( "Testing for booleans\n" );
    test_booleans( p_libvlc );

    log( "Testing for floats\n" );
    test_floats( p_libvlc );

    log( "Testing for strings\n" );
    test_strings( p_libvlc );

    log( "Testing for addresses\n" );
    test_address( p_libvlc );

    log( "Testing the callbacks\n" );
    test_callbacks( p_libvlc );

    log( "Testing the limits\n" );
    test_limits( p_libvlc );

    log( "Testing choices\n" );
    test_choices( p_libvlc );

    log( "Testing var_Change()\n" );
    test_change( p_libvlc );

    log( "Testing type at creation\n" );
    test_creation_and_type( p_libvlc );
}
Esempio n. 2
0
void test_all(Ardb& db)
{
	test_strings(db);
	test_hashs(db);
	test_lists(db);
	test_sets(db);
	test_zsets(db);
	test_tables(db);
	test_bitsets(db);
	test_misc(db);
}
Esempio n. 3
0
int main(void)
{
    int i;

    test_strings();

    test_integers();

    for (i = 10; i < 100; ++i)
	test_integers_multi(i);

    return 0;
}
Esempio n. 4
0
int main(int argc, char const *argv[])
{
      test_bit_algo();
      test_quicksort();
      test_binary_search();
      test_kadane();
      test_knapsack();
      test_some_math();
      test_strings();
      test_arrays();
      printf("YEAH!\n");

      return 0;
}
Esempio n. 5
0
int main(int, char**) {
  plan_tests(69);
  test_integrals();
  test_strings();
  test_pointers();
  test_double();
  test_concat();
  test_suffix();
  test_to();
  test_path_cat();
  test_basename_dirname();
  test_operator();
  test_split();

  return exit_status();
}
Esempio n. 6
0
void test_output()
{
	if (output[0] != BERT_MAGIC)
	{
		test_fail("bert_encoder_push did not add the magic byte");
	}

	if (output[1] != BERT_ATOM)
	{
		test_fail("bert_encoder_push did not add the SMALL_INT magic byte");
	}

	if (output[3] != EXPECTED_LENGTH)
	{
		test_fail("bert_encoder_push encoded %u as the atom length, expected %u",output[3],EXPECTED_LENGTH);
	}

	test_strings((const char *)(output+4),EXPECTED,EXPECTED_LENGTH);
}
Esempio n. 7
0
int UHD_SAFE_MAIN(int argc, char *argv[])
{
    (void) argc;
    (void) argv;

    uhd::set_thread_priority_safe();

    uhd::usrp::multi_usrp::sptr usrp = uhd::usrp::multi_usrp::make(std::string(""));

    usrp->dump_tree("");

    test_strings(usrp);
    test_ints(usrp);
    test_doubles(usrp);
    test_bools(usrp);
    test_stream_cmd(usrp);
    test_time_specs(usrp);
    test_sfpa_port_change(usrp);
    test_trigger_settings(usrp);

    return 0;
}
Esempio n. 8
0
/*-------------------------------------------------------------------------
* test H5LTtext_to_dtype function
*-------------------------------------------------------------------------
*/
static int test_text_dtype(void)
{
    TESTING("H5LTtext_to_dtype");

    if(test_integers()<0)
        goto out;

    if(test_fps()<0)
        goto out;

    if(test_strings()<0)
        goto out;

    if(test_opaques()<0)
        goto out;

    if(test_enums()<0)
        goto out;

    if(test_variables()<0)
        goto out;

    if(test_arrays()<0)
        goto out;

    if(test_compounds()<0)
        goto out;

    if(test_compound_bug()<0)
        goto out;

    if(test_complicated_compound()<0)
        goto out;

    return 0;

out:
    return -1;
}
Esempio n. 9
0
int
ACE_TMAIN (int argc, ACE_TCHAR *argv[])
{
  int status = 0;

  try
    {
      CORBA::ORB_var orb =
        CORBA::ORB_init (argc, argv);

      ::Test::vtp_init *vtp_factory = 0;
      ACE_NEW_THROW_EX (vtp_factory,
                        ::Test::vtp_init,
                        CORBA::NO_MEMORY ());
      CORBA::ValueFactoryBase_var vtp_factory_owner = vtp_factory;

      orb->register_value_factory (vtp_factory->tao_repository_id (),
                                   vtp_factory);

      if (parse_args (argc, argv) != 0)
        return 1;

      CORBA::Object_var object =
        orb->string_to_object (ior);

      Test::A_var server =
        Test::A::_narrow (object.in ());

      if (CORBA::is_nil (server.in ()))
        {
          ACE_ERROR_RETURN ((LM_ERROR,
                             ACE_TEXT ("Object reference <%s> is nil\n"),
                             ior),
                            1);
        }

      status |= test_strings (server.in ());

      status |= test_sequences (server.in ());

      status |= test_arrays (server.in ());

      status |= test_structs (server.in ());

      status |= test_unions (server.in ());

      status |= test_valueboxes (server.in ());

      status |= test_valuetypes (server.in (), vtp_factory);

      status |= test_exceptions (server.in ());

      server->shutdown ();

      orb->destroy ();
    }
  catch (const CORBA::Exception& ex)
    {
      ex._tao_print_exception ("Caught exception in client:");
      return 1;
    }

  return status;
}
Esempio n. 10
0
int Test::all() {

	clock_t begin = clock();
	exeTime = 0;

	test_general();
	test_types();
	test_booleans();
	test_numbers();
	test_strings();
	test_arrays();
	test_intervals();
	test_map();
	test_set();
	test_objects();
	test_functions();
	test_classes();
	test_loops();
	test_operators();
	test_references();
	test_exceptions();
	test_operations();
	test_system();
	test_json();
	test_files();
	test_doc();
	test_utils();

	double elapsed_secs = double(clock() - begin) / CLOCKS_PER_SEC;
	int errors = (total - success_count);
	int leaks = (obj_created - obj_deleted);
	int mpz_leaks = (mpz_obj_created - mpz_obj_deleted);

	std::ostringstream line1, line2, line3, line4;
	line1 << "Total : " << total << ", success : " << success_count << ", errors : " << errors;
	line2 << "Total time : " << elapsed_secs * 1000 << " ms";
	line3 << "Objects destroyed : " << obj_deleted << " / " << obj_created << " (" << leaks << " leaked)";
	line4 << "MPZ objects destroyed : " << mpz_obj_deleted << " / " << mpz_obj_created << " (" << mpz_leaks << " leaked)";
	unsigned w = std::max(line1.str().size(), std::max(line2.str().size(), std::max(line3.str().size(), line4.str().size())));

	auto pad = [](std::string s, int l) {
		l -= s.size();
		while (l-- > 0) s += " ";
		return s;
	};
	std::cout << "┌";
	for (unsigned i = 0; i < w + 2; ++i) std::cout << "─";
	std::cout << "┐" << std::endl;
	std::cout << "│ " << pad(line1.str(), w) << " │" << std::endl;
	std::cout << "│ " << pad(line2.str(), w) << " │" << std::endl;
	std::cout << "│ " << pad(line3.str(), w) << " │" << std::endl;
	std::cout << "│ " << pad(line4.str(), w) << " │" << std::endl;
	std::cout << "├";
	for (unsigned i = 0; i < w + 2; ++i) std::cout << "─";
	std::cout << "┤";
	std::cout << std::endl;

	int result = abs(errors) + abs(leaks) + abs(mpz_leaks);
	if (result == 0) {
		std::cout << "│ " << pad("GOOD! ✔", w + 2) << " │" << std::endl;
	} else {
		std::cout << "│ " << pad("BAD! : " + std::to_string(result) + " error(s) ✘", w + 2) << " │" << std::endl;
	}
	std::cout << "└";
	for (unsigned i = 0; i < w + 2; ++i) std::cout << "─";
	std::cout << "┘" << std::endl;

	for (const auto& error : failed_tests) {
		std::cout << " " << error << std::endl;
	}
	if (failed_tests.size()) {
		std::cout << std::endl;
	}
	return result;
}
Esempio n. 11
0
int main()
#endif
{
	do
	{
		int y, x;

		for(y = 0; y < 16; ++y){
			printf("{");
			for(x = 0; x < 16; ++x){
				printf("%d, ", (2 * ( y / 8 ) + ( x / 8 )));
			}
			printf("}\n");
		}


		/* Print copyright information */
		printf("Doubango Project\nCopyright (C) 2009 Mamadou Diop \n\n");

#if RUN_TEST_LISTS || RUN_TEST_ALL
		/* linked lists */
		test_basic_list();
		printf("\n\n");
		test_complex_list();
		printf("\n\n");
		test_filtered_list();
		printf("\n\n");
#endif

#if RUN_TEST_HEAP || RUN_TEST_ALL
		/* heap */
		test_heap();
		printf("\n\n");
#endif

#if RUN_TEST_STRINGS || RUN_TEST_ALL
		/* strings */
		test_strings();
		printf("\n\n");
#endif

#if RUN_TEST_URL || RUN_TEST_ALL
		/* url */
		test_url();
		printf("\n\n");
#endif

#if RUN_TEST_THREADS || RUN_TEST_ALL
		/* threads */
		test_threads();
		printf("\n\n");
#endif

#if RUN_TEST_MUTEX || RUN_TEST_ALL
		/* mutex */
		test_mutex();
		printf("\n\n");
#endif

#if RUN_TEST_CONDWAIT || RUN_TEST_ALL
		/* condwait */
		test_condwait();
		printf("\n\n");
#endif

#if RUN_TEST_SEMAPHORE || RUN_TEST_ALL
		/* semaphore */
		test_semaphore();
		printf("\n\n");
#endif

#if RUN_TEST_SAFEOBJECT || RUN_TEST_ALL
	/* safe object */
		//test_safeobject();
		printf("\n\n");
#endif

#if RUN_TEST_OBJECT || RUN_TEST_ALL
	/* object */
		//test_object();
		printf("\n\n");
#endif

#if RUN_TEST_PARAMS || RUN_TEST_ALL
		/* parameters */
		test_params();
		printf("\n\n");
#endif

#if RUN_TEST_OPTIONS || RUN_TEST_ALL
		/* options */
		test_options();
		printf("\n\n");
#endif

#if RUN_TEST_TIMER || RUN_TEST_ALL
		/* timer */
		test_timer();
		printf("\n\n");
#endif
		
#if RUN_TEST_RUNNABLE || RUN_TEST_ALL
		/* test runnable. */
		test_runnable();
		printf("\n\n");
#endif


#if RUN_TEST_BUFFER || RUN_TEST_ALL
		/* test buffer */
		test_buffer();
#endif


#if RUN_TEST_MD5 || RUN_TEST_ALL
		/* test md5 and hmac_md5 */
		test_md5();
		test_hmac_md5();
#endif

#if RUN_TEST_SHA1 || RUN_TEST_ALL
		/* test sha1 and hmac_sha-1 */
		test_sha1();
		test_hmac_sha1();
#endif

#if RUN_TEST_BASE64 || RUN_TEST_ALL
		/* test base64 encoding/decoding */
		test_base64();
#endif

#if RUN_TEST_UUID || RUN_TEST_ALL
		/* test fake UUID (version5) */
		test_uuid();
#endif

#if RUN_TEST_FSM || RUN_TEST_ALL
		/* test FSM */
		test_fsm();
#endif

	}
	while(LOOP);

	getchar();

	return 0;
}
Esempio n. 12
0
File: main.c Progetto: af-inet/chash
int main(char argc, char **argv){
	test_strings();
}
Esempio n. 13
0
int main(int argc,char **argv) {
   test_strings();
   test_ints();
   test_structs();
}