MCPcopy Create free account
hub / github.com/cinder/Cinder / setup

Method setup

test/base64Test/src/base64TestApp.cpp:28–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28void base64TestApp::setup()
29{
30 assert( toBase64( "any carnal pleasure." ) == "YW55IGNhcm5hbCBwbGVhc3VyZS4=" );
31 assert( toBase64( "any carnal pleasure" ) == "YW55IGNhcm5hbCBwbGVhc3VyZQ==" );
32 assert( toBase64( "any carnal pleasur" ) == "YW55IGNhcm5hbCBwbGVhc3Vy" );
33 assert( toBase64( "any carnal pleasu" ) == "YW55IGNhcm5hbCBwbGVhc3U=" );
34 assert( toBase64( "any carnal pleas" ) == "YW55IGNhcm5hbCBwbGVhcw==" );
35
36 for( int a = 0; a < 1000; ++a ) {
37 std::string test;
38 for( int t = 0; t < a; ++t )
39 test += 'A' + ( t % 26 );
40 app::console() << "Len: " << a << std::endl;
41 for( int i = 0; i < 100; ++i ) { // test word wraps
42 std::string base64 = toBase64( test, i );
43 Buffer b = fromBase64(base64);
44 assert( toString( b ) == test );
45 }
46 }
47 app::console() << "Tests passed" << std::endl;
48}
49
50void base64TestApp::mouseDown( MouseEvent event )
51{

Callers

nothing calls this directly

Calls 4

assertFunction · 0.85
toBase64Function · 0.85
fromBase64Function · 0.85
toStringFunction · 0.70

Tested by

no test coverage detected