X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=test%2Fsrc%2FbioWrapper.cpp;h=aaf3ecc67939fdd740d5124534eb8df8106015bb;hb=a477eeab986cf4307f74d1b4601cc46a7b0173c0;hp=73d7c3600ebb14d12cf0cf4f10ff4dadcded486f;hpb=15ea6e987447233c9334ab4a9a27222918ce7bf3;p=cassiopeia.git diff --git a/test/src/bioWrapper.cpp b/test/src/bioWrapper.cpp index 73d7c36..aaf3ecc 100644 --- a/test/src/bioWrapper.cpp +++ b/test/src/bioWrapper.cpp @@ -1,9 +1,7 @@ -#include - #include -#include "bios.h" -#include "opensslBIO.h" +#include "io/bios.h" +#include "io/opensslBIO.h" class OpensslBIO1 : public OpensslBIO { public: @@ -21,17 +19,20 @@ int OpensslBIO1::write( const char* buf, int num ) { ( void ) buf; return 0; } + int OpensslBIO1::read( char* buf, int size ) { state = size * 3; ( void ) buf; return 0; } + long OpensslBIO1::ctrl( int cmod, long arg1, void* arg2 ) { state = cmod * 7; ( void ) arg1; ( void ) arg2; return 0; } + const char* OpensslBIO1::getName() { return "dummyBIO"; } @@ -39,7 +40,7 @@ const char* OpensslBIO1::getName() { BOOST_AUTO_TEST_SUITE( TestBioWrapper ) BOOST_AUTO_TEST_CASE( BasicCalls ) { - BIO* n = BIO_new( toBio() ); + std::shared_ptr n( BIO_new( toBio() ), BIO_free ); OpensslBIO* o = new OpensslBIOWrapper( n ); OpensslBIO1* data = ( OpensslBIO1* ) n->ptr;