[gtk/matthiasc/lottie2: 5/6] testsuite: Add more random paths




commit dc8295dd74cd873fc2be980c3c90e85cbd1f9d0c
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Nov 24 20:37:43 2020 -0500

    testsuite: Add more random paths
    
    Make the random path generation include circles
    and arcs.

 testsuite/gsk/path.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)
---
diff --git a/testsuite/gsk/path.c b/testsuite/gsk/path.c
index 09f3ca0347..be74d8abb6 100644
--- a/testsuite/gsk/path.c
+++ b/testsuite/gsk/path.c
@@ -30,7 +30,7 @@ create_random_path (void)
 
   for (i = 0; i < n; i++)
     {
-      switch (g_test_rand_int_range (0, 11))
+      switch (g_test_rand_int_range (0, 13))
       {
         case 0:
           gsk_path_builder_move_to (builder,
@@ -72,6 +72,25 @@ create_random_path (void)
                                      g_test_rand_double_range (-1000, 1000));
           break;
 
+        case 11:
+          gsk_path_builder_add_circle (builder,
+                                       &GRAPHENE_POINT_INIT (
+                                         g_test_rand_double_range (-1000, 1000),
+                                         g_test_rand_double_range (-1000, 1000)),
+                                       g_test_rand_double_range (0, 1000));
+          break;
+
+        case 12:
+          gsk_path_builder_arc_to (builder,
+                                   g_test_rand_double_range (0, 1000),
+                                   g_test_rand_double_range (0, 1000),
+                                   g_test_rand_double_range (0, 2 * M_PI),
+                                   (gboolean)g_test_rand_int_range (0, 1),
+                                   (gboolean)g_test_rand_int_range (0, 1),
+                                    g_test_rand_double_range (-1000, 1000),
+                                    g_test_rand_double_range (-1000, 1000));
+          break;
+
         default:
           g_assert_not_reached();
           break;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]