diff --git a/openvpn/tun/builder/capture.hpp b/openvpn/tun/builder/capture.hpp index 0b7a0d74..f88d4b97 100644 --- a/openvpn/tun/builder/capture.hpp +++ b/openvpn/tun/builder/capture.hpp @@ -150,7 +150,7 @@ class TunBuilderCapture : public TunBuilderBase, public RC(prefix_length); if (!gateway.empty()) os << " -> " << gateway; if (metric >= 0) diff --git a/test/unittests/CMakeLists.txt b/test/unittests/CMakeLists.txt index 70cb8182..2ea39541 100644 --- a/test/unittests/CMakeLists.txt +++ b/test/unittests/CMakeLists.txt @@ -67,6 +67,7 @@ add_executable(coreUnitTests test_streq.cpp test_time.cpp test_typeindex.cpp + test_tun_builder.cpp test_userpass.cpp test_validatecreds.cpp test_weak.cpp diff --git a/test/unittests/test_tun_builder.cpp b/test/unittests/test_tun_builder.cpp new file mode 100644 index 00000000..4ec6d7a6 --- /dev/null +++ b/test/unittests/test_tun_builder.cpp @@ -0,0 +1,14 @@ + +#include "test_common.h" + +#include + +TEST(tun_builder, to_string_zero) +{ + auto rb = openvpn::TunBuilderCapture::RouteBase(); + + rb.address = "0.0.0.0"; + rb.prefix_length = 0; + + EXPECT_EQ(rb.to_string(), "0.0.0.0/0"); +} \ No newline at end of file