[tracker/tracker-0.16] libtracker-miner, libtracker-sparql: Fixed missing setlocale() in unit tests
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.16] libtracker-miner, libtracker-sparql: Fixed missing setlocale() in unit tests
- Date: Fri, 1 Nov 2013 15:31:32 +0000 (UTC)
commit 4820c919b4f540825d1f5268393cc2c4939a3d89
Author: Martyn Russell <martyn lanedo com>
Date: Sat Oct 19 16:36:31 2013 +0100
libtracker-miner, libtracker-sparql: Fixed missing setlocale() in unit tests
Due to the new warning we have in place where locale != DB locale, this needs
to be set before the tests will work.
tests/libtracker-miner/tracker-crawler-test.c | 6 ++++++
.../libtracker-miner/tracker-file-notifier-test.c | 6 ++++++
tests/libtracker-sparql/tracker-test.c | 4 ++++
3 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/tests/libtracker-miner/tracker-crawler-test.c b/tests/libtracker-miner/tracker-crawler-test.c
index 0e4e710..e00801a 100644
--- a/tests/libtracker-miner/tracker-crawler-test.c
+++ b/tests/libtracker-miner/tracker-crawler-test.c
@@ -17,6 +17,10 @@
* 02110-1301, USA.
*/
+#include "config.h"
+
+#include <locale.h>
+
#include <libtracker-miner/tracker-miner.h>
typedef struct CrawlerTest CrawlerTest;
@@ -286,6 +290,8 @@ test_crawler_crawl_n_signals_non_recursive (void)
CrawlerTest test = { 0 };
GFile *file;
+ setlocale (LC_ALL, "");
+
test.main_loop = g_main_loop_new (NULL, FALSE);
crawler = tracker_crawler_new ();
diff --git a/tests/libtracker-miner/tracker-file-notifier-test.c
b/tests/libtracker-miner/tracker-file-notifier-test.c
index 8cca453..5c65feb 100644
--- a/tests/libtracker-miner/tracker-file-notifier-test.c
+++ b/tests/libtracker-miner/tracker-file-notifier-test.c
@@ -18,9 +18,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
+
+#include "config.h"
+
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
+#include <locale.h>
#include <glib.h>
#include <glib/gstdio.h>
@@ -742,6 +746,8 @@ gint
main (gint argc,
gchar **argv)
{
+ setlocale (LC_ALL, "");
+
g_test_init (&argc, &argv, NULL);
g_test_message ("Testing file notifier");
diff --git a/tests/libtracker-sparql/tracker-test.c b/tests/libtracker-sparql/tracker-test.c
index d559c8e..ee0dbad 100644
--- a/tests/libtracker-sparql/tracker-test.c
+++ b/tests/libtracker-sparql/tracker-test.c
@@ -19,6 +19,8 @@
#include "config.h"
+#include <locale.h>
+
#include <libtracker-sparql/tracker-sparql.h>
typedef struct {
@@ -357,6 +359,8 @@ main (gint argc, gchar **argv)
{
int result;
+ setlocale (LC_ALL, "");
+
g_test_init (&argc, &argv, NULL);
#if HAVE_TRACKER_FTS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]