Adding Simple Objest test. Fixes some bugs
This commit is contained in:
parent
64e1f78739
commit
2c8e1470d1
10 changed files with 74 additions and 15 deletions
31
Objects/tests/core/TestCore.cpp
Normal file
31
Objects/tests/core/TestCore.cpp
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
|
||||
#include "NewPlacement.hpp"
|
||||
|
||||
#include "Testing.hpp"
|
||||
|
||||
#include "core/object.h"
|
||||
|
||||
#include "primitives/intobject.h"
|
||||
|
||||
using namespace tp;
|
||||
using namespace obj;
|
||||
|
||||
TEST_DEF_STATIC(BasicAPI) {
|
||||
auto integer = NDO_CAST(IntObject, NDO->create("int"));
|
||||
|
||||
integer->val = 10;
|
||||
|
||||
printf("%s\n", NDO->toString(integer).read());
|
||||
|
||||
NDO->save(integer, "tmp.o");
|
||||
auto savedInt = NDO->load("tmp.o");
|
||||
|
||||
printf("%s\n", NDO->toString(savedInt).read());
|
||||
|
||||
NDO->destroy(integer);
|
||||
NDO->destroy(savedInt);
|
||||
}
|
||||
|
||||
TEST_DEF(Core) {
|
||||
testBasicAPI();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue