[pango/pango2-windows] testattributes: Fix test on Visual Studio
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/pango2-windows] testattributes: Fix test on Visual Studio
- Date: Wed, 15 Jun 2022 10:02:49 +0000 (UTC)
commit 0528af6b5b8bbc51dc6683f4e205461aa6b400a0
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Wed Jun 15 18:00:55 2022 +0800
testattributes: Fix test on Visual Studio
The %p format indentifier is handled differently on Visual Studio, and
we must account for differences in 64-bit and 32-bit builds... :|
tests/testattributes.c | 10 ++++++++++
1 file changed, 10 insertions(+)
---
diff --git a/tests/testattributes.c b/tests/testattributes.c
index 63f37bdd..0d49fa61 100644
--- a/tests/testattributes.c
+++ b/tests/testattributes.c
@@ -155,7 +155,17 @@ test_attributes_register (void)
pango_attr_list_insert (list, attr2);
str = pango_attr_list_to_string (list);
+
+#ifdef _MSC_VER
+/* The Visual Studio CRT handles the format of the output produced by %p differently... */
+# ifdef _WIN64
+ g_assert_cmpstr (str, ==, "0 4294967295 my-attribute 0000000000000043");
+# else
+ g_assert_cmpstr (str, ==, "0 4294967295 my-attribute 00000043");
+# endif
+#else
g_assert_cmpstr (str, ==, "0 4294967295 my-attribute 0x43");
+#endif
g_free (str);
pango_attr_list_unref (list);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]