summaryrefslogtreecommitdiff
path: root/tests/pke-test-serialization.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pke-test-serialization.cpp')
-rw-r--r--tests/pke-test-serialization.cpp55
1 files changed, 30 insertions, 25 deletions
diff --git a/tests/pke-test-serialization.cpp b/tests/pke-test-serialization.cpp
index 536d6c1..c24faca 100644
--- a/tests/pke-test-serialization.cpp
+++ b/tests/pke-test-serialization.cpp
@@ -46,6 +46,7 @@ const pk_uuid uuid_n[] = {
// const pk_uuid uuid_34 = FAKE_UUID_GEN(0x22);
void pke_test_serialization_spinup() {
+ // pk_funcinstr_init();
pkeSettings.isSimulationPaused = true;
Physics_Init();
PkeThreads_Init();
@@ -60,9 +61,11 @@ void pke_test_serialization_spinup() {
// FontType *ft = FontType_GetFonts(fti);
// assert(fti > FontTypeIndex{0});
// ft->uuid = uuid_17;
+ // pk_funcinstr_teardown();
};
void pke_test_serialization_teardown() {
+ // pk_funcinstr_init();
// pke_scene_remove(test_scene->scene_handle); // TODO this doesn't work?
test_scene = nullptr;
pke_scene_master_teardown();
@@ -73,8 +76,8 @@ void pke_test_serialization_teardown() {
AM_Teardown();
PkeThreads_Teardown();
Physics_Teardown();
- pk_memory_teardown_all();
bkt = nullptr;
+ // pk_funcinstr_teardown();
};
int pke_test_serialization_999() {
@@ -131,11 +134,12 @@ Scale:5.000000;4.000000;3.000000
:PKFE:)VOGON";
int pke_test_serialization_001() {
+ pk_funcinstr_init();
int64_t err_index = 0, i;
srlztn_serialize_helper *h;
std::stringstream ss;
try {
- bkt = pk_bucket_create("pke_test_serialization", PK_DEFAULT_BUCKET_SIZE, false);
+ bkt = pk_mem_bucket_create("pke_test_serialization", PK_MEM_DEFAULT_BUCKET_SIZE, PK_MEMBUCKET_FLAG_NONE);
h = pke_serialize_init(bkt);
glm::vec3 pos = glm::vec3(0,1,2);
@@ -164,10 +168,11 @@ int pke_test_serialization_001() {
pke_serialize_teardown(h);
} catch (const std::exception &ex) {
- pk_bucket_destroy(bkt);
+ pk_mem_bucket_destroy(bkt);
throw;
}
- pk_bucket_destroy(bkt);
+ pk_mem_bucket_destroy(bkt);
+ pk_funcinstr_teardown();
return 0;
}
@@ -176,7 +181,7 @@ int pke_test_deserialization_101() {
srlztn_deserialize_helper *h;
std::stringstream ss(test_001_str);
try {
- bkt = pk_bucket_create("pke_test_serialization", PK_DEFAULT_BUCKET_SIZE, false);
+ bkt = pk_mem_bucket_create("pke_test_serialization", PK_MEM_DEFAULT_BUCKET_SIZE, PK_MEMBUCKET_FLAG_NONE);
h = pke_deserialize_init(bkt);
pke_deserialize_scene_from_stream(ss, h);
@@ -206,10 +211,10 @@ int pke_test_deserialization_101() {
pke_deserialize_teardown(h);
} catch (const std::exception &ex) {
- pk_bucket_destroy(bkt);
+ pk_mem_bucket_destroy(bkt);
throw;
}
- pk_bucket_destroy(bkt);
+ pk_mem_bucket_destroy(bkt);
return 0;
}
@@ -247,7 +252,7 @@ int pke_test_serialization_002() {
pke_kve *kve = nullptr;
std::stringstream ss;
try {
- bkt = pk_bucket_create("pke_test_serialization", PK_DEFAULT_BUCKET_SIZE, false);
+ bkt = pk_mem_bucket_create("pke_test_serialization", PK_MEM_DEFAULT_BUCKET_SIZE, PK_MEMBUCKET_FLAG_NONE);
h = pke_serialize_init(bkt);
// reminder that 'targeting' moves and rotates the camera, so we shouldn't see these values in the output
@@ -305,10 +310,10 @@ int pke_test_serialization_002() {
pke_serialize_teardown(h);
} catch (const std::exception &ex) {
- pk_bucket_destroy(bkt);
+ pk_mem_bucket_destroy(bkt);
throw;
}
- pk_bucket_destroy(bkt);
+ pk_mem_bucket_destroy(bkt);
return 0;
}
@@ -319,7 +324,7 @@ int pke_test_deserialization_102() {
srlztn_deserialize_helper *h;
std::stringstream ss(test_002_str);
try {
- bkt = pk_bucket_create("pke_test_serialization", PK_DEFAULT_BUCKET_SIZE, false);
+ bkt = pk_mem_bucket_create("pke_test_serialization", PK_MEM_DEFAULT_BUCKET_SIZE, PK_MEMBUCKET_FLAG_NONE);
h = pke_deserialize_init(bkt);
h->scene = test_scene;
@@ -378,10 +383,10 @@ int pke_test_deserialization_102() {
pke_deserialize_teardown(h);
} catch (const std::exception &ex) {
- pk_bucket_destroy(bkt);
+ pk_mem_bucket_destroy(bkt);
throw;
}
- pk_bucket_destroy(bkt);
+ pk_mem_bucket_destroy(bkt);
return 0;
}
@@ -424,7 +429,7 @@ int pke_test_serialization_003() {
pke_kve *kve = nullptr;
std::stringstream ss;
try {
- bkt = pk_bucket_create("pke_test_serialization", PK_DEFAULT_BUCKET_SIZE, false);
+ bkt = pk_mem_bucket_create("pke_test_serialization", PK_MEM_DEFAULT_BUCKET_SIZE, PK_MEMBUCKET_FLAG_NONE);
h = pke_serialize_init(bkt);
FontTypeIndex fti;
@@ -482,10 +487,10 @@ int pke_test_serialization_003() {
pke_serialize_teardown(h);
} catch (const std::exception &ex) {
- pk_bucket_destroy(bkt);
+ pk_mem_bucket_destroy(bkt);
throw;
}
- pk_bucket_destroy(bkt);
+ pk_mem_bucket_destroy(bkt);
return 0;
}
@@ -496,7 +501,7 @@ int pke_test_deserialization_103() {
srlztn_deserialize_helper *h;
std::stringstream ss(test_003_str);
try {
- bkt = pk_bucket_create("pke_test_serialization", PK_DEFAULT_BUCKET_SIZE, false);
+ bkt = pk_mem_bucket_create("pke_test_serialization", PK_MEM_DEFAULT_BUCKET_SIZE, PK_MEMBUCKET_FLAG_NONE);
h = pke_deserialize_init(bkt);
h->scene = test_scene;
@@ -560,10 +565,10 @@ int pke_test_deserialization_103() {
pke_deserialize_teardown(h);
} catch (const std::exception &ex) {
- pk_bucket_destroy(bkt);
+ pk_mem_bucket_destroy(bkt);
throw;
}
- pk_bucket_destroy(bkt);
+ pk_mem_bucket_destroy(bkt);
return 0;
}
@@ -596,7 +601,7 @@ int pke_test_serialization_004() {
pke_kve *kve = nullptr;
std::stringstream ss;
try {
- bkt = pk_bucket_create("pke_test_serialization", PK_DEFAULT_BUCKET_SIZE, false);
+ bkt = pk_mem_bucket_create("pke_test_serialization", PK_MEM_DEFAULT_BUCKET_SIZE, PK_MEMBUCKET_FLAG_NONE);
h = pke_serialize_init(bkt);
pke_ui_box *ui_box_p = pke_ui_box_new_root(PKE_UI_BOX_TYPE_STANDARD, uuid_n[2]);
@@ -644,10 +649,10 @@ int pke_test_serialization_004() {
pke_serialize_teardown(h);
} catch (const std::exception &ex) {
- pk_bucket_destroy(bkt);
+ pk_mem_bucket_destroy(bkt);
throw;
}
- pk_bucket_destroy(bkt);
+ pk_mem_bucket_destroy(bkt);
return 0;
}
@@ -658,7 +663,7 @@ int pke_test_deserialization_104() {
pke_kve *kve = nullptr;
std::stringstream ss(test_004_str);
try {
- bkt = pk_bucket_create("pke_test_serialization", PK_DEFAULT_BUCKET_SIZE, false);
+ bkt = pk_mem_bucket_create("pke_test_serialization", PK_MEM_DEFAULT_BUCKET_SIZE, PK_MEMBUCKET_FLAG_NONE);
h = pke_deserialize_init(bkt);
pke_deserialize_scene_from_stream(ss, h);
@@ -720,10 +725,10 @@ int pke_test_deserialization_104() {
pke_deserialize_teardown(h);
} catch (const std::exception &ex) {
- pk_bucket_destroy(bkt);
+ pk_mem_bucket_destroy(bkt);
throw;
}
- pk_bucket_destroy(bkt);
+ pk_mem_bucket_destroy(bkt);
return 0;
}