Convert li_boost_shared_ptr runtime test to C++ from C
It's simpler to write tests in C++ rather than C and checking the generated C++ API also checks the C API it uses underneath, so there is no need to have both.
This commit is contained in:
parent
c434b867d7
commit
7c6fb542d3
2 changed files with 15 additions and 17 deletions
|
|
@ -1,17 +0,0 @@
|
|||
#include "li_boost_shared_ptr_wrap.h"
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(int argc, const char *argv[]) {
|
||||
{
|
||||
li_boost_shared_ptr_Klass* k = li_boost_shared_ptr_Klass_new_rcstd_string("me oh my");
|
||||
assert( strcmp(li_boost_shared_ptr_Klass_getValue(k), "me oh my") == 0 );
|
||||
li_boost_shared_ptr_Klass_delete(k);
|
||||
}
|
||||
|
||||
{
|
||||
li_boost_shared_ptr_Klass* k = li_boost_shared_ptr_factorycreate();
|
||||
assert( strcmp(li_boost_shared_ptr_Klass_getValue(k), "factorycreate") == 0 );
|
||||
li_boost_shared_ptr_Klass_delete(k);
|
||||
}
|
||||
}
|
||||
15
Examples/test-suite/c/li_boost_shared_ptr_runme.cxx
Normal file
15
Examples/test-suite/c/li_boost_shared_ptr_runme.cxx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include "li_boost_shared_ptr_wrap.h"
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(int argc, const char *argv[]) {
|
||||
{
|
||||
li_boost_shared_ptr::Klass k("me oh my");
|
||||
assert( strcmp(k.getValue(), "me oh my") == 0 );
|
||||
}
|
||||
|
||||
{
|
||||
li_boost_shared_ptr::Klass k{li_boost_shared_ptr_factorycreate()};
|
||||
assert( strcmp(k.getValue(), "factorycreate") == 0 );
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue