[tracker/parser-unicode-libs-review] FTS parser tests: fix when libunac is not available
- From: Aleksander Morgado <aleksm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/parser-unicode-libs-review] FTS parser tests: fix when libunac is not available
- Date: Wed, 19 May 2010 12:43:22 +0000 (UTC)
commit db7c102ca6ea347d5802a2ab737cdcf56d704115
Author: Aleksander Morgado <aleksander lanedo com>
Date: Wed May 19 14:42:59 2010 +0200
FTS parser tests: fix when libunac is not available
tests/libtracker-fts/tracker-parser-test.c | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/tests/libtracker-fts/tracker-parser-test.c b/tests/libtracker-fts/tracker-parser-test.c
index 820173f..81189e4 100644
--- a/tests/libtracker-fts/tracker-parser-test.c
+++ b/tests/libtracker-fts/tracker-parser-test.c
@@ -179,7 +179,8 @@ expected_word_check (TrackerParserTestFixture *fixture,
/* -------------- LIST OF TESTS ----------------- */
-/* Normalization-related tests */
+#ifdef HAVE_UNAC
+/* Normalization-related tests (unaccenting) */
static const TestDataExpectedWord test_data_normalization[] = {
{ "école", "ecole" },
{ "Ã?COLE", "ecole" },
@@ -197,6 +198,18 @@ static const TestDataExpectedWord test_data_unaccent[] = {
{ "desagüe", "desague" },
{ NULL, NULL }
};
+#else
+/* Normalization-related tests (not unaccenting) */
+static const TestDataExpectedWord test_data_normalization[] = {
+ { "école", "école" },
+ { "�COLE", "école" },
+ { "�cole", "école" },
+ { "e" "\xCC\x81" "cole", "école" },
+ { "E" "\xCC\x81" "COLE", "école" },
+ { "E" "\xCC\x81" "cole", "école" },
+ { NULL, NULL }
+};
+#endif
/* Casefolding-related tests */
static const TestDataExpectedWord test_data_casefolding[] = {
@@ -244,6 +257,7 @@ main (int argc, char **argv)
g_free (testpath);
}
+#ifdef HAVE_UNAC
/* Add unaccent checks */
for (i = 0; test_data_unaccent[i].str != NULL; i++) {
gchar *testpath;
@@ -257,6 +271,7 @@ main (int argc, char **argv)
test_common_teardown);
g_free (testpath);
}
+#endif
/* Add casefolding checks */
for (i = 0; test_data_casefolding[i].str != NULL; i++) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]