Example #1
0
void lua_serialize_tests(lua_State* LS) {
	L = LS;
	UNIT_TEST(lua_serialize_novalue);
	UNIT_TEST(lua_serialize_number);
	UNIT_TEST(lua_serialize_table);
	UNIT_TEST(lua_serialize_nested_table);
	L = NULL;
}
Example #2
0
void test_all(){
    /* register testing function */
    UNIT_TEST(test_HTTP2_playload_add());
    UNIT_TEST(test_HTTP2_frame_createe());
    UNIT_TEST(test_HTTP2_playload_create());
    UNIT_TEST(test_HTTP2_frame_decode());
    REPORT();
}
Example #3
0
int main( int argc, char ** argv )
{
	// Test catching DynLoader::LoaderException
	try
	{
		throw DynLoader::LoaderException("Some text");
	}
	catch(const DynLoader::LoaderException & ex)
	{
		fprintf(stderr, "OK: LoaderException caught: %s\n", ex.what());
		UNIT_TEST(true);
	}
	catch(...)
	{
		UNIT_TEST(false);
	}
	
	UNIT_TEST(true)

	return 0;
}
Example #4
0
void run_core_tests() {
	UNIT_TEST(test_core);
}
Example #5
0
void run_update_tests() {
	UNIT_TEST(test_update_perform);
	UNIT_TEST(test_update_decision);
	UNIT_TEST(test_update_check);
    UNIT_TEST(test_update_header_json_functions);
}
Example #6
0
void run_zip_tests() {
	UNIT_TEST(test_list_zip);
}
Example #7
0
void run_digest_tests() {
	UNIT_TEST(test_digest_set);
}
Example #8
0
void run_error_tests() {
	UNIT_TEST(test_error_set);
}
Example #9
0
int main( int argc, char ** argv )
{
	if ( argc != 2 )
	{
		fprintf( stderr, "ERROR: Usage %s <libName>\n", argv[ 0 ] );\
		return -1;
	}

	PDL::DynamicLibrary lib1;
	PDL::DynamicLibrary lib2;
	PDL::DynamicLibrary lib3;
	
	// Test DynamicLibrary::Open()
	UNIT_TEST( !lib1.Open( "SomeDefinitelyNotExistentFile" ) );
	fprintf( stderr, "LastError: (%s)\n", lib1.GetLastError().c_str() );

	UNIT_TEST( lib2.Open( argv[ 1 ] ) );
	fprintf( stderr, "LastError: (%s)\n", lib2.GetLastError().c_str() );
	
	UNIT_TEST( !lib3.Open( 0 ) );
	fprintf( stderr, "LastError: (%s)\n", lib3.GetLastError().c_str() );
	
	// Test DynamicLibrary::Opened()
	UNIT_TEST( !lib1.Opened() );
	UNIT_TEST( lib2.Opened() );
	
	// Test DynamicLibrary::GetInstance()
	try
	{
		lib1.GetInstance( "MyTestClass1" );
		UNIT_TEST( false );
	}
	catch( PDL::LoaderException & ex )
	{
		fprintf( stderr, "Exception: %s, LastError: (%s)\n", ex.what(), lib1.GetLastError().c_str() );
		UNIT_TEST( true );
	}
	catch( ... )
	{
		UNIT_TEST( false );
	}
	
	try
	{
		lib2.GetInstance( "NonExistentClass" );
		UNIT_TEST( false );
	}
	catch( PDL::LoaderException & ex )
	{
		fprintf( stderr, "Exception: %s, LastError: (%s)\n", ex.what(), lib2.GetLastError().c_str() );
		UNIT_TEST( true );
	}
	catch( ... )
	{
		UNIT_TEST( false );
	}
	
	try
	{
		lib2.GetInstance( "MyTestClass1" );
		lib2.GetInstance( "MyTestClass2" );
		UNIT_TEST( true );
	}
	catch( PDL::LoaderException & ex )
	{
		fprintf( stderr, "Exception: %s, LastError: (%s)\n", ex.what(), lib2.GetLastError().c_str() );
		UNIT_TEST( false );
	}
	catch( ... )
	{
		UNIT_TEST( false );
	}
	
	try
	{
		PDL::DynamicClass * class1 = lib2.GetInstance( "MyTestClass1" );
		PDL::DynamicClass * class2 = lib2.GetInstance( "MyTestClass1" );
		UNIT_TEST( ( class1 ) && ( class2 ) && ( class1 == class2 ) );
	}
	catch( PDL::LoaderException & ex )
	{
		fprintf( stderr, "Exception: %s, LastError: (%s)\n", ex.what(), lib2.GetLastError().c_str() );
		UNIT_TEST( false );
	}
	catch( ... )
	{
		UNIT_TEST( false );
	}

	// Test DynamicLibrary::Close()
	UNIT_TEST( lib1.Close() );
	UNIT_TEST( lib2.Close() );

	return 0;
}
Example #10
0
void run_storage_tests() {
	UNIT_TEST(test_storage);
}