Line data Source code
1 : #include <fas/testing.hpp>
2 : #include <jsonrpc_package.hpp>
3 : #include <wfc/module/imodule.hpp>
4 : #include <wfc/core/wfcglobal.hpp>
5 : #include <wfc/asio.hpp>
6 : #include <memory>
7 :
8 : namespace {
9 :
10 : struct _package_;
11 : struct _global_;
12 : struct _io_service_;
13 :
14 3 : UNIT(init, "")
15 : {
16 : using namespace fas::testing;
17 1 : auto pkg = std::make_shared<wfc::jsonrpc_package>();
18 2 : auto global = std::make_shared<wfc::wfcglobal>( GET_REF(_io_service_) );
19 1 : GET_REF(_package_) = pkg;
20 1 : GET_REF(_global_) = global;
21 1 : pkg->create(global);
22 2 : t << nothing;
23 1 : }
24 :
25 3 : UNIT(backlog, "")
26 : {
27 : using namespace fas::testing;
28 1 : std::shared_ptr<wfc::wfcglobal> g = GET_REF(_global_);
29 1 : t << is_true<assert>(g!=nullptr) << FAS_FL;
30 2 : auto m = g->registry.template get_object<wfc::imodule>("module","jsonrpc-backlog", false);
31 2 : t << is_true<assert>(m!=nullptr) << FAS_FL;
32 1 : }
33 :
34 : }
35 :
36 1 : BEGIN_SUITE(package_suite, "")
37 : ADD_VALUE(_package_, std::shared_ptr<wfc::jsonrpc_package> )
38 : ADD_VALUE(_io_service_, wfc::asio::io_service )
39 : ADD_VALUE(_global_, std::shared_ptr<wfc::wfcglobal>)
40 : ADD_UNIT( init )
41 : ADD_UNIT( backlog )
42 7 : END_SUITE(package_suite)
|