[pango: 1/2] testmatrix.c: use G_SQRT2 insead of M_SQRT2




commit cadbb32a92b8ed30ff9557e88235a75ec2305a01
Author: Jordan Petridis <jordan centricular com>
Date:   Mon Jun 28 14:40:56 2021 +0300

    testmatrix.c: use G_SQRT2 insead of M_SQRT2
    
    Math implementations are platform dependent, and for
    example msvc requires a define before enabling the
    constants [1]
    
    Use G_SQRT2 implementation which is independent instead.
    
    [1] https://docs.microsoft.com/en-us/cpp/c-runtime-library/math-constants?view=msvc-160

 tests/testmatrix.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/tests/testmatrix.c b/tests/testmatrix.c
index 403dece1..2c7b39a2 100644
--- a/tests/testmatrix.c
+++ b/tests/testmatrix.c
@@ -160,9 +160,9 @@ test_matrix_transform_rect (void)
   pango_matrix_transform_rectangle (&m, &rect);
 
   g_assert_cmpfloat_with_epsilon (rect.x, 0, 0.5);
-  g_assert_cmpfloat_with_epsilon (rect.y, - M_SQRT2  / 2 * PANGO_SCALE, 0.5);
-  g_assert_cmpfloat_with_epsilon (rect.width, M_SQRT2 * PANGO_SCALE, 0.5);
-  g_assert_cmpfloat_with_epsilon (rect.height, M_SQRT2 * PANGO_SCALE, 0.5);
+  g_assert_cmpfloat_with_epsilon (rect.y, - G_SQRT2  / 2 * PANGO_SCALE, 0.5);
+  g_assert_cmpfloat_with_epsilon (rect.width, G_SQRT2 * PANGO_SCALE, 0.5);
+  g_assert_cmpfloat_with_epsilon (rect.height, G_SQRT2 * PANGO_SCALE, 0.5);
 }
 
 static void


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