summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJordan Petridis <jordan@centricular.com>2021-06-28 14:40:56 +0300
committerJordan Petridis <jordan@centricular.com>2021-06-28 14:56:38 +0300
commitcadbb32a92b8ed30ff9557e88235a75ec2305a01 (patch)
treeba9da662f7eacfc9f2007b1500bfd4990a3178a0 /tests
parent249615a89cc1594e7c16b5cc5004f63ca9eb36b6 (diff)
downloadpango-cadbb32a92b8ed30ff9557e88235a75ec2305a01.tar.gz
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
Diffstat (limited to 'tests')
-rw-r--r--tests/testmatrix.c6
1 files 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