diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-06-07 15:55:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-07 15:55:03 +0200 |
commit | 5c32be88a2a854ad561469feb611e51205c376c7 (patch) | |
tree | 5a79d3bfed05bd2e1347e6056e300b2c028fea9a /searchlib/src | |
parent | 7b29da0d2943f2aa9e1c6601a538cd4ba0d100be (diff) | |
parent | 7d665ae3380d013f4b5b8401d8cf239a4e47f51e (diff) |
Merge branch 'master' into balder/decouple-datatype-and-fiedlvalue-some-more
Diffstat (limited to 'searchlib/src')
23 files changed, 82 insertions, 264 deletions
diff --git a/searchlib/src/apps/expgolomb/.gitignore b/searchlib/src/apps/expgolomb/.gitignore deleted file mode 100644 index 0886ab154a2..00000000000 --- a/searchlib/src/apps/expgolomb/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -.depend -Makefile -expgolomb diff --git a/searchlib/src/apps/expgolomb/expgolomb.cpp b/searchlib/src/apps/expgolomb/expgolomb.cpp deleted file mode 100644 index 81aa566305c..00000000000 --- a/searchlib/src/apps/expgolomb/expgolomb.cpp +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#include <vespa/fastos/app.h> -#include <vespa/searchlib/bitcompression/compression.h> -#include <vector> - -class ExpGolombApp : public FastOS_Application -{ - void usage(); - int testExpGolomb64(int kValue); - int testExpGolomb64le(int kValue); - int Main() override; -}; - - - -void -ExpGolombApp::usage() -{ - printf("Usage: expgolomb testeg64 <kValue>]\n"); - fflush(stdout); -} - - -int -ExpGolombApp::testExpGolomb64(int kValue) -{ - std::vector<uint64_t> myrand; - for (int i = 0; i < 10000; ++i) { - uint64_t rval = rand(); - rval <<= 30; - rval |= rand(); - myrand.push_back(rval); - } - for (int i = 0; i < 10000; ++i) { - uint64_t rval = rand(); - rval <<= 30; - rval |= rand(); - uint32_t bits = (rand() & 63); - rval &= ((UINT64_C(1) << bits) - 1); - myrand.push_back(rval); - } - typedef search::bitcompression::EncodeContext64BE EC; - - EC e; - search::ComprFileWriteContext wc(e); - wc.allocComprBuf(32768, 32768); - e.setupWrite(wc); - - int rsize = myrand.size(); - for (int i = 0; i < rsize; ++i) { - e.encodeExpGolomb(myrand[i], kValue); - if (e._valI >= e._valE) - wc.writeComprBuffer(false); - } - e.flush(); - - UC64_DECODECONTEXT(o); - unsigned int length; - uint64_t val64; - UC64BE_SETUPBITS_NS(o, static_cast<const uint64_t *>(wc._comprBuf), 0, EC); - - bool failure = false; - for (int i = 0; i < rsize; ++i) { - UC64BE_DECODEEXPGOLOMB(oVal, oCompr, oPreRead, oCacheInt, - kValue, EC); - if (val64 != myrand[i]) { - printf("FAILURE: TestExpGolomb64, val64=%" - PRIu64 ", myrand[%d]=%" PRIu64 "\n", - val64, i, myrand[i]); - failure = true; - } - } - if (!failure) - printf("SUCCESS: TestExpGolomb64\n"); - return failure ? 1 : 0; -} - -int -ExpGolombApp::testExpGolomb64le(int kValue) -{ - std::vector<uint64_t> myrand; - for (int i = 0; i < 10000; ++i) { - uint64_t rval = rand(); - rval <<= 30; - rval |= rand(); - myrand.push_back(rval); - } - for (int i = 0; i < 10000; ++i) { - uint64_t rval = rand(); - rval <<= 30; - rval |= rand(); - uint32_t bits = (rand() & 63); - rval &= ((UINT64_C(1) << bits) - 1); - myrand.push_back(rval); - } - typedef search::bitcompression::EncodeContext64LE EC; - - EC e; - search::ComprFileWriteContext wc(e); - wc.allocComprBuf(32768, 32768); - e.setupWrite(wc); - - int rsize = myrand.size(); - for (int i = 0; i < rsize; ++i) { - e.encodeExpGolomb(myrand[i], kValue); - if (e._valI >= e._valE) - wc.writeComprBuffer(false); - } - e.flush(); - - UC64_DECODECONTEXT(o); - unsigned int length; - uint64_t val64; - UC64LE_SETUPBITS_NS(o, static_cast<const uint64_t *>(wc._comprBuf), 0, EC); - - bool failure = false; - for (int i = 0; i < rsize; ++i) { - UC64LE_DECODEEXPGOLOMB(oVal, oCompr, oPreRead, oCacheInt, - kValue, EC); - if (val64 != myrand[i]) { - printf("FAILURE: TestExpGolomb64le, val64=%" - PRIu64 ", myrand[%d]=%" PRIu64 "\n", - val64, i, myrand[i]); - failure = true; - } - } - if (!failure) - printf("SUCCESS: TestExpGolomb64le\n"); - return failure ? 1 : 0; -} - - -int -ExpGolombApp::Main() -{ - printf("Hello world\n"); - if (_argc >= 2) { - if (strcmp(_argv[1], "testeg64") == 0) { - if (_argc < 3) { - fprintf(stderr, "Too few arguments\n"); - usage(); - return 1; - } - return testExpGolomb64(atoi(_argv[2])); - } else if (strcmp(_argv[1], "testeg64le") == 0) { - if (_argc < 3) { - fprintf(stderr, "Too few arguments\n"); - usage(); - return 1; - } - return testExpGolomb64le(atoi(_argv[2])); - } else { - fprintf(stderr, "Wrong arguments\n"); - usage(); - return 1; - } - } else { - fprintf(stderr, "Too few arguments\n"); - usage(); - return 1; - } - return 0; -} - -FASTOS_MAIN(ExpGolombApp); - - diff --git a/searchlib/src/apps/fileheaderinspect/.gitignore b/searchlib/src/apps/fileheaderinspect/.gitignore deleted file mode 100644 index 5616f8e735c..00000000000 --- a/searchlib/src/apps/fileheaderinspect/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -.depend -Makefile -vespa-header-inspect diff --git a/searchlib/src/apps/loadattribute/.gitignore b/searchlib/src/apps/loadattribute/.gitignore deleted file mode 100644 index 4f008fbf84e..00000000000 --- a/searchlib/src/apps/loadattribute/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -.depend -Makefile -loadattribute diff --git a/searchlib/src/apps/loadattribute/CMakeLists.txt b/searchlib/src/apps/loadattribute/CMakeLists.txt deleted file mode 100644 index 6712519e59a..00000000000 --- a/searchlib/src/apps/loadattribute/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -vespa_add_executable(searchlib_loadattribute_app - SOURCES - loadattribute.cpp - OUTPUT_NAME loadattribute - INSTALL bin - DEPENDS - searchlib -) diff --git a/searchlib/src/apps/uniform/.gitignore b/searchlib/src/apps/uniform/.gitignore index ff18dbaa7fd..d1fbbf62d24 100644 --- a/searchlib/src/apps/uniform/.gitignore +++ b/searchlib/src/apps/uniform/.gitignore @@ -1,3 +1,3 @@ .depend Makefile -uniform +searchlib_uniform_app diff --git a/searchlib/src/apps/uniform/CMakeLists.txt b/searchlib/src/apps/uniform/CMakeLists.txt index 9f9c2139f42..7b835a64e8c 100644 --- a/searchlib/src/apps/uniform/CMakeLists.txt +++ b/searchlib/src/apps/uniform/CMakeLists.txt @@ -2,8 +2,6 @@ vespa_add_executable(searchlib_uniform_app SOURCES uniform.cpp - OUTPUT_NAME uniform - INSTALL bin DEPENDS searchlib ) diff --git a/searchlib/src/apps/vespa-attribute-inspect/.gitignore b/searchlib/src/apps/vespa-attribute-inspect/.gitignore new file mode 100644 index 00000000000..62bcd8ab443 --- /dev/null +++ b/searchlib/src/apps/vespa-attribute-inspect/.gitignore @@ -0,0 +1,3 @@ +.depend +Makefile +vespa-attribute-inspect diff --git a/searchlib/src/apps/fileheaderinspect/CMakeLists.txt b/searchlib/src/apps/vespa-attribute-inspect/CMakeLists.txt index 322bf6fefcb..4d170b9f325 100644 --- a/searchlib/src/apps/fileheaderinspect/CMakeLists.txt +++ b/searchlib/src/apps/vespa-attribute-inspect/CMakeLists.txt @@ -1,8 +1,8 @@ # Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -vespa_add_executable(searchlib_vespa-header-inspect_app +vespa_add_executable(searchlib_vespa-attribute-inspect_app SOURCES - fileheaderinspect.cpp - OUTPUT_NAME vespa-header-inspect + vespa-attribute-inspect.cpp + OUTPUT_NAME vespa-attribute-inspect INSTALL bin DEPENDS searchlib diff --git a/searchlib/src/apps/loadattribute/loadattribute.rb b/searchlib/src/apps/vespa-attribute-inspect/loadattribute.rb index d1fb5a5632c..d1fb5a5632c 100644 --- a/searchlib/src/apps/loadattribute/loadattribute.rb +++ b/searchlib/src/apps/vespa-attribute-inspect/loadattribute.rb diff --git a/searchlib/src/apps/loadattribute/loadattribute.cpp b/searchlib/src/apps/vespa-attribute-inspect/vespa-attribute-inspect.cpp index e82ab3ac645..189074aa5d3 100644 --- a/searchlib/src/apps/loadattribute/loadattribute.cpp +++ b/searchlib/src/apps/vespa-attribute-inspect/vespa-attribute-inspect.cpp @@ -98,7 +98,7 @@ LoadAttribute::printContent(const AttributePtr & ptr, std::ostream & os) void LoadAttribute::usage() { - std::cout << "usage: loadattribute [-p (print content to <attribute>.out)]" << std::endl; + std::cout << "usage: vespa-attribute-inspect [-p (print content to <attribute>.out)]" << std::endl; std::cout << " [-a (apply a single update)]" << std::endl; std::cout << " [-s (save attribute to <attribute>.save.dat)]" << std::endl; std::cout << " <attribute>" << std::endl; diff --git a/searchlib/src/apps/vespa-fileheader-inspect/.gitignore b/searchlib/src/apps/vespa-fileheader-inspect/.gitignore new file mode 100644 index 00000000000..5b53dd5e3ac --- /dev/null +++ b/searchlib/src/apps/vespa-fileheader-inspect/.gitignore @@ -0,0 +1,3 @@ +.depend +Makefile +vespa-fileheader-inspect diff --git a/searchlib/src/apps/expgolomb/CMakeLists.txt b/searchlib/src/apps/vespa-fileheader-inspect/CMakeLists.txt index 230718907dd..cbbe8c05c2b 100644 --- a/searchlib/src/apps/expgolomb/CMakeLists.txt +++ b/searchlib/src/apps/vespa-fileheader-inspect/CMakeLists.txt @@ -1,8 +1,8 @@ # Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -vespa_add_executable(searchlib_expgolomb_app +vespa_add_executable(searchlib_vespa-fileheader-inspect_app SOURCES - expgolomb.cpp - OUTPUT_NAME expgolomb + vespa-fileheader-inspect.cpp + OUTPUT_NAME vespa-fileheader-inspect INSTALL bin DEPENDS searchlib diff --git a/searchlib/src/apps/fileheaderinspect/fileheaderinspect.cpp b/searchlib/src/apps/vespa-fileheader-inspect/vespa-fileheader-inspect.cpp index 2407be0b4c2..02cbb230960 100644 --- a/searchlib/src/apps/fileheaderinspect/fileheaderinspect.cpp +++ b/searchlib/src/apps/vespa-fileheader-inspect/vespa-fileheader-inspect.cpp @@ -7,7 +7,7 @@ #include <vespa/vespalib/data/fileheader.h> #include <vespa/vespalib/stllike/asciistream.h> #include <vespa/log/log.h> -LOG_SETUP("fileheaderinspect"); +LOG_SETUP("vespa-fileheader-inspect"); using namespace vespalib; diff --git a/searchlib/src/tests/fileheaderinspect/CMakeLists.txt b/searchlib/src/tests/fileheaderinspect/CMakeLists.txt deleted file mode 100644 index 4bc15f90ea7..00000000000 --- a/searchlib/src/tests/fileheaderinspect/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -vespa_add_executable(searchlib_fileheaderinspect_test_app TEST - SOURCES - fileheaderinspect.cpp - DEPENDS - searchlib - AFTER - searchlib_vespa-header-inspect_app -) -vespa_add_test(NAME searchlib_fileheaderinspect_test_app COMMAND searchlib_fileheaderinspect_test_app) diff --git a/searchlib/src/tests/index/docbuilder/docbuilder_test.cpp b/searchlib/src/tests/index/docbuilder/docbuilder_test.cpp index a4402736f2d..f5eb6d385d9 100644 --- a/searchlib/src/tests/index/docbuilder/docbuilder_test.cpp +++ b/searchlib/src/tests/index/docbuilder/docbuilder_test.cpp @@ -124,13 +124,13 @@ Test::testBuilder() endField(); b.startIndexField("iu"). startSubField("all"). - addUrlTokenizedString("http://www.yahoo.com:81/fluke?ab=2#4"). + addUrlTokenizedString("http://www.example.com:81/fluke?ab=2#4"). endSubField(). startSubField("scheme"). addUrlTokenizedString("http"). endSubField(). startSubField("host"). - addUrlTokenizedString("www.yahoo.com"). + addUrlTokenizedString("www.example.com"). endSubField(). startSubField("port"). addUrlTokenizedString("81"). @@ -148,13 +148,13 @@ Test::testBuilder() b.startIndexField("iau"). startElement(1). startSubField("all"). - addUrlTokenizedString("http://www.yahoo.com:82/fluke?ab=2#8"). + addUrlTokenizedString("http://www.example.com:82/fluke?ab=2#8"). endSubField(). startSubField("scheme"). addUrlTokenizedString("http"). endSubField(). startSubField("host"). - addUrlTokenizedString("www.yahoo.com"). + addUrlTokenizedString("www.example.com"). endSubField(). startSubField("port"). addUrlTokenizedString("82"). @@ -196,13 +196,13 @@ Test::testBuilder() b.startIndexField("iwu"). startElement(4). startSubField("all"). - addUrlTokenizedString("http://www.yahoo.com:83/fluke?ab=2#12"). + addUrlTokenizedString("http://www.example.com:83/fluke?ab=2#12"). endSubField(). startSubField("scheme"). addUrlTokenizedString("http"). endSubField(). startSubField("host"). - addUrlTokenizedString("www.yahoo.com"). + addUrlTokenizedString("www.example.com"). endSubField(). startSubField("port"). addUrlTokenizedString("83"). @@ -309,8 +309,8 @@ Test::testBuilder() EXPECT_EQUAL("<item weight=\"1\">foo</item>", *itr++); EXPECT_EQUAL("</ic>", *itr++); EXPECT_EQUAL("<iu>", *itr++); - EXPECT_EQUAL("<all>http://www.yahoo.com:81/fluke?ab=2#4</all>", *itr++); - EXPECT_EQUAL("<host>www.yahoo.com</host>", *itr++); + EXPECT_EQUAL("<all>http://www.example.com:81/fluke?ab=2#4</all>", *itr++); + EXPECT_EQUAL("<host>www.example.com</host>", *itr++); EXPECT_EQUAL("<scheme>http</scheme>", *itr++); EXPECT_EQUAL("<path>/fluke</path>", *itr++); EXPECT_EQUAL("<port>81</port>", *itr++); @@ -319,8 +319,8 @@ Test::testBuilder() EXPECT_EQUAL("</iu>", *itr++); EXPECT_EQUAL("<iau>", *itr++); EXPECT_EQUAL("<item>", *itr++); - EXPECT_EQUAL("<all>http://www.yahoo.com:82/fluke?ab=2#8</all>", *itr++); - EXPECT_EQUAL("<host>www.yahoo.com</host>", *itr++); + EXPECT_EQUAL("<all>http://www.example.com:82/fluke?ab=2#8</all>", *itr++); + EXPECT_EQUAL("<host>www.example.com</host>", *itr++); EXPECT_EQUAL("<scheme>http</scheme>", *itr++); EXPECT_EQUAL("<path>/fluke</path>", *itr++); EXPECT_EQUAL("<port>82</port>", *itr++); @@ -339,8 +339,8 @@ Test::testBuilder() EXPECT_EQUAL("</iau>", *itr++); EXPECT_EQUAL("<iwu>", *itr++); EXPECT_EQUAL("<item weight=\"4\">", *itr++); - EXPECT_EQUAL("<all>http://www.yahoo.com:83/fluke?ab=2#12</all>", *itr++); - EXPECT_EQUAL("<host>www.yahoo.com</host>", *itr++); + EXPECT_EQUAL("<all>http://www.example.com:83/fluke?ab=2#12</all>", *itr++); + EXPECT_EQUAL("<host>www.example.com</host>", *itr++); EXPECT_EQUAL("<scheme>http</scheme>", *itr++); EXPECT_EQUAL("<path>/fluke</path>", *itr++); EXPECT_EQUAL("<port>83</port>", *itr++); diff --git a/searchlib/src/tests/memoryindex/dictionary/dictionary_test.cpp b/searchlib/src/tests/memoryindex/dictionary/dictionary_test.cpp index 8ebab883613..3dbf4efc368 100644 --- a/searchlib/src/tests/memoryindex/dictionary/dictionary_test.cpp +++ b/searchlib/src/tests/memoryindex/dictionary/dictionary_test.cpp @@ -1178,13 +1178,13 @@ TEST_F("requireThatUriIndexingIsWorking", DictionaryFixture<UriFixture>) f._b.startDocument("doc::10"); f._b.startIndexField("iu"). startSubField("all"). - addUrlTokenizedString("http://www.yahoo.com:81/fluke?ab=2#4"). + addUrlTokenizedString("http://www.example.com:81/fluke?ab=2#4"). endSubField(). startSubField("scheme"). addUrlTokenizedString("http"). endSubField(). startSubField("host"). - addUrlTokenizedString("www.yahoo.com"). + addUrlTokenizedString("www.example.com"). endSubField(). startSubField("port"). addUrlTokenizedString("81"). @@ -1202,13 +1202,13 @@ TEST_F("requireThatUriIndexingIsWorking", DictionaryFixture<UriFixture>) f._b.startIndexField("iau"). startElement(1). startSubField("all"). - addUrlTokenizedString("http://www.yahoo.com:82/fluke?ab=2#8"). + addUrlTokenizedString("http://www.example.com:82/fluke?ab=2#8"). endSubField(). startSubField("scheme"). addUrlTokenizedString("http"). endSubField(). startSubField("host"). - addUrlTokenizedString("www.yahoo.com"). + addUrlTokenizedString("www.example.com"). endSubField(). startSubField("port"). addUrlTokenizedString("82"). @@ -1250,13 +1250,13 @@ TEST_F("requireThatUriIndexingIsWorking", DictionaryFixture<UriFixture>) f._b.startIndexField("iwu"). startElement(4). startSubField("all"). - addUrlTokenizedString("http://www.yahoo.com:83/fluke?ab=2#12"). + addUrlTokenizedString("http://www.example.com:83/fluke?ab=2#12"). endSubField(). startSubField("scheme"). addUrlTokenizedString("http"). endSubField(). startSubField("host"). - addUrlTokenizedString("www.yahoo.com"). + addUrlTokenizedString("www.example.com"). endSubField(). startSubField("port"). addUrlTokenizedString("83"). @@ -1315,7 +1315,7 @@ TEST_F("requireThatUriIndexingIsWorking", DictionaryFixture<UriFixture>) } { uint32_t fieldId = f.getSchema().getIndexFieldId("iu"); - PostingIterator itr(f._d.findFrozen("yahoo", fieldId), + PostingIterator itr(f._d.findFrozen("example", fieldId), featureStoreRef(f._d, fieldId), fieldId, matchData); itr.initFullRange(); @@ -1327,7 +1327,7 @@ TEST_F("requireThatUriIndexingIsWorking", DictionaryFixture<UriFixture>) } { uint32_t fieldId = f.getSchema().getIndexFieldId("iau"); - PostingIterator itr(f._d.findFrozen("yahoo", fieldId), + PostingIterator itr(f._d.findFrozen("example", fieldId), featureStoreRef(f._d, fieldId), fieldId, matchData); itr.initFullRange(); @@ -1340,7 +1340,7 @@ TEST_F("requireThatUriIndexingIsWorking", DictionaryFixture<UriFixture>) } { uint32_t fieldId = f.getSchema().getIndexFieldId("iwu"); - PostingIterator itr(f._d.findFrozen("yahoo", fieldId), + PostingIterator itr(f._d.findFrozen("example", fieldId), featureStoreRef(f._d, fieldId), fieldId, matchData); itr.initFullRange(); diff --git a/searchlib/src/tests/memoryindex/urlfieldinverter/urlfieldinverter_test.cpp b/searchlib/src/tests/memoryindex/urlfieldinverter/urlfieldinverter_test.cpp index 233c95b58c8..5011310f412 100644 --- a/searchlib/src/tests/memoryindex/urlfieldinverter/urlfieldinverter_test.cpp +++ b/searchlib/src/tests/memoryindex/urlfieldinverter/urlfieldinverter_test.cpp @@ -30,13 +30,13 @@ makeDoc10Single(DocBuilder &b) b.startDocument("doc::10"); b.startIndexField("url"). startSubField("all"). - addUrlTokenizedString("http://www.yahoo.com:81/fluke?ab=2#4"). + addUrlTokenizedString("http://www.example.com:81/fluke?ab=2#4"). endSubField(). startSubField("scheme"). addUrlTokenizedString("http"). endSubField(). startSubField("host"). - addUrlTokenizedString("www.yahoo.com"). + addUrlTokenizedString("www.example.com"). endSubField(). startSubField("port"). addUrlTokenizedString("81"). @@ -63,13 +63,13 @@ makeDoc10Array(DocBuilder &b) b.startIndexField("url"). startElement(1). startSubField("all"). - addUrlTokenizedString("http://www.yahoo.com:82/fluke?ab=2#8"). + addUrlTokenizedString("http://www.example.com:82/fluke?ab=2#8"). endSubField(). startSubField("scheme"). addUrlTokenizedString("http"). endSubField(). startSubField("host"). - addUrlTokenizedString("www.yahoo.com"). + addUrlTokenizedString("www.example.com"). endSubField(). startSubField("port"). addUrlTokenizedString("82"). @@ -119,13 +119,13 @@ makeDoc10WeightedSet(DocBuilder &b) b.startIndexField("url"). startElement(4). startSubField("all"). - addUrlTokenizedString("http://www.yahoo.com:83/fluke?ab=2#12"). + addUrlTokenizedString("http://www.example.com:83/fluke?ab=2#12"). endSubField(). startSubField("scheme"). addUrlTokenizedString("http"). endSubField(). startSubField("host"). - addUrlTokenizedString("www.yahoo.com"). + addUrlTokenizedString("www.example.com"). endSubField(). startSubField("port"). addUrlTokenizedString("83"). @@ -258,16 +258,16 @@ TEST_F("requireThatSingleUrlFieldWorks", Fixture(CollectionType::SINGLE)) "w=81,a=10," "w=ab,a=10," "w=com,a=10," + "w=example,a=10," "w=fluke,a=10," "w=http,a=10," "w=www,a=10," - "w=yahoo,a=10," "f=1," "w=http,a=10," "f=2," "w=com,a=10," + "w=example,a=10," "w=www,a=10," - "w=yahoo,a=10," "f=3," "w=81,a=10," "f=4," @@ -281,8 +281,8 @@ TEST_F("requireThatSingleUrlFieldWorks", Fixture(CollectionType::SINGLE)) "w=EnDhOsT,a=10," "w=StArThOsT,a=10," "w=com,a=10," - "w=www,a=10," - "w=yahoo,a=10", + "w=example,a=10," + "w=www,a=10", f._inserter.toStr()); } @@ -298,18 +298,18 @@ TEST_F("requireThatArrayUrlFieldWorks", Fixture(CollectionType::ARRAY)) "w=9,a=10," "w=ab,a=10," "w=com,a=10," + "w=example,a=10," "w=flickr,a=10," "w=fluke,a=10," "w=http,a=10," "w=www,a=10," - "w=yahoo,a=10," "f=1," "w=http,a=10," "f=2," "w=com,a=10," + "w=example,a=10," "w=flickr,a=10," "w=www,a=10," - "w=yahoo,a=10," "f=3," "w=82,a=10," "f=4," @@ -324,9 +324,9 @@ TEST_F("requireThatArrayUrlFieldWorks", Fixture(CollectionType::ARRAY)) "w=EnDhOsT,a=10," "w=StArThOsT,a=10," "w=com,a=10," + "w=example,a=10," "w=flickr,a=10," - "w=www,a=10," - "w=yahoo,a=10", + "w=www,a=10", f._inserter.toStr()); } @@ -342,18 +342,18 @@ TEST_F("requireThatWeightedSetFieldWorks", Fixture(CollectionType::WEIGHTEDSET)) "w=85,a=10," "w=ab,a=10," "w=com,a=10," + "w=example,a=10," "w=flickr,a=10," "w=fluke,a=10," "w=http,a=10," "w=www,a=10," - "w=yahoo,a=10," "f=1," "w=http,a=10," "f=2," "w=com,a=10," + "w=example,a=10," "w=flickr,a=10," "w=www,a=10," - "w=yahoo,a=10," "f=3," "w=83,a=10," "w=85,a=10," @@ -369,9 +369,9 @@ TEST_F("requireThatWeightedSetFieldWorks", Fixture(CollectionType::WEIGHTEDSET)) "w=EnDhOsT,a=10," "w=StArThOsT,a=10," "w=com,a=10," + "w=example,a=10," "w=flickr,a=10," - "w=www,a=10," - "w=yahoo,a=10", + "w=www,a=10", f._inserter.toStr()); } @@ -386,16 +386,16 @@ TEST_F("requireThatAnnotatedSingleUrlFieldWorks", Fixture(CollectionType::SINGLE "w=81,a=10," "w=ab,a=10," "w=com,a=10," + "w=example,a=10," "w=fluke,a=10," "w=http,a=10," "w=www,a=10," - "w=yahoo,a=10," "f=1," "w=http,a=10," "f=2," "w=com,a=10," + "w=example,a=10," "w=www,a=10," - "w=yahoo,a=10," "f=3," "w=81,a=10," "f=4," @@ -410,8 +410,8 @@ TEST_F("requireThatAnnotatedSingleUrlFieldWorks", Fixture(CollectionType::SINGLE "w=EnDhOsT,a=10," "w=StArThOsT,a=10," "w=com,a=10," - "w=www,a=10," - "w=yahoo,a=10", + "w=example,a=10," + "w=www,a=10", f._inserter.toStr()); } @@ -428,18 +428,18 @@ TEST_F("requireThatAnnotatedArrayUrlFieldWorks", Fixture(CollectionType::ARRAY)) "w=9,a=10," "w=ab,a=10," "w=com,a=10," + "w=example,a=10," "w=flickr,a=10," "w=fluke,a=10," "w=http,a=10," "w=www,a=10," - "w=yahoo,a=10," "f=1," "w=http,a=10," "f=2," "w=com,a=10," + "w=example,a=10," "w=flickr,a=10," "w=www,a=10," - "w=yahoo,a=10," "f=3," "w=82,a=10," "f=4," @@ -455,9 +455,9 @@ TEST_F("requireThatAnnotatedArrayUrlFieldWorks", Fixture(CollectionType::ARRAY)) "w=EnDhOsT,a=10," "w=StArThOsT,a=10," "w=com,a=10," + "w=example,a=10," "w=flickr,a=10," - "w=www,a=10," - "w=yahoo,a=10", + "w=www,a=10", f._inserter.toStr()); } @@ -476,18 +476,18 @@ TEST_F("requireThatAnnotatedWeightedSetFieldWorks", "w=85,a=10(e=1,w=7,l=9[4])," "w=ab,a=10(e=0,w=4,l=9[6],e=1,w=7,l=9[6])," "w=com,a=10(e=0,w=4,l=9[3],e=1,w=7,l=9[3])," + "w=example,a=10(e=0,w=4,l=9[2])," "w=flickr,a=10(e=1,w=7,l=9[2])," "w=fluke,a=10(e=0,w=4,l=9[5],e=1,w=7,l=9[5])," "w=http,a=10(e=0,w=4,l=9[0],e=1,w=7,l=9[0])," "w=www,a=10(e=0,w=4,l=9[1],e=1,w=7,l=9[1])," - "w=yahoo,a=10(e=0,w=4,l=9[2])," "f=1," "w=http,a=10(e=0,w=4,l=1[0],e=1,w=7,l=1[0])," "f=2," "w=com,a=10(e=0,w=4,l=3[2],e=1,w=7,l=3[2])," + "w=example,a=10(e=0,w=4,l=3[1])," "w=flickr,a=10(e=1,w=7,l=3[1])," "w=www,a=10(e=0,w=4,l=3[0],e=1,w=7,l=3[0])," - "w=yahoo,a=10(e=0,w=4,l=3[1])," "f=3," "w=83,a=10(e=0,w=4,l=1[0])," "w=85,a=10(e=1,w=7,l=1[0])," @@ -504,9 +504,9 @@ TEST_F("requireThatAnnotatedWeightedSetFieldWorks", "w=EnDhOsT,a=10(e=0,w=4,l=5[4],e=1,w=7,l=5[4])," "w=StArThOsT,a=10(e=0,w=4,l=5[0],e=1,w=7,l=5[0])," "w=com,a=10(e=0,w=4,l=5[3],e=1,w=7,l=5[3])," + "w=example,a=10(e=0,w=4,l=5[2])," "w=flickr,a=10(e=1,w=7,l=5[2])," - "w=www,a=10(e=0,w=4,l=5[1],e=1,w=7,l=5[1])," - "w=yahoo,a=10(e=0,w=4,l=5[2])", + "w=www,a=10(e=0,w=4,l=5[1],e=1,w=7,l=5[1])", f._inserter.toStr()); } diff --git a/searchlib/src/tests/fileheaderinspect/.gitignore b/searchlib/src/tests/vespa-fileheader-inspect/.gitignore index 812991d07b5..4ff47722dca 100644 --- a/searchlib/src/tests/fileheaderinspect/.gitignore +++ b/searchlib/src/tests/vespa-fileheader-inspect/.gitignore @@ -3,4 +3,4 @@ Makefile fileheader.dat fileheaderinspect_test out -searchlib_fileheaderinspect_test_app +searchlib_vespa-fileheader-inspect_test_app diff --git a/searchlib/src/tests/vespa-fileheader-inspect/CMakeLists.txt b/searchlib/src/tests/vespa-fileheader-inspect/CMakeLists.txt new file mode 100644 index 00000000000..14bf5a82e3f --- /dev/null +++ b/searchlib/src/tests/vespa-fileheader-inspect/CMakeLists.txt @@ -0,0 +1,10 @@ +# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +vespa_add_executable(searchlib_vespa-fileheader-inspect_test_app TEST + SOURCES + vespa-fileheader-inspect_test.cpp + DEPENDS + searchlib + AFTER + searchlib_vespa-fileheader-inspect_app +) +vespa_add_test(NAME searchlib_vespa-fileheader-inspect_test_app COMMAND searchlib_vespa-fileheader-inspect_test_app) diff --git a/searchlib/src/tests/fileheaderinspect/DESC b/searchlib/src/tests/vespa-fileheader-inspect/DESC index ee57a2fdde3..ee57a2fdde3 100644 --- a/searchlib/src/tests/fileheaderinspect/DESC +++ b/searchlib/src/tests/vespa-fileheader-inspect/DESC diff --git a/searchlib/src/tests/fileheaderinspect/FILES b/searchlib/src/tests/vespa-fileheader-inspect/FILES index 7c32fb811d5..7c32fb811d5 100644 --- a/searchlib/src/tests/fileheaderinspect/FILES +++ b/searchlib/src/tests/vespa-fileheader-inspect/FILES diff --git a/searchlib/src/tests/fileheaderinspect/fileheaderinspect.cpp b/searchlib/src/tests/vespa-fileheader-inspect/vespa-fileheader-inspect_test.cpp index 68bae5e57d8..b54b06e4d93 100644 --- a/searchlib/src/tests/fileheaderinspect/fileheaderinspect.cpp +++ b/searchlib/src/tests/vespa-fileheader-inspect/vespa-fileheader-inspect_test.cpp @@ -34,14 +34,14 @@ vespalib::string readFile(const vespalib::string &fileName) { } TEST("testError") { - EXPECT_TRUE(system("../../apps/fileheaderinspect/vespa-header-inspect notfound.dat") != 0); + EXPECT_TRUE(system("../../apps/vespa-fileheader-inspect/vespa-fileheader-inspect notfound.dat") != 0); } TEST("testEscape") { FileHeader header; header.putTag(FileHeader::Tag("fanart", "\fa\na\r\t")); ASSERT_TRUE(writeHeader(header, "fileheader.dat")); - EXPECT_TRUE(system("../../apps/fileheaderinspect/vespa-header-inspect -q fileheader.dat > out") == 0); + EXPECT_TRUE(system("../../apps/vespa-fileheader-inspect/vespa-fileheader-inspect -q fileheader.dat > out") == 0); EXPECT_EQUAL("fanart;string;\\fa\\na\\r\\t\n", readFile("out")); } @@ -49,7 +49,7 @@ TEST("testDelimiter") { FileHeader header; header.putTag(FileHeader::Tag("string", "string")); ASSERT_TRUE(writeHeader(header, "fileheader.dat")); - EXPECT_TRUE(system("../../apps/fileheaderinspect/vespa-header-inspect -d i -q fileheader.dat > out") == 0); + EXPECT_TRUE(system("../../apps/vespa-fileheader-inspect/vespa-fileheader-inspect -d i -q fileheader.dat > out") == 0); EXPECT_EQUAL("str\\ingistr\\ingistr\\ing\n", readFile("out")); } @@ -57,7 +57,7 @@ TEST("testQuiet") { FileHeader header; FileHeaderTk::addVersionTags(header); ASSERT_TRUE(writeHeader(header, "fileheader.dat")); - EXPECT_TRUE(system("../../apps/fileheaderinspect/vespa-header-inspect -q fileheader.dat > out") == 0); + EXPECT_TRUE(system("../../apps/vespa-fileheader-inspect/vespa-fileheader-inspect -q fileheader.dat > out") == 0); vespalib::string str = readFile("out"); EXPECT_TRUE(!str.empty()); for (uint32_t i = 0, numTags = header.getNumTags(); i < numTags; ++i) { @@ -75,7 +75,7 @@ TEST("testVerbose") { FileHeader header; FileHeaderTk::addVersionTags(header); ASSERT_TRUE(writeHeader(header, "fileheader.dat")); - EXPECT_TRUE(system("../../apps/fileheaderinspect/vespa-header-inspect fileheader.dat > out") == 0); + EXPECT_TRUE(system("../../apps/vespa-fileheader-inspect/vespa-fileheader-inspect fileheader.dat > out") == 0); vespalib::string str = readFile("out"); EXPECT_TRUE(!str.empty()); for (uint32_t i = 0, numTags = header.getNumTags(); i < numTags; ++i) { |