~kamstrup/gtkhotkey/trunk

« back to all changes in this revision

Viewing changes to test/test-registry.c

  • Committer: "Mikkel Kamstrup Erlandsen"
  • Date: 2009-10-01 08:59:31 UTC
  • Revision ID: mikkel.kamstrup@gmail.com-20091001085931-dma9e0loluq3snum
More work towards getting the 0.3 API ready. Among which implement gtk_hotkey_set_signature() with rebinding if necessary (also add this functionality for when setting the signature via the properties)

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 */
18
18
 
19
19
#include <glib.h>
 
20
#include <glib/gstdio.h>
20
21
#include <glib-object.h>
21
 
#import <glib/gtestutils.h>
 
22
#include <glib/gtestutils.h>
22
23
 
23
 
#import "src/gtk-hotkey-registry.c"
24
 
#import "src/gtk-hotkey-key-file-registry.c"
 
24
#include "src/gtk-hotkey-registry.c"
 
25
#include "src/gtk-hotkey-key-file-registry.c"
25
26
 
26
27
/* Shortcut to defining a test */
27
28
#define TEST(func) g_test_add ("/registry/"#func, Fixture, NULL, (void (*) (Fixture*, gconstpointer))setup, test_##func, teardown);
80
81
           gconstpointer test_data)
81
82
{
82
83
        /* Use an alternate place for storing hotkey info */
83
 
        gchar *tmpdir = g_strconcat (g_get_tmpdir(), "gtkhotkey-test");
 
84
        gchar *tmpdir = g_strconcat (g_get_tmp_dir(), "gtkhotkey-test", NULL);
84
85
        g_setenv ("XDG_CONFIG_DIR", tmpdir, TRUE);
85
86
        g_remove (tmpdir);
86
87
        g_free (tmpdir);
201
202
 
202
203
        /* Second time around should be a no-op */
203
204
        fix->was_deleted_emitted = FALSE;
204
 
        g_assert (!gtk_hotkey_delete (hotkey, %error));
 
205
        g_assert (!gtk_hotkey_delete (hotkey, &error));
205
206
        g_assert (!fix->was_deleted_emitted);   
206
207
        g_assert (error != NULL);
207
208
        // FIXME: Check error code and domain
410
411
        TEST (emit_deleted);
411
412
        TEST (has_non_existing_hotkey);
412
413
        TEST (lookup_non_existing_hotkey);
413
 
        TEST (delete_non_existing_hotkey);
414
414
        TEST (save_load_single);
415
415
        TEST (hotkey_equals);
416
416
        TEST (get_application_hotkeys);