summaryrefslogtreecommitdiff
path: root/tests/writer.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/writer.c')
-rw-r--r--tests/writer.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/tests/writer.c b/tests/writer.c
index 92757d1..f4813ec 100644
--- a/tests/writer.c
+++ b/tests/writer.c
@@ -19,26 +19,44 @@
#include <glib.h>
-#include "service/dconf-generated.h"
#include "service/dconf-writer.h"
+/* Test basic initialisation of a #DConfWriter. This is essentially a smoketest. */
static void
test_writer_basic (void)
{
g_autoptr(DConfWriter) writer = NULL;
- writer = dconf_writer_new (DCONF_TYPE_KEYFILE_WRITER, "some-name");
+ writer = DCONF_WRITER (dconf_writer_new (DCONF_TYPE_KEYFILE_WRITER, "some-name"));
g_assert_nonnull (writer);
g_assert_cmpstr (dconf_writer_get_name (writer), ==, "some-name");
}
+/* TODO */
+static void
+test_writer_corrupt_file (void)
+{
+ g_autoptr(DConfWriter) writer = NULL;
+ gboolean retval;
+ g_autoptr(GError) local_error = NULL;
+
+ writer = DCONF_WRITER (dconf_writer_new (DCONF_TYPE_KEYFILE_WRITER, "some-name"));
+ g_assert_nonnull (writer);
+
+ writer_iface = DCONF_DBUS_WRITER_GET_IFACE (writer);
+ retval = writer_iface->handle_init (DCONF_DBUS_WRITER (writer), invocation);
+
+ /* TODO: this is arse */
+}
+
int
main (int argc, char **argv)
{
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/writer/basic", test_writer_basic);
+ g_test_add_func ("/writer/corrupt-file", test_writer_corrupt_file);
return g_test_run ();
}