[Bf-blender-cvs] [6b8b3ba] master: GTest: test beautify with polyfill
Campbell Barton
noreply at git.blender.org
Sat Jan 3 08:05:30 CET 2015
Commit: 6b8b3badf58942356d4cc8aa64214f94272a7958
Author: Campbell Barton
Date: Sat Jan 3 18:04:37 2015 +1100
Branches: master
https://developer.blender.org/rB6b8b3badf58942356d4cc8aa64214f94272a7958
GTest: test beautify with polyfill
===================================================================
M tests/gtests/blenlib/BLI_polyfill2d_test.cc
===================================================================
diff --git a/tests/gtests/blenlib/BLI_polyfill2d_test.cc b/tests/gtests/blenlib/BLI_polyfill2d_test.cc
index 7852747..fac5c6f 100644
--- a/tests/gtests/blenlib/BLI_polyfill2d_test.cc
+++ b/tests/gtests/blenlib/BLI_polyfill2d_test.cc
@@ -7,6 +7,7 @@
/* test every possible offset and reverse */
#define USE_COMBINATIONS_ALL
+#define USE_BEAUTIFY
extern "C" {
#include "BLI_array.h"
@@ -18,6 +19,12 @@ extern "C" {
#ifdef USE_OBJ_PREVIEW
# include "BLI_string.h"
#endif
+
+#ifdef USE_BEAUTIFY
+#include "BLI_polyfill2d_beautify.h"
+#include "BLI_memarena.h"
+#include "BLI_heap.h"
+#endif
}
static void polyfill_to_obj(
@@ -179,6 +186,25 @@ static void test_polyfill_template(
/* check all went well */
test_polyfill_template_check(id, is_degenerate, poly, poly_tot, tris, tris_tot);
+
+#ifdef USE_BEAUTIFY
+ /* check beautify gives good results too */
+ {
+ MemArena *pf_arena = BLI_memarena_new(BLI_POLYFILL_ARENA_SIZE, __func__);
+ Heap *pf_heap = BLI_heap_new_ex(BLI_POLYFILL_ALLOC_NGON_RESERVE);
+ EdgeHash *pf_ehash = BLI_edgehash_new_ex(__func__, BLI_POLYFILL_ALLOC_NGON_RESERVE);
+
+ BLI_polyfill_beautify(
+ poly, poly_tot, tris,
+ pf_arena, pf_heap, pf_ehash);
+
+ test_polyfill_template_check(id, is_degenerate, poly, poly_tot, tris, tris_tot);
+
+ BLI_memarena_free(pf_arena);
+ BLI_heap_free(pf_heap, NULL);
+ BLI_edgehash_free(pf_ehash, NULL);
+ }
+#endif
}
#ifdef USE_COMBINATIONS_ALL
More information about the Bf-blender-cvs
mailing list