diff options
author | Håvard Pettersen <havardpe@oath.com> | 2022-04-06 12:18:08 +0000 |
---|---|---|
committer | Håvard Pettersen <havardpe@oath.com> | 2022-04-08 13:45:13 +0000 |
commit | 9fbcf76d088740aacf535e6482f86c833cfae871 (patch) | |
tree | c62dcd0f9cdcee9876b37c60f741958c14147f80 /fastlib | |
parent | 69454cef2fe53694eb5541e5f622a4e973c081bf (diff) |
remove FastOS_Application
fixup (per application):
- maybe ignore SIGPIPE
- wire argc/argv
untangle Vespa Test Framework
strip down deprecated TestApp
Diffstat (limited to 'fastlib')
10 files changed, 9 insertions, 67 deletions
diff --git a/fastlib/src/vespa/fastlib/testsuite/suite.h b/fastlib/src/vespa/fastlib/testsuite/suite.h index 43a655fab31..fea685731ae 100644 --- a/fastlib/src/vespa/fastlib/testsuite/suite.h +++ b/fastlib/src/vespa/fastlib/testsuite/suite.h @@ -28,10 +28,10 @@ * * * - * class MySuiteApp : public FastOS_Application + * class MySuiteApp * { * public: - * virtual int Main(); + * int Main(); * }; * * @@ -50,8 +50,6 @@ * mts.Free(); * } * - * FASTOS_MAIN(MyTestApp) - * * --- * **************************************************************************/ diff --git a/fastlib/src/vespa/fastlib/testsuite/test.h b/fastlib/src/vespa/fastlib/testsuite/test.h index ed771da04ec..1388c3ba812 100644 --- a/fastlib/src/vespa/fastlib/testsuite/test.h +++ b/fastlib/src/vespa/fastlib/testsuite/test.h @@ -22,10 +22,10 @@ * * }; * - * class MyTestApp : public FastOS_Application + * class MyTestApp * { * public: - * virtual int Main(); + * int Main(); * }; * * @@ -46,7 +46,6 @@ * return 0; * } * - * FASTOS_MAIN(MyTestApp) * * ---- * diff --git a/fastlib/src/vespa/fastlib/text/apps/unicode_propertydump.cpp b/fastlib/src/vespa/fastlib/text/apps/unicode_propertydump.cpp index 551c86cff2e..5f2b6089cdf 100644 --- a/fastlib/src/vespa/fastlib/text/apps/unicode_propertydump.cpp +++ b/fastlib/src/vespa/fastlib/text/apps/unicode_propertydump.cpp @@ -1,20 +1,10 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/fastlib/text/unicodeutil.h> -#include <vespa/fastos/app.h> -class UnicodePropertyDumpApp : public FastOS_Application -{ -public: - virtual int Main(); -}; - -int UnicodePropertyDumpApp::Main() -{ +int main(int argc, char **argv) { for (ucs4_t testchar = 0; testchar < 0x10000; testchar++) { printf("%08x %04x\n", testchar, Fast_UnicodeUtil::GetProperty(testchar)); } return 0; } - -FASTOS_MAIN(UnicodePropertyDumpApp) diff --git a/fastlib/src/vespa/fastlib/text/apps/unicode_tolowerdump.cpp b/fastlib/src/vespa/fastlib/text/apps/unicode_tolowerdump.cpp index f9a88e71008..7d84f6e931d 100644 --- a/fastlib/src/vespa/fastlib/text/apps/unicode_tolowerdump.cpp +++ b/fastlib/src/vespa/fastlib/text/apps/unicode_tolowerdump.cpp @@ -1,20 +1,10 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/fastlib/text/unicodeutil.h> -#include <vespa/fastos/app.h> -class UnicodeToLowerDumpApp : public FastOS_Application -{ -public: - virtual int Main(); -}; - -int UnicodeToLowerDumpApp::Main() -{ +int main(int argc, char **argv) { for (ucs4_t testchar = 0; testchar < 0x10000; testchar++) { printf("%08x %08x\n", testchar, Fast_UnicodeUtil::ToLower(testchar)); } return 0; } - -FASTOS_MAIN(UnicodeToLowerDumpApp) diff --git a/fastlib/src/vespa/fastlib/text/tests/latintokenizertest.cpp b/fastlib/src/vespa/fastlib/text/tests/latintokenizertest.cpp index cc6f62a0149..89273ab1ec0 100644 --- a/fastlib/src/vespa/fastlib/text/tests/latintokenizertest.cpp +++ b/fastlib/src/vespa/fastlib/text/tests/latintokenizertest.cpp @@ -1,12 +1,9 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "latintokenizertest.h" -int LatinTokenizerTestApp::Main() -{ +int main(int, char **) { LatinTokenizerTest lta; lta.SetStream(&std::cout); lta.Run(); return lta.Report(); } - -FASTOS_MAIN(LatinTokenizerTestApp); diff --git a/fastlib/src/vespa/fastlib/text/tests/latintokenizertest.h b/fastlib/src/vespa/fastlib/text/tests/latintokenizertest.h index 8b8635db905..38dc08aa677 100644 --- a/fastlib/src/vespa/fastlib/text/tests/latintokenizertest.h +++ b/fastlib/src/vespa/fastlib/text/tests/latintokenizertest.h @@ -4,7 +4,6 @@ #include <vespa/fastlib/testsuite/test.h> #include <vespa/fastlib/text/latintokenizer.h> #include <vespa/vespalib/util/stringfmt.h> -#include <vespa/fastos/app.h> class Mapel_Pucntuation { private: @@ -449,14 +448,3 @@ void LatinTokenizerTest::Run() TestTypeparamObservers(); TestMapelURL(); } - - -/** - The FastOS application class. -*/ - -class LatinTokenizerTestApp : public FastOS_Application -{ -public: - int Main() override; -}; diff --git a/fastlib/src/vespa/fastlib/text/tests/unicodeutiltest.cpp b/fastlib/src/vespa/fastlib/text/tests/unicodeutiltest.cpp index 5398d742042..9e7fa176a8c 100644 --- a/fastlib/src/vespa/fastlib/text/tests/unicodeutiltest.cpp +++ b/fastlib/src/vespa/fastlib/text/tests/unicodeutiltest.cpp @@ -1,12 +1,9 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "unicodeutiltest.h" -int UnicodeUtilTestApp::Main() -{ +int main(int, char **) { UnicodeUtilTest t; t.SetStream(&std::cout); t.Run(); return t.Report(); } - -FASTOS_MAIN(UnicodeUtilTestApp) diff --git a/fastlib/src/vespa/fastlib/text/tests/unicodeutiltest.h b/fastlib/src/vespa/fastlib/text/tests/unicodeutiltest.h index 13bfc5b11f8..da7bae6d313 100644 --- a/fastlib/src/vespa/fastlib/text/tests/unicodeutiltest.h +++ b/fastlib/src/vespa/fastlib/text/tests/unicodeutiltest.h @@ -1,7 +1,6 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/fastlib/testsuite/test.h> #include <vespa/fastlib/text/unicodeutil.h> -#include <vespa/fastos/app.h> class UnicodeUtilTest : public Test { @@ -46,9 +45,3 @@ public: _test(IsTerminalPunctuationChar()); } }; - -class UnicodeUtilTestApp : public FastOS_Application -{ -public: - int Main() override; -}; diff --git a/fastlib/src/vespa/fastlib/text/tests/wordfolderstest.cpp b/fastlib/src/vespa/fastlib/text/tests/wordfolderstest.cpp index 21d1e0129ba..ea254b3d114 100644 --- a/fastlib/src/vespa/fastlib/text/tests/wordfolderstest.cpp +++ b/fastlib/src/vespa/fastlib/text/tests/wordfolderstest.cpp @@ -1,12 +1,9 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "wordfolderstest.h" -int WordFoldersTestApp::Main() -{ +int main(int, char **) { WordFoldersTest t; t.SetStream(&std::cout); t.Run(); return t.Report(); } - -FASTOS_MAIN(WordFoldersTestApp) diff --git a/fastlib/src/vespa/fastlib/text/tests/wordfolderstest.h b/fastlib/src/vespa/fastlib/text/tests/wordfolderstest.h index 2ee97be1a00..b82415a9822 100644 --- a/fastlib/src/vespa/fastlib/text/tests/wordfolderstest.h +++ b/fastlib/src/vespa/fastlib/text/tests/wordfolderstest.h @@ -1,7 +1,6 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/fastlib/testsuite/test.h> #include <vespa/fastlib/text/normwordfolder.h> -#include <vespa/fastos/app.h> #include <memory> #include <cstring> @@ -126,9 +125,3 @@ public: _test(AccentRemovalTest()); } }; - -class WordFoldersTestApp : public FastOS_Application -{ -public: - int Main() override; -}; |