X-Git-Url: https://code.wpia.club/?p=cassiopeia.git;a=blobdiff_plain;f=test%2Fsrc%2FbioWrapper.cpp;fp=test%2Fsrc%2FbioWrapper.cpp;h=9caa379739cb6ecec843ad59fee7aca0df4b97ce;hp=dbf6a6d42cf5c82c002fb4d58bc94886a84416c7;hb=da9f337a893bd317460118f89efa83a3427f797f;hpb=23987db96db7962a6ee58d1aeda2bd87780ca579 diff --git a/test/src/bioWrapper.cpp b/test/src/bioWrapper.cpp index dbf6a6d..9caa379 100644 --- a/test/src/bioWrapper.cpp +++ b/test/src/bioWrapper.cpp @@ -7,33 +7,33 @@ class OpensslBIO1 : public OpensslBIO { public: int state; - int write( const char* buf, int num ); - int read( char* buf, int size ); - long ctrl( int cmod, long arg1, void* arg2 ); + int write( const char *buf, int num ); + int read( char *buf, int size ); + long ctrl( int cmod, long arg1, void *arg2 ); - static const char* getName(); + static const char *getName(); }; -int OpensslBIO1::write( const char* buf, int num ) { +int OpensslBIO1::write( const char *buf, int num ) { state = num * 2; ( void ) buf; return 0; } -int OpensslBIO1::read( char* buf, int size ) { +int OpensslBIO1::read( char *buf, int size ) { state = size * 3; ( void ) buf; return 0; } -long OpensslBIO1::ctrl( int cmod, long arg1, void* arg2 ) { +long OpensslBIO1::ctrl( int cmod, long arg1, void *arg2 ) { state = cmod * 7; ( void ) arg1; ( void ) arg2; return 0; } -const char* OpensslBIO1::getName() { +const char *OpensslBIO1::getName() { return "dummyBIO"; } @@ -42,8 +42,8 @@ BOOST_AUTO_TEST_SUITE( TestBioWrapper ) BOOST_AUTO_TEST_CASE( BasicCalls ) { std::shared_ptr m( toBio(), BIO_meth_free ); std::shared_ptr n( BIO_new( m.get() ), BIO_free ); - OpensslBIO* o = new OpensslBIOWrapper( n ); - OpensslBIO1* data = ( OpensslBIO1* ) n->ptr; + OpensslBIO *o = new OpensslBIOWrapper( n ); + OpensslBIO1 *data = ( OpensslBIO1 * ) n->ptr; o->write( "bla", 13 ); BOOST_CHECK( data->state == 13 * 2 );