libzmq
tests
test_ancillaries.cpp
Go to the documentation of this file.
1
/* SPDX-License-Identifier: MPL-2.0 */
2
3
/*
4
* File for adding tests for ancillary API methods and other miscellaenous
5
* API internals. Please ensure that when adding such tests into this file,
6
* that they are short-lived so they do not trigger timeouts in the
7
* CI build environments.
8
*/
9
10
#include "
testutil.hpp
"
11
#include "
testutil_unity.hpp
"
12
13
void
setUp
()
14
{
15
}
16
17
void
tearDown
()
18
{
19
}
20
21
void
test_version
()
22
{
23
int
major
,
minor
, patch;
24
25
zmq_version
(&
major
, &
minor
, &patch);
26
TEST_ASSERT_EQUAL_INT
(
ZMQ_VERSION_MAJOR
,
major
);
27
TEST_ASSERT_EQUAL_INT
(
ZMQ_VERSION_MINOR
,
minor
);
28
TEST_ASSERT_EQUAL_INT
(
ZMQ_VERSION_PATCH
, patch);
29
}
30
31
void
test_strerrror
()
32
{
33
TEST_ASSERT_NOT_NULL
(
zmq_strerror
(
EINVAL
));
34
}
35
36
int
main
()
37
{
38
setup_test_environment
();
39
40
UNITY_BEGIN
();
41
RUN_TEST
(
test_version
);
42
RUN_TEST
(
test_strerrror
);
43
return
UNITY_END
();
44
}
zmq_strerror
const ZMQ_EXPORT char * zmq_strerror(int errnum_)
Definition:
zmq.cpp:96
ZMQ_VERSION_PATCH
#define ZMQ_VERSION_PATCH
Definition:
zmq.h:17
zmq_version
ZMQ_EXPORT void zmq_version(int *major_, int *minor_, int *patch_)
Definition:
zmq.cpp:88
test_version
void test_version()
Definition:
test_ancillaries.cpp:21
UNITY_END
return UNITY_END()
EINVAL
#define EINVAL
Definition:
errno.hpp:25
RUN_TEST
#define RUN_TEST(func)
Definition:
unity_internals.h:615
setUp
void setUp()
Definition:
test_ancillaries.cpp:13
main
int main()
Definition:
test_ancillaries.cpp:36
tearDown
void tearDown()
Definition:
test_ancillaries.cpp:17
testutil_unity.hpp
testutil.hpp
major
int major
Definition:
gl3w.c:93
ZMQ_VERSION_MAJOR
#define ZMQ_VERSION_MAJOR
Definition:
zmq.h:15
TEST_ASSERT_EQUAL_INT
#define TEST_ASSERT_EQUAL_INT(expected, actual)
Definition:
unity.h:128
minor
int minor
Definition:
gl3w.c:93
setup_test_environment
void setup_test_environment(int timeout_seconds_)
Definition:
testutil.cpp:201
UNITY_BEGIN
UNITY_BEGIN()
test_strerrror
void test_strerrror()
Definition:
test_ancillaries.cpp:31
TEST_ASSERT_NOT_NULL
#define TEST_ASSERT_NOT_NULL(pointer)
Definition:
unity.h:125
ZMQ_VERSION_MINOR
#define ZMQ_VERSION_MINOR
Definition:
zmq.h:16
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:59