LCOV - code coverage report
Current view: top level - confmodel/test/apps - jsonable_test.cxx (source / functions) Coverage Total Hit
Test: code.result Lines: 0.0 % 20 0
Test Date: 2026-10-11 15:05:20 Functions: 0.0 % 1 0

            Line data    Source code
       1              : #include "logging/Logging.hpp"
       2              : 
       3              : #include "conffwk/Configuration.hpp"
       4              : 
       5              : #include "confmodel/Jsonable.hpp"
       6              : #include "confmodel/JsonableTest.hpp"
       7              : 
       8              : #include "nlohmann/json.hpp"
       9              : 
      10              : #include <iostream>
      11              : #include <list>
      12              : #include <string>
      13              : 
      14              : using namespace dunedaq;
      15              : 
      16              : int
      17            0 : main(int /*argc*/, char* /*argv*/[])
      18              : {
      19            0 :   std::list<std::string> inc_files{ "schema/confmodel/dunedaq.schema.xml" };
      20            0 :   conffwk::Configuration confdb("oksconflibs");
      21            0 :   std::string dbfile{ "/tmp/js-test.data.xml" };
      22            0 :   confdb.create(dbfile, inc_files);
      23              : 
      24            0 :   conffwk::ConfigObject config_obj1;
      25            0 :   confdb.create(dbfile, "JsonableTest", "test1", config_obj1);
      26              : 
      27            0 :   conffwk::ConfigObject config_obj2;
      28            0 :   confdb.create(dbfile, "JsonableTest", "test2", config_obj2);
      29              : 
      30            0 :   config_obj1.set_by_val<unsigned int>("this", 1);
      31            0 :   config_obj1.set_by_val<unsigned int>("that", 1);
      32            0 :   config_obj1.set_obj("other", &config_obj2);
      33              : 
      34            0 :   config_obj2.set_by_val<unsigned int>("this", 2);
      35            0 :   config_obj2.set_by_val<unsigned int>("that", 2);
      36              : 
      37            0 :   auto dal = confdb.get<confmodel::JsonableTest>("test1");
      38            0 :   nlohmann::json json1 = dal->to_json();
      39            0 :   std::cout << "json1:\n=====\n" << json1.dump(4) << "\n";
      40              : 
      41            0 :   nlohmann::json json2 = dal->to_json(false, true);
      42            0 :   std::cout << "json2:\n=====\n" << json2.dump(4) << "\n";
      43            0 : }
        

Generated by: LCOV version 2.0-1