diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-05-13 12:55:39 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-05-13 12:55:39 +0000 |
commit | 3c44e7d4f38a4de679840b249baa20f950e61c58 (patch) | |
tree | 9a50d7f430ce30f408013e0f40dd3da773f78764 /fastlib | |
parent | fc458207c3d957a79c909fe5daceaf0efcbbadad (diff) |
GC fastlib_util library and move wildcard_match.h to juniper.
Diffstat (limited to 'fastlib')
-rw-r--r-- | fastlib/CMakeLists.txt | 2 | ||||
-rw-r--r-- | fastlib/src/vespa/fastlib/util/.gitignore | 15 | ||||
-rw-r--r-- | fastlib/src/vespa/fastlib/util/CMakeLists.txt | 6 | ||||
-rw-r--r-- | fastlib/src/vespa/fastlib/util/testproject.el | 20 | ||||
-rw-r--r-- | fastlib/src/vespa/fastlib/util/tests/.gitignore | 42 | ||||
-rw-r--r-- | fastlib/src/vespa/fastlib/util/tests/CMakeLists.txt | 8 | ||||
-rw-r--r-- | fastlib/src/vespa/fastlib/util/tests/wildcard_match_test.cpp | 47 | ||||
-rw-r--r-- | fastlib/src/vespa/fastlib/util/wildcard_match.h | 54 | ||||
-rw-r--r-- | fastlib/src/vespa/packages/CMakeLists.txt | 1 |
9 files changed, 0 insertions, 195 deletions
diff --git a/fastlib/CMakeLists.txt b/fastlib/CMakeLists.txt index 035c691c04b..8d7208e956c 100644 --- a/fastlib/CMakeLists.txt +++ b/fastlib/CMakeLists.txt @@ -11,7 +11,5 @@ vespa_define_module( src/vespa/fastlib/text src/vespa/fastlib/text/apps src/vespa/fastlib/text/tests - src/vespa/fastlib/util - src/vespa/fastlib/util/tests src/vespa/packages ) diff --git a/fastlib/src/vespa/fastlib/util/.gitignore b/fastlib/src/vespa/fastlib/util/.gitignore deleted file mode 100644 index da7183fc8af..00000000000 --- a/fastlib/src/vespa/fastlib/util/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -*.So -*.a -*.ilk -*.lib -*.o -*.obj -*.pdb -.cvsignore -.depend -.pure -Debug -Makefile -SunWS_cache -extcase -extprop diff --git a/fastlib/src/vespa/fastlib/util/CMakeLists.txt b/fastlib/src/vespa/fastlib/util/CMakeLists.txt deleted file mode 100644 index 56c7baabee2..00000000000 --- a/fastlib/src/vespa/fastlib/util/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -vespa_add_library(fastlib_util - SOURCES - INSTALL lib64 - DEPENDS -) diff --git a/fastlib/src/vespa/fastlib/util/testproject.el b/fastlib/src/vespa/fastlib/util/testproject.el deleted file mode 100644 index 94bbe60394d..00000000000 --- a/fastlib/src/vespa/fastlib/util/testproject.el +++ /dev/null @@ -1,20 +0,0 @@ -;; Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -;; testproject.el - -;; Local configurations for the cpptest Emacs unit-test framework - -;; Author: Nils Sandøy <nils.sandoy@fast.no> - -(message "Setting local test configuration") - -(setq cppt-test-dir "tests") - -(setq cppt-use-underscore-p t) - -(setq cppt-extra-object-files '()) - -;; We have no parameters to our test executables -(setq cppt-test-parameters "") - -;; Use -d to turn on debug mode -(setq cppt-test-dbflags "-d") diff --git a/fastlib/src/vespa/fastlib/util/tests/.gitignore b/fastlib/src/vespa/fastlib/util/tests/.gitignore deleted file mode 100644 index c43f5961bad..00000000000 --- a/fastlib/src/vespa/fastlib/util/tests/.gitignore +++ /dev/null @@ -1,42 +0,0 @@ -*.So -*.a -*.ilk -*.o -*.obj -*.pdb -.cvsignore -.depend -.pure -Debug -Makefile -SunWS_cache -arraytest -bagtest -base64test -bitstest -bloomfilter.* -bloomfiltertest -bobhashtest -crc32test -datetimetest -debugtest -fixedarraytest -flisttest -genkeyhashmaptest -hashmaptest -hashtabletest -refcounttest -resourcestatstest -ringbuffertest -scopeguardtest -singletontest -stacktest -stringbuffertest -stringtest -stringutilitytest -trietest -utiltestsuite -wildcard_match_test -fastlib_wildcard_match_test_app -fastlib_bagtest_app -fastlib_base64test_app diff --git a/fastlib/src/vespa/fastlib/util/tests/CMakeLists.txt b/fastlib/src/vespa/fastlib/util/tests/CMakeLists.txt deleted file mode 100644 index cf655b548e5..00000000000 --- a/fastlib/src/vespa/fastlib/util/tests/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -vespa_add_executable(fastlib_wildcard_match_test_app TEST - SOURCES - wildcard_match_test.cpp - DEPENDS - fastlib_fast_testsuite -) -vespa_add_test(NAME fastlib_wildcard_match_test_app NO_VALGRIND COMMAND fastlib_wildcard_match_test_app) diff --git a/fastlib/src/vespa/fastlib/util/tests/wildcard_match_test.cpp b/fastlib/src/vespa/fastlib/util/tests/wildcard_match_test.cpp deleted file mode 100644 index a63a6943fc6..00000000000 --- a/fastlib/src/vespa/fastlib/util/tests/wildcard_match_test.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <iostream> -#include "../wildcard_match.h" - -namespace -{ -template<typename T> -bool Test(const T* word, const T* pattern, bool expect) -{ - if (fast::util::wildcard_match(word, pattern) != expect) - { - if (expect == true) - std::cout << "ERROR: " << word << " didn't match " << pattern << std::endl; - else - std::cout << "ERROR: " << word << " matched " << pattern << std::endl; - - return false; - } - - return true; -} -} - -int main(int, char **) -{ - bool success = - Test("a", "b", false) && - Test("b", "b", true) && - Test("abc", "def", false) && - Test("def", "def", true) && - Test("def", "d?f", true) && - Test("def", "d?d", false) && - Test("def", "??d", false) && - Test("def", "d??", true) && - Test("abcdef", "a*e", false) && - Test("abcdef", "a*f", true) && - Test("abcdef", "a?c*f", true) && - Test("abcdef", "a?b*f", false) && - Test("abcdef", "a*b*f", true) && - Test("abcdef", "abc*", true) && - Test("abcdef", "*def", true); - - if (success == true) - std::cout << "wildcard_match_test: SUCCESS" << std::endl; - - return 0; -} diff --git a/fastlib/src/vespa/fastlib/util/wildcard_match.h b/fastlib/src/vespa/fastlib/util/wildcard_match.h deleted file mode 100644 index 2cde4364693..00000000000 --- a/fastlib/src/vespa/fastlib/util/wildcard_match.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#pragma once - -namespace fast -{ -namespace util -{ -template<typename T> -bool wildcard_match(const T* word, const T* pattern, T multiple = '*', - T single = '?') -{ - while (*word != 0) - if (*pattern == 0) - return false; - else if (*pattern == multiple) - { - // advance past occurrences of multiple - while (*pattern == multiple) - ++pattern; - - // if pattern ended with multiple, we're done - if (*pattern == 0) - return true; - - while (*word != 0) - { - // does this position in the word match - if (*pattern == single || *pattern == *word) - { - // test the rest of the word - if (wildcard_match(word, pattern, multiple, single) == true) - { - // it matched - return true; - } - } - - // try next character - ++word; - } - } - else if (*pattern != single && *pattern != *word) - return false; - else - { - ++word; - ++pattern; - } - - // should be at end of pattern too if the word matched - return *pattern == 0; -} -} -} diff --git a/fastlib/src/vespa/packages/CMakeLists.txt b/fastlib/src/vespa/packages/CMakeLists.txt index f6a00c9ec06..ca4437854d3 100644 --- a/fastlib/src/vespa/packages/CMakeLists.txt +++ b/fastlib/src/vespa/packages/CMakeLists.txt @@ -5,6 +5,5 @@ vespa_add_library(fastlib_fast DEPENDS fastlib_text fastlib_io - fastlib_util fastlib_fast_testsuite ) |