Commit 3d2db5d8 authored by Simon Giesecke's avatar Simon Giesecke

Problem: test_capabilities not yet using unity

Solution: migrate to unity
parent dc29361e
......@@ -647,7 +647,8 @@ tests_test_metadata_SOURCES = tests/test_metadata.cpp
tests_test_metadata_LDADD = src/libzmq.la
tests_test_capabilities_SOURCES = tests/test_capabilities.cpp
tests_test_capabilities_LDADD = src/libzmq.la
tests_test_capabilities_LDADD = src/libzmq.la ${UNITY_LIBS}
tests_test_capabilities_CPPFLAGS = ${UNITY_CPPFLAGS}
tests_test_xpub_nodrop_SOURCES = tests/test_xpub_nodrop.cpp
tests_test_xpub_nodrop_LDADD = src/libzmq.la ${UNITY_LIBS}
......
......@@ -28,55 +28,72 @@
*/
#include "testutil.hpp"
#include "testutil_unity.hpp"
int main (void)
void setUp ()
{
}
void tearDown ()
{
}
void test_capabilities ()
{
#if !defined(ZMQ_HAVE_WINDOWS) && !defined(ZMQ_HAVE_OPENVMS)
assert (zmq_has ("ipc"));
TEST_ASSERT_TRUE (zmq_has ("ipc"));
#else
assert (!zmq_has ("ipc"));
TEST_ASSERT_TRUE (!zmq_has ("ipc"));
#endif
#if defined(ZMQ_HAVE_OPENPGM)
assert (zmq_has ("pgm"));
TEST_ASSERT_TRUE (zmq_has ("pgm"));
#else
assert (!zmq_has ("pgm"));
TEST_ASSERT_TRUE (!zmq_has ("pgm"));
#endif
#if defined(ZMQ_HAVE_TIPC)
assert (zmq_has ("tipc"));
TEST_ASSERT_TRUE (zmq_has ("tipc"));
#else
assert (!zmq_has ("tipc"));
TEST_ASSERT_TRUE (!zmq_has ("tipc"));
#endif
#if defined(ZMQ_HAVE_NORM)
assert (zmq_has ("norm"));
TEST_ASSERT_TRUE (zmq_has ("norm"));
#else
assert (!zmq_has ("norm"));
TEST_ASSERT_TRUE (!zmq_has ("norm"));
#endif
#if defined(ZMQ_HAVE_CURVE)
assert (zmq_has ("curve"));
TEST_ASSERT_TRUE (zmq_has ("curve"));
#else
assert (!zmq_has ("curve"));
TEST_ASSERT_TRUE (!zmq_has ("curve"));
#endif
#if defined(HAVE_LIBGSSAPI_KRB5)
assert (zmq_has ("gssapi"));
TEST_ASSERT_TRUE (zmq_has ("gssapi"));
#else
assert (!zmq_has ("gssapi"));
TEST_ASSERT_TRUE (!zmq_has ("gssapi"));
#endif
#if defined(ZMQ_HAVE_VMCI)
assert (zmq_has ("vmci"));
TEST_ASSERT_TRUE (zmq_has ("vmci"));
#else
assert (!zmq_has ("vmci"));
TEST_ASSERT_TRUE (!zmq_has ("vmci"));
#endif
#if defined(ZMQ_BUILD_DRAFT_API)
assert (zmq_has ("draft"));
TEST_ASSERT_TRUE (zmq_has ("draft"));
#else
assert (!zmq_has ("draft"));
TEST_ASSERT_TRUE (!zmq_has ("draft"));
#endif
return 0;
}
int main ()
{
setup_test_environment ();
UNITY_BEGIN ();
RUN_TEST (test_capabilities);
return UNITY_END ();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment