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

            Line data    Source code
       1              : 
       2              : /* This application creates a ERSPublisher and dumps regular messages via the system
       3              : 
       4              :  */
       5              : 
       6              : #include <chrono>
       7              : #include <memory>
       8              : #include <sstream>
       9              : #include <thread>
      10              : 
      11              : #include <ers/OutputStream.hpp>
      12              : #include <ers/StreamManager.hpp>
      13              : 
      14              : using namespace std;
      15              : 
      16            0 : ERS_DECLARE_ISSUE(erskafka, TestIssue, "this is issue with ID: " << id, ((int)id))
      17              : 
      18              : int
      19            0 : main(int argc, char* argv[])
      20              : {
      21              : 
      22            0 :   std::string conf = "protobufstream(monkafka.cern.ch:30092)";
      23              : 
      24            0 :   setenv("DUNEDAQ_PARTITION", "TestPartition", 0);
      25            0 :   setenv("DUNEDAQ_APPLICATION_NAME", "ERSStreamTest", 0);
      26              : 
      27            0 :   auto stream = ers::StreamFactory::instance().create_out_stream(conf);
      28              : 
      29              :   int n = 20;
      30            0 :   for (int i = 0; i < n; ++i) {
      31            0 :     erskafka::TestIssue issue(ERS_HERE, i);
      32            0 :     stream->write(issue);
      33            0 :     this_thread::sleep_for(std::chrono::milliseconds(500 + ((i % 2) * 1000)));
      34            0 :   }
      35              : 
      36            0 :   erskafka::TestIssue first(ERS_HERE, 100);
      37            0 :   erskafka::TestIssue second(ERS_HERE, 200, first);
      38            0 :   erskafka::TestIssue third(ERS_HERE, 300, second);
      39              : 
      40            0 :   stream->write(std::move(third));
      41            0 :   this_thread::sleep_for(std::chrono::milliseconds(500));
      42              : 
      43            0 :   return 0;
      44            0 : }
        

Generated by: LCOV version 2.0-1