1 /*-------------------------------------------------------------------------
2 * C-Pluff, a plug-in framework for C
3 * Copyright 2007 Johannes Lehtinen
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included
13 * in all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 *-----------------------------------------------------------------------*/
28 void initdestroy(void) {
31 for (i = 0; i < 10; i++) {
32 check(cp_init() == CP_OK);
37 void initcreatedestroy(void) {
40 for (i = 0; i < 3; i++) {
43 init_context(CP_LOG_ERROR, &errors);
49 void initloaddestroy(void) {
52 for (i = 0; i < 3; i++) {
56 const char *pdir = plugindir("minimal");
59 ctx = init_context(CP_LOG_ERROR, &errors);
60 check((pi = cp_load_plugin_descriptor(ctx, pdir, &status)) != NULL && status == CP_OK);
61 cp_release_info(ctx, pi);
67 void initinstalldestroy(void) {
70 for (i = 0; i < 3; i++) {
74 const char *pdir = plugindir("minimal");
77 ctx = init_context(CP_LOG_ERROR, &errors);
78 check((pi = cp_load_plugin_descriptor(ctx, pdir, &status)) != NULL && status == CP_OK);
79 check(cp_install_plugin(ctx, pi) == CP_OK);
80 cp_release_info(ctx, pi);
86 void initstartdestroy(void) {
89 for (i = 0; i < 3; i++) {
93 const char *pdir = plugindir("minimal");
96 ctx = init_context(CP_LOG_ERROR, &errors);
97 check((pi = cp_load_plugin_descriptor(ctx, pdir, &status)) != NULL && status == CP_OK);
98 check(cp_install_plugin(ctx, pi) == CP_OK);
99 cp_release_info(ctx, pi);
100 check(cp_start_plugin(ctx, "minimal") == CP_OK);
106 void initstartdestroyboth(void) {
109 for (i = 0; i < 3; i++) {
111 cp_plugin_info_t *pi;
113 const char *pdir = plugindir("minimal");
116 ctx = init_context(CP_LOG_ERROR, &errors);
117 check((pi = cp_load_plugin_descriptor(ctx, pdir, &status)) != NULL && status == CP_OK);
118 check(cp_install_plugin(ctx, pi) == CP_OK);
119 cp_release_info(ctx, pi);
120 check(cp_start_plugin(ctx, "minimal") == CP_OK);
121 cp_destroy_context(ctx);