diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2025-03-12 20:46:47 -0400 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2025-03-12 20:46:47 -0400 |
| commit | a88391495ac5008e84e379c50d04381ffe1363cd (patch) | |
| tree | b0e6b084452d1189bf402107539ed3f2af156b6f /tests | |
| parent | 22ff2a06ec70b5ad856ff8fbce3d15041f8aa99d (diff) | |
pke: more asserts for static_ui tests
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/pke-test-static-ui.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/pke-test-static-ui.cpp b/tests/pke-test-static-ui.cpp index 0b88295..43ce76d 100644 --- a/tests/pke-test-static-ui.cpp +++ b/tests/pke-test-static-ui.cpp @@ -63,6 +63,11 @@ int pke_test_static_ui_000() { PKE_TEST_ASSERT(c_ui_box->internal.px_corner_x == calculated_offset, err_index); PKE_TEST_ASSERT(c_ui_box->internal.px_corner_y == calculated_offset, err_index); + PKE_TEST_ASSERT(ui_box->internal.px_width == 500, err_index); + PKE_TEST_ASSERT(ui_box->internal.px_height == 500, err_index); + PKE_TEST_ASSERT(c_ui_box->internal.px_width == 100, err_index); + PKE_TEST_ASSERT(c_ui_box->internal.px_height == 100, err_index); + return 0; } @@ -109,6 +114,14 @@ int pke_test_static_ui_100() { PKE_TEST_ASSERT(c_ui_box->internal.px_corner_x == calculated_offset_x, err_index); PKE_TEST_ASSERT(c_ui_box->internal.px_corner_y == calculated_offset_y, err_index); + PKE_TEST_ASSERT(ui_box->internal.px_width == (Extent.width * 0.1) * 8, err_index); + PKE_TEST_ASSERT(ui_box->internal.px_height == (Extent.height * 0.1) * 8, err_index); + // TODO rounding? + // using a debugger, the actual and calculated values are ~0.01 off + // this is either a real issue or a rounding issue, either here or within pke + PKE_TEST_ASSERT(c_ui_box->internal.px_width == (ui_box->internal.px_width - (built_in_offset * 2)) * 0.8, err_index); + PKE_TEST_ASSERT(c_ui_box->internal.px_height == (ui_box->internal.px_height - (built_in_offset * 2)) * 0.8, err_index); + return 0; } |
