summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-08-22 02:01:33 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-08-22 02:36:48 -0400
commitc47c61012687f9e24826c17ffec8eafbe0a2e68c (patch)
tree3d76a550a6d3c9bfed4d61e59f727aa59095cc1b /tests
parent9e8e4c7cd291bca8a28a18611cc0111a123291a6 (diff)
downloadpango-c47c61012687f9e24826c17ffec8eafbe0a2e68c.tar.gz
tests: Silence compiler warnings
Diffstat (limited to 'tests')
-rw-r--r--tests/test-font.c2
-rw-r--r--tests/test-itemize.c2
-rw-r--r--tests/test-shape.c5
-rw-r--r--tests/testattributes.c1
-rw-r--r--tests/testboundaries_ucd.c7
-rw-r--r--tests/testmisc.c2
6 files changed, 12 insertions, 7 deletions
diff --git a/tests/test-font.c b/tests/test-font.c
index f291cec8..1d3290c7 100644
--- a/tests/test-font.c
+++ b/tests/test-font.c
@@ -160,7 +160,7 @@ test_metrics (void)
static void
test_extents (void)
{
- char *str = "Composer";
+ const char *str = "Composer";
GList *items;
PangoItem *item;
PangoGlyphString *glyphs;
diff --git a/tests/test-itemize.c b/tests/test-itemize.c
index 926eb3ae..105b453d 100644
--- a/tests/test-itemize.c
+++ b/tests/test-itemize.c
@@ -55,7 +55,7 @@ static gboolean
affects_itemization (PangoAttribute *attr,
gpointer data)
{
- switch (attr->klass->type)
+ switch ((int)attr->klass->type)
{
/* These affect font selection */
case PANGO_ATTR_LANGUAGE:
diff --git a/tests/test-shape.c b/tests/test-shape.c
index a04291e4..152acd26 100644
--- a/tests/test-shape.c
+++ b/tests/test-shape.c
@@ -57,7 +57,7 @@ static gboolean
affects_itemization (PangoAttribute *attr,
gpointer data)
{
- switch (attr->klass->type)
+ switch ((int)attr->klass->type)
{
/* These affect font selection */
case PANGO_ATTR_LANGUAGE:
@@ -89,11 +89,12 @@ static gboolean
affects_break_or_shape (PangoAttribute *attr,
gpointer data)
{
- switch (attr->klass->type)
+ switch ((int)attr->klass->type)
{
/* Affects breaks */
case PANGO_ATTR_ALLOW_BREAKS:
/* Affects shaping */
+ case PANGO_ATTR_INSERT_HYPHENS:
case PANGO_ATTR_FONT_FEATURES:
case PANGO_ATTR_SHOW:
return TRUE;
diff --git a/tests/testattributes.c b/tests/testattributes.c
index 13cf6810..f950a204 100644
--- a/tests/testattributes.c
+++ b/tests/testattributes.c
@@ -157,6 +157,7 @@ test_binding (PangoAttribute *attr)
case FONT_FEATURES:
g_assert_nonnull (pango_attribute_as_font_features (attr));
break;
+ case INVALID:
default:
g_assert_not_reached ();
}
diff --git a/tests/testboundaries_ucd.c b/tests/testboundaries_ucd.c
index 0cd301f7..d9f08a57 100644
--- a/tests/testboundaries_ucd.c
+++ b/tests/testboundaries_ucd.c
@@ -263,6 +263,9 @@ do_test (const gchar *filename,
case G_IO_STATUS_NORMAL:
line[terminator_pos] = '\0';
break;
+
+ default:
+ break;
}
g_test_message ("Parsing line: %s", line);
@@ -276,7 +279,7 @@ do_test (const gchar *filename,
if (! attrs_equal (attrs, expected_attrs, num_attrs, bits))
{
gchar *str = make_test_string (string, attrs, bits);
- gchar *comments = strchr (line, '#');
+ char *comments = strchr (line, '#');
if (comments) /* don't print the # comment in the error message. print it separately */
{
*comments = '\0';
@@ -284,7 +287,7 @@ do_test (const gchar *filename,
}
else
{
- comments = "";
+ comments = (char *)"";
}
g_test_message ("%s: line %d failed", filename, i);
diff --git a/tests/testmisc.c b/tests/testmisc.c
index da24388b..60694134 100644
--- a/tests/testmisc.c
+++ b/tests/testmisc.c
@@ -314,7 +314,7 @@ test_get_cursor_crash (void)
PangoLayout *layout;
int i;
- char *string = "foo\n\rbar\r\nbaz\n\nqux\n\n..";
+ const char *string = "foo\n\rbar\r\nbaz\n\nqux\n\n..";
context = pango_font_map_create_context (pango_cairo_font_map_get_default ());