From c36116f125a682bb093142c1ef52df6597c54193 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 23 Aug 2021 12:06:52 +0200 Subject: [PATCH] rulegen:: tests:: precision testing, report solid_err --- devmods/rulegen-tests.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/devmods/rulegen-tests.cpp b/devmods/rulegen-tests.cpp index 10616557..18d0b5dc 100644 --- a/devmods/rulegen-tests.cpp +++ b/devmods/rulegen-tests.cpp @@ -454,6 +454,8 @@ int shape_edges() { } void test_current(string tesname) { + + worst_precision_error = 0; stop_game(); pointer_indices.clear(); // if(s.find("884-211-045") == string::npos) return; @@ -510,6 +512,11 @@ void test_current(string tesname) { status = "ERR"; message = e.what(); } + catch(hr_precision_error& e) { + println(hlog, "precision error: ** ", e.what()); + status = "PRE"; + message = e.what(); + } auto end = std::chrono::high_resolution_clock::now(); @@ -560,8 +567,15 @@ void test_current(string tesname) { case 's': Out("status", status); case 'm': Out("message", message); case 'c': Out("cells", tcellcount); - case 'u': Out("unis", tunified); + case 'u': + if(flags & w_numerical) { + Out("precision", worst_precision_error); + } + else { + Out("unis", tunified); + } case 'q': Out("solid", qsolid); + case 'Q': Out("solid_err", all_solid_errors); case 'd': Out("dist", qdist); case 'C': Out("code", qcode); case 't': Out("try", try_count);