[libpeas] Added test for OS dependant help



commit 1c61e400788327ee72f1eda40a7e191488c0e6b1
Author: Garrett Regier <alias301 gmail com>
Date:   Tue Jan 18 01:51:56 2011 -0800

    Added test for OS dependant help

 tests/libpeas/plugin-info.c                    |   21 +++++++++++++++++++++
 tests/libpeas/plugins/os-dependant-help.plugin |   12 ++++++++++++
 2 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/tests/libpeas/plugin-info.c b/tests/libpeas/plugin-info.c
index de0f2fd..1d2f81a 100644
--- a/tests/libpeas/plugin-info.c
+++ b/tests/libpeas/plugin-info.c
@@ -163,6 +163,25 @@ test_plugin_info_missing_name (PeasEngine *engine)
   g_assert (peas_engine_get_plugin_info (engine, "invalid-info-name") == NULL);
 }
 
+static void
+test_plugin_info_os_dependant_help (PeasEngine *engine)
+{
+  PeasPluginInfo *info;
+  const gchar *help;
+
+  info = peas_engine_get_plugin_info (engine, "os-dependant-help");
+
+  help = peas_plugin_info_get_help_uri (info);
+
+#ifdef G_OS_WIN32
+  g_assert_cmpstr (help, ==, "Windows");
+#elif defined(OS_OSX)
+  g_assert_cmpstr (help, ==, "MacOS-X");
+#else
+  g_assert_cmpstr (help, ==, "GNOME");
+#endif
+}
+
 int
 main (int    argc,
       char **argv)
@@ -185,6 +204,8 @@ main (int    argc,
   TEST ("missing-module", missing_module);
   TEST ("missing-name", missing_name);
 
+  TEST ("os-dependant-help", os_dependant_help);
+
 #undef TEST
 
   g_object_unref (peas_engine_get_default ());
diff --git a/tests/libpeas/plugins/os-dependant-help.plugin b/tests/libpeas/plugins/os-dependant-help.plugin
new file mode 100644
index 0000000..a382b91
--- /dev/null
+++ b/tests/libpeas/plugins/os-dependant-help.plugin
@@ -0,0 +1,12 @@
+[Plugin]
+Module=os-dependant-help
+IAge=2
+Name=os-dependatn-help
+Description=This plugin is for the testing OS dependant help.
+Authors=Garrett Regier
+Copyright=Copyright © 2011 Garrett Regier
+Website=http://live.gnome.org/Libpeas
+Help=should-not-be-displayed
+Help-GNOME=GNOME
+Help-MacOS-X=MacOS-X
+Help-Windows=Windows



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]