Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b3a2765
unit tests for ReadoutTypes
Jul 10, 2025
7c88da6
removed first test, changed the others and added a test to check begi…
Jul 10, 2025
6f084c7
added comments
Jul 11, 2025
4d43317
BufferedReadWrite_test fix
Jul 15, 2025
7dbe833
CMakeLists change for BufferedReadWrite_test
Jul 15, 2025
d999652
started unit tests for IterableQueueModel
Jul 17, 2025
2bcd718
RecorderConcept inherits from opmonlib::MonitorableObject, fix type c…
Jul 29, 2025
dc3c592
create utilities for unit tests, fixes for IterableQueueModel_test
Aug 4, 2025
94676f4
seperate bloated unit tests into smaller ones
Aug 5, 2025
a28af2c
Merge remote-tracking branch 'origin/develop' into tests/unit_tests
Aug 5, 2025
7cca627
add corner cases and remove redundant checks in unit tests
Aug 7, 2025
e2facb3
add unit test for get_skiplist function in SkiplistLatencyBufferModel
Aug 7, 2025
6ba0c5e
add unit tests for TaskRawDataProcessorModel
Aug 11, 2025
58d3d0a
fix skiplist test app cleaner functionality and add multiple producer…
Aug 19, 2025
94fc411
Merge remote-tracking branch 'origin/develop' into tests/unit_tests
Aug 20, 2025
a30d06d
add unit tests for DefaultRequestHandlerModel
Aug 25, 2025
f0feb07
add unit tests for data handling model, fix tests for default request…
Sep 15, 2025
e4040d3
Merge remote-tracking branch 'origin/develop' into tests/unit_tests
Sep 15, 2025
94738cf
update fake latency buffer
Sep 15, 2025
5c783ed
change some function names used in unit tests for default request han…
Sep 16, 2025
e164311
combined two fake test raw data processors
Sep 16, 2025
9161c71
carry fake data handling model to unittestutilities and change its name
Sep 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,20 @@ daq_add_application(datahandlinglibs_test_bufferedfilereader test_bufferedfilere
daq_add_application(datahandlinglibs_test_skiplist test_skiplist_app.cxx TEST LINK_LIBRARIES datahandlinglibs ${BOOST_LIBS})
daq_add_application(datahandlinglibs_test_composite_key test_composite_key_app.cxx TEST LINK_LIBRARIES datahandlinglibs ${BOOST_LIBS})

daq_add_application(datahandlinglibs_test_to_include_to_lcov_app test_to_include_to_lcov_app.cxx TEST LINK_LIBRARIES datahandlinglibs ${BOOST_LIBS})

##############################################################################
# Unit Tests

#daq_add_unit_test(datahandlinglibs_BufferedReadWrite_test LINK_LIBRARIES datahandlinglibs ${BOOST_LIBS})
daq_add_unit_test(datahandlinglibs_BufferedReadWrite_test LINK_LIBRARIES datahandlinglibs ${BOOST_LIBS})
#daq_add_unit_test(datahandlinglibs_VariableSizeElementQueue_test LINK_LIBRARIES datahandlinglibs ${BOOST_LIBS})
daq_add_unit_test(datahandlinglibs_DataMoveCallbackRegistry_test LINK_LIBRARIES datahandlinglibs ${BOOST_LIBS})
daq_add_unit_test(datahandlinglibs_ReadoutTypes_test LINK_LIBRARIES datahandlinglibs ${BOOST_LIBS})
daq_add_unit_test(datahandlinglibs_IterableQueueModel_test LINK_LIBRARIES datahandlinglibs ${BOOST_LIBS})
daq_add_unit_test(datahandlinglibs_SkiplistLatencyBufferModel_test LINK_LIBRARIES datahandlinglibs ${BOOST_LIBS})
daq_add_unit_test(datahandlinglibs_TaskRawDataProcessorModel_test LINK_LIBRARIES datahandlinglibs ${BOOST_LIBS})
daq_add_unit_test(datahandlinglibs_DefaultRequestHandlerModel_test LINK_LIBRARIES datahandlinglibs ${BOOST_LIBS})
daq_add_unit_test(datahandlinglibs_DataHandlingModel_test LINK_LIBRARIES datahandlinglibs ${BOOST_LIBS})

##############################################################################
# Installation
Expand Down
2 changes: 1 addition & 1 deletion include/datahandlinglibs/ReadoutTypes.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @file ReadoutTypes.hpp Common types in datahandlinglibs
* @file ReadoutTypes.hpp Common types in datahandlinglibs, used for tests
*
* This is part of the DUNE DAQ , copyright 2020.
* Licensing/copyright details are in the COPYING file that you should have
Expand Down
2 changes: 1 addition & 1 deletion include/datahandlinglibs/concepts/RecorderConcept.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
namespace dunedaq {
namespace datahandlinglibs {

class RecorderConcept
class RecorderConcept : public opmonlib::MonitorableObject
{
public:
RecorderConcept() {}
Expand Down
34 changes: 1 addition & 33 deletions include/datahandlinglibs/models/IterableQueueModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,38 +91,6 @@ struct IterableQueueModel : public LatencyBufferConcept<T>
, writeIndex_(0)
{}

// Explicit constructor with size
explicit IterableQueueModel(std::size_t size) // size must be >= 2
: LatencyBufferConcept<T>() // NOLINT(build/unsigned)
, numa_aware_(false)
, numa_node_(0)
, intrinsic_allocator_(false)
, alignment_size_(0)
, invalid_configuration_requested_(false)
, prefill_ready_(false)
, prefill_done_(false)
, size_(size)
, records_(static_cast<T*>(std::malloc(sizeof(T) * size)))
, readIndex_(0)
, writeIndex_(0)
{
assert(size >= 2);
if (!records_) {
throw std::bad_alloc();
}
#if 0
ptrlogger = std::thread([&](){
while(true) {
auto const currentRead = readIndex_.load(std::memory_order_relaxed);
auto const currentWrite = writeIndex_.load(std::memory_order_relaxed);
TLOG() << "BEG:" << std::hex << &records_[0] << " END:" << &records_[size] << std::dec
<< " R:" << currentRead << " - W:" << currentWrite
<< " OFLOW:" << overflow_ctr;
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
});
#endif
}

// Constructor with alignment strategies
IterableQueueModel(std::size_t size, // size must be >= 2
Expand Down Expand Up @@ -218,7 +186,7 @@ struct IterableQueueModel : public LatencyBufferConcept<T>
// Gives a pointer to the current read index
const T* front() override;

// Gives a pointer to the current write index
// Gives a pointer to the last written element
const T* back() override;

// Gives a pointer to the first available slot of the queue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ DefaultRequestHandlerModel<RDT, LBT>::get_fragment_pieces(uint64_t start_win_ts,
}
}
else {
//TLOG() << "Add element " << element->get_timestamp();
TLOG() << "Add element " << element->get_timestamp();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Undo uncommenting (I assume for test purposes)

// We are somewhere in the middle -> the whole aggregated object (e.g.: superchunk) can be copied
frag_pieces.emplace_back(
std::make_pair<void*, size_t>(static_cast<void*>((*start_iter).begin()), element->get_payload_size()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ EmptyFragmentRequestHandlerModel<ReadoutType, LatencyBufferType>::issue_request(
<< fragment->get_element_id();
//auto frag = std::make_pair(std::move(fragment), datarequest.data_destination);
get_iom_sender<std::unique_ptr<daqdataformats::Fragment>>(datarequest.data_destination)
->send(std::move(fragment), inherited::m_fragment_send_timeout_ms);
->send(std::move(fragment), std::chrono::milliseconds(inherited::m_fragment_send_timeout_ms));
} catch (const ers::Issue& excpt) {
ers::warning(CannotWriteToQueue(
ERS_HERE, DefaultRequestHandlerModel<ReadoutType, LatencyBufferType>::m_sourceid, "fragment queue", excpt));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ IterableQueueModel<T>::front()
return &records_[currentRead];
}

// Gives a pointer to the current write index
// Gives a pointer to the last written element
template<class T>
const T*
IterableQueueModel<T>::back()
Expand Down
Loading