+#include "config.h"
+
#include <glib.h>
#include <locale.h>
#include <stdlib.h>
#include <string.h>
+static gboolean missing_locale = FALSE;
+
typedef struct {
const gchar **input;
const gchar **sorted;
Line line;
gint i;
+ if (missing_locale)
+ {
+ g_test_skip ("no en_US locale");
+ return;
+ }
+
line_array = g_array_new (FALSE, FALSE, sizeof(Line));
g_array_set_clear_func (line_array, (GDestroyNotify)clear_line);
};
const gchar *file_sorted2[] = {
+ /* Filename collation in OS X follows Finder style which gives
+ * a slightly different order from usual Linux locales. */
+#ifdef HAVE_CARBON
+ "a-.a",
+ "a.a",
+ "aa.a",
+ "file:foo",
+ "file0000",
+ "file000x",
+ "file1",
+ "file5",
+ "file10",
+ "file26",
+ "file0027",
+ "file027",
+ "file100",
+#else
"a.a",
"a-.a",
"aa.a",
"file0027",
"file100",
"file:foo",
+#endif
NULL
};
main (int argc, char *argv[])
{
gchar *path;
- gint i;
+ guint i;
const gchar *locale;
CollateTest test[3];
locale = setlocale (LC_ALL, "");
if (locale == NULL || strcmp (locale, "en_US") != 0)
{
- g_test_message ("No suitable locale, skipping test");
- return 0;
+ g_test_message ("No suitable locale, skipping tests");
+ missing_locale = TRUE;
+ /* let the tests run to completion so they show up as SKIP'd in TAP
+ * output */
}
test[0].input = input0;
return g_test_run ();
}
-