diff options
Diffstat (limited to 'filedistribution/src/tests/common')
-rw-r--r-- | filedistribution/src/tests/common/.gitignore | 1 | ||||
-rw-r--r-- | filedistribution/src/tests/common/CMakeLists.txt | 13 | ||||
-rw-r--r-- | filedistribution/src/tests/common/testCommon.cpp | 41 |
3 files changed, 0 insertions, 55 deletions
diff --git a/filedistribution/src/tests/common/.gitignore b/filedistribution/src/tests/common/.gitignore deleted file mode 100644 index 060721ea295..00000000000 --- a/filedistribution/src/tests/common/.gitignore +++ /dev/null @@ -1 +0,0 @@ -filedistribution_common_test_app diff --git a/filedistribution/src/tests/common/CMakeLists.txt b/filedistribution/src/tests/common/CMakeLists.txt deleted file mode 100644 index 9f142eec9e7..00000000000 --- a/filedistribution/src/tests/common/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -vespa_add_executable(filedistribution_common_test_app TEST - SOURCES - testCommon.cpp - DEPENDS -) -target_compile_options(filedistribution_common_test_app PRIVATE -DTORRENT_DISABLE_ENCRYPTION -DTORRENT_DISABLE_DHT -DWITH_SHIPPED_GEOIP_H -DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -DBOOST_EXCEPTION_DISABLE -DBOOST_ASIO_ENABLE_CANCELIO -DBOOST_ASIO_DYN_LINK -DTORRENT_LINKING_SHARED) -vespa_add_target_system_dependency(filedistribution_common_test_app boost boost_system${VESPA_BOOST_LIB_SUFFIX}) -vespa_add_target_system_dependency(filedistribution_common_test_app boost boost_thread${VESPA_BOOST_LIB_SUFFIX}) -vespa_add_target_system_dependency(filedistribution_common_test_app boost boost_program_options${VESPA_BOOST_LIB_SUFFIX}) -vespa_add_target_system_dependency(filedistribution_common_test_app boost boost_filesystem${VESPA_BOOST_LIB_SUFFIX}) -vespa_add_target_system_dependency(filedistribution_common_test_app boost boost_unit_test_framework${VESPA_BOOST_LIB_SUFFIX}) -vespa_add_test(NAME filedistribution_common_test_app NO_VALGRIND COMMAND filedistribution_common_test_app) diff --git a/filedistribution/src/tests/common/testCommon.cpp b/filedistribution/src/tests/common/testCommon.cpp deleted file mode 100644 index 8ad17b6b7ce..00000000000 --- a/filedistribution/src/tests/common/testCommon.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#define BOOST_TEST_DYN_LINK -#define BOOST_TEST_MAIN - -#include <vespa/filedistribution/common/buffer.h> - -#include <boost/test/unit_test.hpp> -#include <string> - -namespace fd = filedistribution; - -const size_t bufferCapacity = 10; - -fd::Buffer -getBuffer() { - const char* test = "test"; - fd::Buffer buffer(test, test + strlen(test)); - buffer.reserve(bufferCapacity); - buffer.push_back(0); - return buffer; -} - -BOOST_AUTO_TEST_CASE(bufferTest) { - fd::Buffer buffer(getBuffer()); - BOOST_CHECK(buffer.begin() != 0); - BOOST_CHECK_EQUAL(bufferCapacity, buffer.capacity()); - BOOST_CHECK_EQUAL(5u, buffer.size()); - BOOST_CHECK_EQUAL(std::string("test"), buffer.begin()); -} - -struct Callback { - bool* _called; - Callback(bool *called) - :_called(called) - {} - - void operator()(const std::string& str) { - BOOST_CHECK_EQUAL("abcd", str); - *_called = true; - } -}; |