]> O.S.I.I.S - jp/vkvg.git/commitdiff
add test
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Mon, 3 Jan 2022 18:16:44 +0000 (19:16 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Mon, 3 Jan 2022 18:16:44 +0000 (19:16 +0100)
tests/fill_non_zero.c [new file with mode: 0644]

diff --git a/tests/fill_non_zero.c b/tests/fill_non_zero.c
new file mode 100644 (file)
index 0000000..b70c7ee
--- /dev/null
@@ -0,0 +1,31 @@
+#include "test.h"
+
+void test(){
+       VkvgContext ctx = vkvg_create(surf);
+       vkvg_save(ctx);
+       vkvg_set_line_width(ctx,30);
+       vkvg_set_fill_rule(ctx, VKVG_FILL_RULE_NON_ZERO);
+
+       vkvg_set_source_rgba(ctx,0.1f,0.9f,0.1f,1.0f);
+       vkvg_move_to(ctx,100,100);
+       vkvg_rel_line_to(ctx,200,0);
+       vkvg_rel_line_to(ctx,0,150);
+       vkvg_rel_line_to(ctx,-200,0);
+       vkvg_close_path(ctx);
+
+       vkvg_move_to(ctx,150,150);
+       vkvg_rel_line_to(ctx,0,50);
+       vkvg_rel_line_to(ctx,100,0);
+       vkvg_rel_line_to(ctx,0,-50);
+       vkvg_close_path(ctx);
+
+       vkvg_fill(ctx);
+
+       vkvg_destroy(ctx);
+}
+
+int main(int argc, char *argv[]) {
+       no_test_size = true;
+       PERFORM_TEST (test, argc, argv);
+       return 0;
+}