Verify event delivery in a separate reader process.
20{
21 if (argc != 7)
22 {
23 return 1;
24 }
25 auto const offset = std::stoull(argv[3]);
26 auto const count = std::stoull(argv[4]);
30 {
31 return 2;
32 }
33 auto ready = 'R';
34 if ((::write(std::stoi(argv[5]), &ready, 1) != 1) || (::read(std::stoi(argv[6]), &ready, 1) != 1))
35 {
36 return 3;
37 }
38 for (
auto i = std::uint64_t{0}; i <
count; ++i)
39 {
41 auto payload = static_cast<std::uint8_t*>(nullptr);
44 {
45 return 4;
46 }
47 for (auto byte = std::uint32_t{0}; byte < info.eventSize; ++byte)
48 {
49 if (payload[byte] != static_cast<std::uint8_t>((info.timestamp * 29) + (std::uint64_t{byte} * 7)))
50 {
51 return 5;
52 }
53 }
54 }
56 {
57 return 6;
58 }
59 return 0;
60}
MXL_EXPORT mxlStatus mxlFlowReaderGetEvent(mxlFlowReader reader, uint64_t timeoutNs, mxlEventInfo *event, uint8_t **payload)
MXL_EXPORT mxlStatus mxlReleaseFlowReader(mxlInstance instance, mxlFlowReader reader)
struct mxlFlowReader_t * mxlFlowReader
struct mxlEventInfo_t mxlEventInfo
Metadata for one event queue entry, either a complete event or a fragment.
MXL_EXPORT mxlStatus mxlCreateFlowReader(mxlInstance instance, char const *flowId, char const *options, mxlFlowReader *reader)
MXL_EXPORT mxlStatus mxlDestroyInstance(mxlInstance in_instance)
MXL_EXPORT mxlInstance mxlCreateInstance(char const *in_mxlDomain, char const *in_options)
std::size_t count(uuids::uuid id) const noexcept
Returns the number of writers registered for flow id 'id'.