summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/dump-boundaries.c5
-rw-r--r--tests/testboundaries.c14
-rw-r--r--tests/testcolor.c33
-rw-r--r--tests/testiter.c13
-rw-r--r--tests/testscript.c7
5 files changed, 34 insertions, 38 deletions
diff --git a/tests/dump-boundaries.c b/tests/dump-boundaries.c
index ac507cf6..f566a54c 100644
--- a/tests/dump-boundaries.c
+++ b/tests/dump-boundaries.c
@@ -28,9 +28,8 @@
#define CHFORMAT "%0#6x"
-static void
-fail (const char *format,
- ...)
+static void fail (const char *format, ...) G_GNUC_PRINTF (1, 2) G_GNUC_NORETURN;
+static void fail (const char *format, ...)
{
char *str;
diff --git a/tests/testboundaries.c b/tests/testboundaries.c
index f8661d15..e003aadb 100644
--- a/tests/testboundaries.c
+++ b/tests/testboundaries.c
@@ -66,9 +66,8 @@ static gunichar current_wc = 0;
static const char *line_start = NULL;
static const char *line_end = NULL;
-static void
-fail (const char *format,
- ...)
+static void fail (const char *format, ...) G_GNUC_PRINTF (1, 2) G_GNUC_NORETURN;
+static void fail (const char *format, ...)
{
char *str;
char *line_text;
@@ -275,6 +274,8 @@ check_grapheme_invariants (const char *text,
}
+static void print_sentences (const char *text,
+ PangoLogAttr *attrs);
static void
print_sentences (const char *text,
PangoLogAttr *attrs)
@@ -333,12 +334,11 @@ check_invariants (const char *text)
}
int
-main (int argc,
- char **argv)
+main (int argc, char *argv[])
{
gchar *text;
- gchar *srcdir;
- gchar *filename;
+ const gchar *srcdir;
+ const gchar *filename;
srcdir = getenv ("srcdir");
if (!srcdir)
diff --git a/tests/testcolor.c b/tests/testcolor.c
index fe23d72d..d64153d9 100644
--- a/tests/testcolor.c
+++ b/tests/testcolor.c
@@ -30,7 +30,7 @@ typedef struct _ColorSpec {
guint16 blue;
} ColorSpec;
-gboolean test_color (ColorSpec *spec)
+static gboolean test_color (ColorSpec *spec)
{
PangoColor color;
gboolean accepted;
@@ -63,19 +63,19 @@ ColorSpec specs [] = {
{ "#000000000", 1, 0x0000, 0x0000, 0x0000 },
{ "#000000000000", 1, 0x0000, 0x0000, 0x0000 },
{ "#AAAABBBBCCCC", 1, 0xaaaa, 0xbbbb, 0xcccc },
- { "#aa bb cc ", 0 },
- { "#aa bb ccc", 0 },
- { "#ab", 0 },
- { "#aabb", 0 },
- { "#aaabb", 0 },
- { "aaabb", 0 },
- { "", 0 },
- { "#", 0 },
- { "##fff", 0 },
- { "#0000ff+", 0 },
- { "#0000f+", 0 },
- { "#0x00x10x2", 0 },
- { NULL, 0 }
+ { "#aa bb cc ", 0, 0, 0, 0 },
+ { "#aa bb ccc", 0, 0, 0, 0 },
+ { "#ab", 0, 0, 0, 0 },
+ { "#aabb", 0, 0, 0, 0 },
+ { "#aaabb", 0, 0, 0, 0 },
+ { "aaabb", 0, 0, 0, 0 },
+ { "", 0, 0, 0, 0 },
+ { "#", 0, 0, 0, 0 },
+ { "##fff", 0, 0, 0, 0 },
+ { "#0000ff+", 0, 0, 0, 0 },
+ { "#0000f+", 0, 0, 0, 0 },
+ { "#0x00x10x2", 0, 0, 0, 0 },
+ { NULL, 0, 0, 0, 0 }
};
int
@@ -83,7 +83,6 @@ main (int argc, char *argv[])
{
gboolean success;
ColorSpec *spec;
- gchar *blob;
success = TRUE;
for (spec = specs; spec->spec; spec++)
@@ -91,7 +90,3 @@ main (int argc, char *argv[])
return !success;
}
-
-
-
-
diff --git a/tests/testiter.c b/tests/testiter.c
index d0966c91..58cc2289 100644
--- a/tests/testiter.c
+++ b/tests/testiter.c
@@ -34,6 +34,7 @@
#undef VERBOSE
+static void verbose (const char *format, ...) G_GNUC_PRINTF (1, 2);
static void
verbose (const char *format, ...)
{
@@ -53,7 +54,7 @@ verbose (const char *format, ...)
* I think the iterator itself should support \r\n without trouble,
* but there are comments in layout-iter.c suggesting otherwise.
*/
-char *test_texts[] =
+const char *test_texts[] =
{
/* English with embedded RTL runs (from ancient-hebrew.org) */
"The Hebrew word \xd7\x90\xd7\x93\xd7\x9d\xd7\x94 (adamah) is the feminine form of \xd7\x90\xd7\x93\xd7\x9d meaning \"ground\"\n",
@@ -72,7 +73,7 @@ char *test_texts[] =
NULL
};
-void
+static void
iter_char_test (PangoLayout *layout)
{
PangoRectangle extents, run_extents;
@@ -157,7 +158,7 @@ iter_char_test (PangoLayout *layout)
* - Total num of iterations match number of chars
* - GlyphString's index_to_x positions match those returned by the Iter
*/
-void
+static void
iter_cluster_test (PangoLayout *layout)
{
PangoRectangle extents;
@@ -212,7 +213,7 @@ iter_cluster_test (PangoLayout *layout)
int
main (int argc, char *argv[])
{
- char **ptext;
+ const char **ptext;
PangoFontMap *fontmap;
PangoContext *context;
PangoLayout *layout;
@@ -227,8 +228,8 @@ main (int argc, char *argv[])
{
verbose ("--------- checking next text ----------\n");
verbose (" <%s>\n", *ptext);
- verbose ( "len=%d, bytes=%d\n",
- g_utf8_strlen (*ptext, -1), strlen (*ptext));
+ verbose ( "len=%ld, bytes=%ld\n",
+ (long)g_utf8_strlen (*ptext, -1), (long)strlen (*ptext));
pango_layout_set_text (layout, *ptext, -1);
iter_char_test (layout);
diff --git a/tests/testscript.c b/tests/testscript.c
index 5ef39384..4594a9a9 100644
--- a/tests/testscript.c
+++ b/tests/testscript.c
@@ -140,10 +140,11 @@ unescape (const char *text)
}
static void
-test_script_lookup ()
+test_script_lookup (void)
{
gunichar ch = 0;
- int i, j;
+ unsigned int i;
+ int j;
for (i = 0; i < G_N_ELEMENTS (pango_script_table); i++)
{
@@ -185,7 +186,7 @@ test_script_iter (void)
const char *start;
const char *end;
PangoScript script;
- int i;
+ unsigned int i;
for (i = 0; i < G_N_ELEMENTS(test_data); i++)
{