2020// LibTokaMap includes
2121#include < map_types/data_source_mapping.hpp>
2222#include < map_types/map_arguments.hpp>
23+ #include < handlers/mapping_handler.hpp>
2324#include < utils/ram_cache.hpp>
2425
2526// UDA includes
@@ -42,7 +43,7 @@ make_map_arguments(const std::type_index data_type, const int rank)
4243 static std::unordered_map<std::string, std::unique_ptr<Mapping>> empty_entries;
4344 static nlohmann::json empty_global_data = nlohmann::json::object ();
4445
45- return MapArguments (empty_entries, empty_global_data, data_type, rank);
46+ return MapArguments (empty_entries, empty_global_data, data_type, rank, false , false , nullptr );
4647}
4748
4849int plugin_return_scalar (IDAM_PLUGIN_INTERFACE* interface)
@@ -91,7 +92,9 @@ TEST_CASE("PluginMapping calls UDA data source", "[plugin_mapping][uda_data_sour
9192 std::strcpy (plugin.format , " UDA" );
9293
9394 auto test_source = std::make_unique<UDADataSource>(" UDA" , " get" , &plugin_list, false );
94- DataSourceMapping::register_data_source (" UDA" , std::move (test_source));
95+ auto * data_source_ptr = test_source.get ();
96+ MappingHandler mapping_handler;
97+ mapping_handler.register_data_source (" UDA" , std::move (test_source));
9598
9699 SECTION (" Integer values are correctly returned" )
97100 {
@@ -101,7 +104,7 @@ TEST_CASE("PluginMapping calls UDA data source", "[plugin_mapping][uda_data_sour
101104 std::optional<std::string> slice = {};
102105 std::shared_ptr<RamCache> ram_cache = nullptr ;
103106
104- auto mapping = std::make_unique<DataSourceMapping>(" UDA" , request_args, offset, scale, slice, ram_cache );
107+ auto mapping = std::make_unique<DataSourceMapping>(" UDA" , data_source_ptr, request_args, offset, scale, slice);
105108 REQUIRE (mapping != nullptr );
106109
107110 MapArguments map_args = make_map_arguments (std::type_index{typeid (int )}, 1 );
@@ -126,7 +129,9 @@ TEST_CASE("Slicing and offsetting returned data", "[plugin_mapping][uda_data_sou
126129 std::strcpy (plugin.format , " UDA" );
127130
128131 auto test_source = std::make_unique<UDADataSource>(" UDA" , " get" , &plugin_list, false );
129- DataSourceMapping::register_data_source (" UDA" , std::move (test_source));
132+ auto * data_source_ptr = test_source.get ();
133+ MappingHandler mapping_handler;
134+ mapping_handler.register_data_source (" UDA" , std::move (test_source));
130135
131136 SECTION (" Float values are correctly returned" )
132137 {
@@ -136,7 +141,7 @@ TEST_CASE("Slicing and offsetting returned data", "[plugin_mapping][uda_data_sou
136141 std::optional<std::string> slice = {};
137142 std::shared_ptr<RamCache> ram_cache = nullptr ;
138143
139- auto mapping = std::make_unique<DataSourceMapping>(" UDA" , request_args, offset, scale, slice, ram_cache );
144+ auto mapping = std::make_unique<DataSourceMapping>(" UDA" , data_source_ptr, request_args, offset, scale, slice);
140145 REQUIRE (mapping != nullptr );
141146
142147 MapArguments map_args = make_map_arguments (std::type_index{typeid (int )}, 1 );
@@ -161,7 +166,7 @@ TEST_CASE("Slicing and offsetting returned data", "[plugin_mapping][uda_data_sou
161166 std::string slice = " [0:" + std::to_string (range_len) + " ]" ;
162167 std::shared_ptr<RamCache> ram_cache = nullptr ;
163168
164- auto mapping = std::make_unique<DataSourceMapping>(" UDA" , request_args, offset, scale, slice, ram_cache );
169+ auto mapping = std::make_unique<DataSourceMapping>(" UDA" , data_source_ptr, request_args, offset, scale, slice);
165170 REQUIRE (mapping != nullptr );
166171
167172 MapArguments map_args = make_map_arguments (std::type_index{typeid (int )}, 1 );
0 commit comments