~ubuntu-branches/ubuntu/quantal/libpeas/quantal

« back to all changes in this revision

Viewing changes to tests/libpeas/extension-c.c

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2011-09-22 08:38:23 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: package-import@ubuntu.com-20110922083823-hm0gu89o2utvrxa9
Tags: 1.1.4-0ubuntu1
* New upstream release:
  - Fix to work with PyGObject 3.
  - Do not expose the peas_extension_set_call* API to GObject-Introspection.
  - Disable log hooks used by PyGObject and Seed.
  - Doc updates.
  - Misc improvement and fixes.
  - Translation updates.
* debian/control.in: Bump pygobject build dep as per configure.ac.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include <config.h>
24
24
#endif
25
25
 
26
 
#include "libpeas/peas-extension-base.h"
 
26
#include "libpeas/peas.h"
27
27
 
28
28
#include "testing/testing-extension.h"
29
29
#include "introspection/introspection-callable.h"
30
 
#include "introspection/introspection-properties.h"
31
30
 
32
31
static void
33
32
test_extension_c_instance_refcount (PeasEngine *engine)
59
58
  PeasPluginInfo *info;
60
59
  PeasExtension *extension;
61
60
 
62
 
  info = peas_engine_get_plugin_info (engine, "extension-c");
 
61
  info = peas_engine_get_plugin_info (engine, "loadable");
63
62
 
64
63
  g_assert (peas_engine_load_plugin (engine, info));
65
64
 
66
65
  extension = peas_engine_create_extension (engine, info,
67
 
                                            INTROSPECTION_TYPE_PROPERTIES,
 
66
                                            PEAS_TYPE_ACTIVATABLE,
68
67
                                            NULL);
69
68
 
70
69
  g_assert (PEAS_IS_EXTENSION_BASE (extension));
73
72
  g_object_unref (extension);
74
73
}
75
74
 
 
75
static void
 
76
test_extension_c_nonexistent (PeasEngine *engine)
 
77
{
 
78
  PeasPluginInfo *info;
 
79
 
 
80
  testing_util_push_log_hook ("*extension-c-nonexistent*No such file*");
 
81
  testing_util_push_log_hook ("Could not load*'extension-c-nonexistent'");
 
82
  testing_util_push_log_hook ("Error loading plugin 'extension-c-nonexistent'");
 
83
 
 
84
  info = peas_engine_get_plugin_info (engine, "extension-c-nonexistent");
 
85
 
 
86
  g_assert (!peas_engine_load_plugin (engine, info));
 
87
}
 
88
 
76
89
int
77
90
main (int   argc,
78
91
      char *argv[])
80
93
  g_test_init (&argc, &argv, NULL);
81
94
  g_type_init ();
82
95
 
83
 
  EXTENSION_TESTS (c);
 
96
  /* Only test the basics */
 
97
  EXTENSION_TESTS_INIT (c);
 
98
 
 
99
  /* We still need to add the callable tests
 
100
   * because of peas_extension_call()
 
101
   */
 
102
  EXTENSION_TESTS_CALLABLE (c);
84
103
 
85
104
  EXTENSION_TEST (c, "instance-refcount", instance_refcount);
86
105
  EXTENSION_TEST (c, "plugin-info", plugin_info);
 
106
  EXTENSION_TEST (c, "nonexistent", nonexistent);
87
107
 
88
108
  return testing_run_tests ();
89
109
}