Line data Source code
1 : // Copyright (c) 2006-2021 Made to Order Software Corp. All Rights Reserved
2 : //
3 : // https://snapwebsites.org/project/cppthread
4 : // contact@m2osw.com
5 : //
6 : // This program is free software; you can redistribute it and/or modify
7 : // it under the terms of the GNU General Public License as published by
8 : // the Free Software Foundation; either version 2 of the License, or
9 : // (at your option) any later version.
10 : //
11 : // This program is distributed in the hope that it will be useful,
12 : // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 : // GNU General Public License for more details.
15 : //
16 : // You should have received a copy of the GNU General Public License along
17 : // with this program; if not, write to the Free Software Foundation, Inc.,
18 : // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 :
20 : // self
21 : //
22 : #include "plugin_testme.h"
23 :
24 : #include "catch_main.h"
25 :
26 :
27 :
28 :
29 :
30 : /** \brief In your plugins, a namespace is encourage but optional.
31 : *
32 : * You can choose to have a namespace or not. We think it is cleaner to
33 : * have such a namespace, but it is not mandatory at all.
34 : */
35 : namespace optional_namespace
36 : {
37 :
38 :
39 :
40 :
41 :
42 13 : CPPTHREAD_PLUGIN_START(testme, 5, 3)
43 : , ::cppthread::plugin_description("a test plugin to make sure it all works.")
44 : , ::cppthread::plugin_help_uri("https://snapwebsites.org/")
45 : , ::cppthread::plugin_icon("cute.ico")
46 : , ::cppthread::plugin_categorization_tag("test")
47 : , ::cppthread::plugin_categorization_tag("powerful")
48 : , ::cppthread::plugin_categorization_tag("software")
49 : , ::cppthread::plugin_conflicts("other_test")
50 : , ::cppthread::plugin_conflicts("power_test")
51 : , ::cppthread::plugin_conflicts("unknown")
52 : , ::cppthread::plugin_suggestions("beautiful")
53 16 : CPPTHREAD_PLUGIN_END(testme)
54 :
55 :
56 1 : void testme::bootstrap(void * data)
57 : {
58 1 : data_t * d(reinterpret_cast<data_t *>(data));
59 1 : CATCH_CHECK(d->f_value == 0xA987);
60 :
61 1 : plugin::bootstrap(data);
62 1 : }
63 :
64 :
65 0 : std::string testme::it_worked()
66 : {
67 0 : return std::string("it worked, didn't it?");
68 : }
69 :
70 :
71 3 : } // optional_namespace namespace
72 : // vim: ts=4 sw=4 et
|