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:
Vadim Zeitlin 2021-11-21 21:27:59 +01:00
commit 7c6fb542d3
2 changed files with 15 additions and 17 deletions

View file

@ -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);
}
}

View 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 );
}
}