testutil_monitoring.hpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MPL-2.0 */
2 
3 #ifndef __TESTUTIL_MONITORING_HPP_INCLUDED__
4 #define __TESTUTIL_MONITORING_HPP_INCLUDED__
5 
6 #include "../include/zmq.h"
7 #include "../src/stdint.hpp"
8 
9 #include <stddef.h>
10 
11 // General, i.e. non-security specific, monitor utilities
12 
13 int get_monitor_event_with_timeout (void *monitor_,
14  int *value_,
15  char **address_,
16  int timeout_);
17 
18 // Read one event off the monitor socket; return value and address
19 // by reference, if not null, and event number by value. Returns -1
20 // in case of error.
21 int get_monitor_event (void *monitor_, int *value_, char **address_);
22 
23 void expect_monitor_event (void *monitor_, int expected_event_);
24 
25 void print_unexpected_event_stderr (int event_,
26  int err_,
27  int expected_event_,
28  int expected_err_);
29 
30 // expects that one or more occurrences of the expected event are received
31 // via the specified socket monitor
32 // returns the number of occurrences of the expected event
33 // interrupts, if a ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL with EPIPE, ECONNRESET
34 // or ECONNABORTED occurs; in this case, 0 is returned
35 // this should be investigated further, see
36 // https://github.com/zeromq/libzmq/issues/2644
37 int expect_monitor_event_multiple (void *server_mon_,
38  int expected_event_,
39  int expected_err_ = -1,
40  bool optional_ = false);
41 
42 int64_t get_monitor_event_v2 (void *monitor_,
43  uint64_t **value_,
44  char **local_address_,
45  char **remote_address_);
46 
47 void expect_monitor_event_v2 (void *monitor_,
48  int64_t expected_event_,
49  const char *expected_local_address_ = NULL,
50  const char *expected_remote_address_ = NULL);
51 
52 
53 const char *get_zmqEventName (uint64_t event);
54 void print_events (void *socket, int timeout, int limit);
55 
56 #endif
get_monitor_event
int get_monitor_event(void *monitor_, int *value_, char **address_)
Definition: testutil_monitoring.cpp:91
NULL
NULL
Definition: test_security_zap.cpp:405
expect_monitor_event_v2
void expect_monitor_event_v2(void *monitor_, int64_t expected_event_, const char *expected_local_address_=NULL, const char *expected_remote_address_=NULL)
Definition: testutil_monitoring.cpp:289
expect_monitor_event
void expect_monitor_event(void *monitor_, int expected_event_)
Definition: testutil_monitoring.cpp:96
event
struct _cl_event * event
Definition: glcorearb.h:4163
get_zmqEventName
const char * get_zmqEventName(uint64_t event)
Definition: testutil_monitoring.cpp:327
timeout
GLbitfield GLuint64 timeout
Definition: glcorearb.h:3588
expect_monitor_event_multiple
int expect_monitor_event_multiple(void *server_mon_, int expected_event_, int expected_err_=-1, bool optional_=false)
Definition: testutil_monitoring.cpp:127
value_
int value_
Definition: gmock-matchers_test.cc:571
print_unexpected_event_stderr
void print_unexpected_event_stderr(int event_, int err_, int expected_event_, int expected_err_)
Definition: testutil_monitoring.cpp:116
print_events
void print_events(void *socket, int timeout, int limit)
Definition: testutil_monitoring.cpp:365
get_monitor_event_v2
int64_t get_monitor_event_v2(void *monitor_, uint64_t **value_, char **local_address_, char **remote_address_)
Definition: testutil_monitoring.cpp:280
get_monitor_event_with_timeout
int get_monitor_event_with_timeout(void *monitor_, int *value_, char **address_, int timeout_)
Definition: testutil_monitoring.cpp:60


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:59