Improvements before MAX IV test

This commit is contained in:
2024-04-25 20:11:58 +02:00
parent 2c8e1fd83d
commit ea70b27e85
80 changed files with 1835 additions and 1781 deletions

View File

@@ -14,40 +14,39 @@ void test_puller(ZMQImagePuller *puller,
std::vector<size_t> &diff_content,
std::vector<size_t> &nimages) {
puller->WaitForImage();
if (puller->GetFrameType() != CBORStream2Deserializer::Type::START) {
auto img = puller->WaitForImage();
if (!img.cbor || !img.cbor->start_message) {
diff_content[writer_id]++;
return;
}
puller->WaitForImage();
while (puller->GetFrameType() != CBORStream2Deserializer::Type::END) {
if (puller->GetFrameType() == CBORStream2Deserializer::Type::IMAGE) {
auto image = puller->GetDataMessage();
if ((nwriter > 1) && ((image.number / 16) % nwriter != writer_id))
if ((!img.cbor->start_message->write_master_file) || (img.cbor->start_message->write_master_file.value() != (writer_id == 0)))
diff_content[writer_id]++;
img = puller->WaitForImage();
while (img.cbor && !img.cbor->end_message) {
if (img.cbor->data_message) {
if ((nwriter > 1) && ((img.cbor->data_message->number / 16) % nwriter != writer_id))
diff_split[writer_id]++;
if (image.image.size != x.GetPixelsNum() * sizeof(uint16_t))
if (img.cbor->data_message->image.size != x.GetPixelsNum() * sizeof(uint16_t))
diff_size[writer_id]++;
else if (memcmp(image.image.data, image1.data() + image.number * x.GetPixelsNum(),
else if (memcmp(img.cbor->data_message->image.data, image1.data() + img.cbor->data_message->number * x.GetPixelsNum(),
x.GetPixelsNum() * sizeof(uint16_t)) != 0)
diff_content[writer_id]++;
if (image.image.xpixel != RAW_MODULE_COLS)
if (img.cbor->data_message->image.xpixel != RAW_MODULE_COLS)
diff_content[writer_id]++;
if (image.image.ypixel != RAW_MODULE_LINES)
if (img.cbor->data_message->image.ypixel != RAW_MODULE_LINES)
diff_content[writer_id]++;
if (image.image.pixel_depth_bytes != 2)
if (img.cbor->data_message->image.pixel_depth_bytes != 2)
diff_content[writer_id]++;
if (image.image.algorithm != CompressionAlgorithm::NO_COMPRESSION)
if (img.cbor->data_message->image.algorithm != CompressionAlgorithm::NO_COMPRESSION)
diff_content[writer_id]++;
nimages[writer_id]++;
}
puller->WaitForImage();
img = puller->WaitForImage();
}
auto start = puller->GetStartMessage();
if ((!start.write_master_file) || (start.write_master_file.value() != (writer_id == 0)))
diff_content[writer_id]++;
}
TEST_CASE("ZMQImageCommTest_1Writer","[ZeroMQ]") {