summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/Makefile.am5
-rw-r--r--test/run-tests.c1
-rw-r--r--test/run-tests.h1
-rw-r--r--test/test-action-menu.c85
4 files changed, 90 insertions, 2 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index e084fc5..ee224e0 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -12,9 +12,10 @@ test_run_tests_SOURCES = \
test/test-init.c \
test/test-hello.c \
test/test-application.c \
- test/test-page-manager.c \
+ test/test-page-manager.c \
test/test-splash-page-manager.c \
- test/test-window.c
+ test/test-window.c \
+ test/test-action-menu.c
test_run_tests_CPPFLAGS = $(TEST_FLAGS)
test_run_tests_LDADD = $(TEST_LIBS)
diff --git a/test/run-tests.c b/test/run-tests.c
index dec135a..b9ce062 100644
--- a/test/run-tests.c
+++ b/test/run-tests.c
@@ -92,6 +92,7 @@ main (int argc,
add_window_tests ();
add_page_manager_tests ();
add_splash_page_manager_tests ();
+ add_action_menu_tests ();
return g_test_run ();
}
diff --git a/test/run-tests.h b/test/run-tests.h
index 32caa7e..39ee9b9 100644
--- a/test/run-tests.h
+++ b/test/run-tests.h
@@ -37,5 +37,6 @@ void add_application_tests (void);
void add_window_tests (void);
void add_page_manager_tests (void);
void add_splash_page_manager_tests (void);
+void add_action_menu_tests (void);
#endif /* RUN_TESTS_H */
diff --git a/test/test-action-menu.c b/test/test-action-menu.c
new file mode 100644
index 0000000..11b7cfa
--- /dev/null
+++ b/test/test-action-menu.c
@@ -0,0 +1,85 @@
+#include <gtk/gtk.h>
+#include <endless/endless.h>
+
+#include "run-tests.h"
+
+#define ADD_ACTION_MENU_TEST(path, test_func) \
+ g_test_add ((path), ActionMenuFixture, NULL, \
+ am_fixture_setup, (test_func), am_fixture_teardown)
+
+typedef struct
+{
+ GtkWidget *action_menu;
+ GtkAction *action1;
+ GtkAction *action2;
+ GtkAction *action3;
+} ActionMenuFixture;
+
+static void
+am_fixture_setup (ActionMenuFixture *fixture,
+ gconstpointer unused)
+{
+ fixture->action_menu = eos_action_menu_new ();
+ fixture->action1 = gtk_action_new ("1", "1", "1", "1");
+ fixture->action2 = gtk_action_new ("2", "2", "2", "2");
+ fixture->action3 = gtk_action_new ("3", "3", "3", "3");
+}
+
+static void
+am_fixture_teardown (ActionMenuFixture *fixture,
+ gconstpointer unused)
+{
+ gtk_widget_destroy (fixture->action_menu);
+}
+
+/* TESTS */
+
+static void
+test_am_add_action (ActionMenuFixture *fixture,
+ gconstpointer unused)
+{
+
+}
+
+static void
+test_am_get_action (ActionMenuFixture *fixture,
+ gconstpointer unused)
+{
+
+}
+
+static void
+test_am_list_actions (ActionMenuFixture *fixture,
+ gconstpointer unused)
+{
+
+}
+
+static void
+test_am_remove_action (ActionMenuFixture *fixture,
+ gconstpointer unused)
+{
+
+}
+
+static void
+test_am_remove_action_by_name (ActionMenuFixture *fixture,
+ gconstpointer unused)
+{
+
+}
+
+void
+add_action_menu_tests (void)
+{
+ ADD_ACTION_MENU_TEST ("/action-menu/add-action",
+ test_am_add_action);
+ ADD_ACTION_MENU_TEST ("/action-menu/get-action",
+ test_am_get_action);
+ ADD_ACTION_MENU_TEST ("/action-menu/list-actions",
+ test_am_list_actions);
+ ADD_ACTION_MENU_TEST ("/action-menu/remove-action",
+ test_am_remove_action);
+ ADD_ACTION_MENU_TEST ("/action-menu/remove-action-by-name",
+ test_am_remove_action_by_name);
+}