[gedit] Fix distcheck
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gedit] Fix distcheck
- Date: Mon, 25 Jan 2010 13:55:06 +0000 (UTC)
commit ba643056047d2f8d2fc47e070495ae7dbaa98102
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Mon Jan 25 14:54:01 2010 +0100
Fix distcheck
po/POTFILES.in | 1 +
tests/Makefile.am | 2 ++
tests/document-loader.c | 30 +++++++++++++++++++++++-------
3 files changed, 26 insertions(+), 7 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 67280a9..5751c6e 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -36,6 +36,7 @@ gedit/gedit-prefs-manager.c
gedit/gedit-print-job.c
[type: gettext/glade]gedit/gedit-print-preferences.ui
gedit/gedit-print-preview.c
+gedit/gedit-smart-charset-converter.c
gedit/gedit-statusbar.c
gedit/gedit-style-scheme-manager.c
gedit/gedit-tab.c
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 1b37591..dd6ee4c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -20,3 +20,5 @@ document_saver_SOURCES = document-saver.c
document_saver_LDADD = $(progs_ldadd)
TESTS = $(TEST_PROGS)
+
+EXTRA_DIST = setup-document-saver.sh
diff --git a/tests/document-loader.c b/tests/document-loader.c
index 0f0f446..d6b6f04 100644
--- a/tests/document-loader.c
+++ b/tests/document-loader.c
@@ -32,21 +32,37 @@ typedef struct
{
const gchar *in_buffer;
gint newline_type;
+ GFile *file;
} LoaderTestData;
-static void
+static GFile *
create_document (const gchar *filename,
const gchar *contents)
{
GError *error = NULL;
GeditDocument *document;
- GFile *file;
gchar *uri;
if (!g_file_set_contents (filename, contents, -1, &error))
{
g_assert_no_error (error);
}
+
+ return g_file_new_for_path (filename);
+}
+
+static void
+delete_document (GFile *location)
+{
+ if (g_file_query_exists (location, NULL))
+ {
+ GError *err = NULL;
+
+ g_file_delete (location, NULL, &err);
+ g_assert_no_error (err);
+ }
+
+ test_completed = TRUE;
}
static void
@@ -57,8 +73,6 @@ on_document_loaded (GeditDocument *document,
GtkTextIter start, end;
gchar *text;
- test_completed = TRUE;
-
g_assert_no_error (error);
if (data->in_buffer != NULL)
@@ -75,6 +89,8 @@ on_document_loaded (GeditDocument *document,
==,
data->newline_type);
}
+
+ delete_document (data->file);
}
static void
@@ -87,13 +103,14 @@ test_loader (const gchar *filename,
gchar *uri;
GeditDocument *document;
- create_document (filename, contents);
+ file = create_document (filename, contents);
document = gedit_document_new ();
LoaderTestData *data = g_slice_new (LoaderTestData);
data->in_buffer = in_buffer;
data->newline_type = newline_type;
+ data->file = file;
test_completed = FALSE;
@@ -102,13 +119,11 @@ test_loader (const gchar *filename,
G_CALLBACK (on_document_loaded),
data);
- file = g_file_new_for_path (filename);
uri = g_file_get_uri (file);
gedit_document_load (document, uri, gedit_encoding_get_utf8 (), 0, FALSE);
g_free (uri);
- g_object_unref (file);
while (!test_completed)
{
@@ -116,6 +131,7 @@ test_loader (const gchar *filename,
}
g_slice_free (LoaderTestData, data);
+ g_object_unref (file);
g_object_unref (document);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]