diff options
author | Arne H Juul <arnej27959@users.noreply.github.com> | 2017-04-24 12:10:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-24 12:10:42 +0200 |
commit | 9ff4bdb407ed8d855a3f86a17c99906ff738177b (patch) | |
tree | fc2b050224d7dde92d57e1f9cac12c1e5aaf6b90 /fastlib/src | |
parent | 32ae190acc9ac5081049e1c7008d1602c68cf821 (diff) |
Revert "Balder/enforce override 2"
Diffstat (limited to 'fastlib/src')
9 files changed, 114 insertions, 60 deletions
diff --git a/fastlib/src/vespa/fastlib/io/fileinputstream.h b/fastlib/src/vespa/fastlib/io/fileinputstream.h index 045fc61500f..08806f1d19d 100644 --- a/fastlib/src/vespa/fastlib/io/fileinputstream.h +++ b/fastlib/src/vespa/fastlib/io/fileinputstream.h @@ -1,10 +1,39 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - +/** +******************************************************************************* +* +* @author Stein Hardy Danielsen +* @date Creation date: 2000-10-07 +* @version $Id$ +* +* @file +* +* FileInputStream class +* +* Copyright (c) : 1997-2000 Fast Search & Transfer ASA +* ALL RIGHTS RESERVED +* +******************************************************************************/ #pragma once -#include "inputstream.h" -#include <vespa/fastos/file.h> +#include <vespa/fastlib/io/inputstream.h> + + + +/** +******************************************************************************** +* +* FileInputStream class +* @author Stein Hardy Danielsen +* @date Creation date: 2000-10-07 +* @version $Id$ +* +* +* Copyright (c) : 1997-2000 Fast Search & Transfer ASA +* ALL RIGHTS RESERVED +* +******************************************************************************/ class Fast_FileInputStream : public Fast_InputStream { private: @@ -19,16 +48,21 @@ private: /** File opened ok flag */ bool _fileOpenedOk; + public: + + /** Constructor */ Fast_FileInputStream(const char *fileName); - ~Fast_FileInputStream(); + + /** Destructor */ + virtual ~Fast_FileInputStream(void); // Implementation of Fast_InputStream interface - ssize_t Read(void *targetBuffer, size_t bufferSize) override; - bool Close() override; - ssize_t Available() override; - ssize_t Skip(size_t) override; + virtual ssize_t Read(void *targetBuffer, size_t bufferSize); + virtual bool Close(); + virtual ssize_t Available(); + virtual ssize_t Skip(size_t); }; diff --git a/fastlib/src/vespa/fastlib/io/inputstream.h b/fastlib/src/vespa/fastlib/io/inputstream.h index d7b443d28ee..22f65eb95c3 100644 --- a/fastlib/src/vespa/fastlib/io/inputstream.h +++ b/fastlib/src/vespa/fastlib/io/inputstream.h @@ -6,10 +6,11 @@ class Fast_InputStream { public: + virtual ~Fast_InputStream() { } - virtual ssize_t Available() = 0; - virtual bool Close() = 0; + virtual ssize_t Available(void) = 0; + virtual bool Close(void) = 0; virtual ssize_t Read(void *targetBuffer, size_t bufferSize) = 0; virtual ssize_t Skip(size_t skipNBytes) = 0; }; diff --git a/fastlib/src/vespa/fastlib/net/tests/httpheaderparsertest.cpp b/fastlib/src/vespa/fastlib/net/tests/httpheaderparsertest.cpp index 5c8f8d4d8f2..6c355b78aa1 100644 --- a/fastlib/src/vespa/fastlib/net/tests/httpheaderparsertest.cpp +++ b/fastlib/src/vespa/fastlib/net/tests/httpheaderparsertest.cpp @@ -1,13 +1,17 @@ // 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/fastos/fastos.h> #include <vespa/fastlib/net/httpheaderparser.h> #include <vespa/fastlib/io/fileinputstream.h> #include <vespa/fastlib/io/bufferedinputstream.h> + + + class HeaderReaderApp : public FastOS_Application { public: - int Main() override + + int Main(void) override { if (_argc != 2) { diff --git a/fastlib/src/vespa/fastlib/text/tests/latintokenizertest.h b/fastlib/src/vespa/fastlib/text/tests/latintokenizertest.h index 082ab62a75e..36477f6b010 100644 --- a/fastlib/src/vespa/fastlib/text/tests/latintokenizertest.h +++ b/fastlib/src/vespa/fastlib/text/tests/latintokenizertest.h @@ -4,7 +4,7 @@ #include <vespa/fastlib/testsuite/test.h> #include <vespa/vespalib/stllike/string.h> #include <vespa/vespalib/util/stringfmt.h> -#include <vespa/fastlib/text/latintokenizer.h> +#include "../latintokenizer.h" class Mapel_Pucntuation { private: @@ -142,9 +142,10 @@ private: void TestTypeparamObservers(); public: - LatinTokenizerTest(); - ~LatinTokenizerTest(); - void Run() override; + LatinTokenizerTest(); + virtual ~LatinTokenizerTest(); + + virtual void Run() override; }; @@ -458,7 +459,7 @@ void LatinTokenizerTest::Run() class LatinTokenizerTestApp : public FastOS_Application { public: - int Main() override; + virtual int Main() override; }; diff --git a/fastlib/src/vespa/fastlib/text/tests/unicodeutiltest.cpp b/fastlib/src/vespa/fastlib/text/tests/unicodeutiltest.cpp index 98860410eef..b3bb709def9 100644 --- a/fastlib/src/vespa/fastlib/text/tests/unicodeutiltest.cpp +++ b/fastlib/src/vespa/fastlib/text/tests/unicodeutiltest.cpp @@ -1,4 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include <vespa/fastos/fastos.h> #include "unicodeutiltest.h" int UnicodeUtilTestApp::Main() diff --git a/fastlib/src/vespa/fastlib/text/tests/unicodeutiltest.h b/fastlib/src/vespa/fastlib/text/tests/unicodeutiltest.h index a18728c51a9..28f1323384f 100644 --- a/fastlib/src/vespa/fastlib/text/tests/unicodeutiltest.h +++ b/fastlib/src/vespa/fastlib/text/tests/unicodeutiltest.h @@ -1,7 +1,7 @@ // Copyright 2016 Yahoo Inc. 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> + +#include "../unicodeutil.h" class UnicodeUtilTest : public Test { @@ -40,15 +40,15 @@ class UnicodeUtilTest : public Test } public: - void Run() override { - // do the tests - _test(GetUTF8Char_WrongInput()); - _test(IsTerminalPunctuationChar()); - } + virtual void Run() override { + // do the tests + _test(GetUTF8Char_WrongInput()); + _test(IsTerminalPunctuationChar()); + } }; class UnicodeUtilTestApp : public FastOS_Application { public: - int Main() override; + virtual int Main() override; }; diff --git a/fastlib/src/vespa/fastlib/text/tests/wordfolderstest.h b/fastlib/src/vespa/fastlib/text/tests/wordfolderstest.h index c4eb6867dbd..3c18be1d552 100644 --- a/fastlib/src/vespa/fastlib/text/tests/wordfolderstest.h +++ b/fastlib/src/vespa/fastlib/text/tests/wordfolderstest.h @@ -1,6 +1,9 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include <memory> #include <vespa/fastlib/testsuite/test.h> -#include <vespa/fastlib/text/normwordfolder.h> + +#include "../wordfolder.h" +#include "../normwordfolder.h" class WordFoldersTest : public Test { @@ -112,18 +115,17 @@ class WordFoldersTest : public Test public: - - void Run() override { - // do the tests - _test(NormalizeWordFolderConstruction()); - _test(TokenizeAnnotatedBuffer()); - _test(TokenizeAnnotatedUCS4Buffer()); - _test(AccentRemovalTest()); - } + virtual void Run() override { + // do the tests + _test(NormalizeWordFolderConstruction()); + _test(TokenizeAnnotatedBuffer()); + _test(TokenizeAnnotatedUCS4Buffer()); + _test(AccentRemovalTest()); + } }; class WordFoldersTestApp : public FastOS_Application { public: - int Main() override; + virtual int Main() override; }; diff --git a/fastlib/src/vespa/fastlib/util/tests/bagtest.h b/fastlib/src/vespa/fastlib/util/tests/bagtest.h index 597317bf38e..7ca33f318f0 100644 --- a/fastlib/src/vespa/fastlib/util/tests/bagtest.h +++ b/fastlib/src/vespa/fastlib/util/tests/bagtest.h @@ -1,8 +1,10 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include <iostream> + #include <vespa/fastlib/util/bag.h> + #include <vespa/fastlib/testsuite/test.h> -#include <iostream> /** @@ -525,30 +527,37 @@ public: delete[] _array; } - void Run() override { - RunTest(&BagTester::IterPtrInitTest); - RunTest(&BagTester::IterRefInitTest); - RunTest(&BagTester::IterPtrStartTest); - RunTest(&BagTester::IterRefStartTest); - RunTest(&BagTester::IterStartOverTest); - RunTest(&BagTester::IterPPOperTest); - RunTest(&BagTester::GrowTest); - RunTest(&BagTester::AssignTest); - RunTest(&BagTester::CopyConstTest); - RunTest(&BagTester::EqualTest); - RunTest(&BagTester::DeleteEnumTest); - RunTest(&BagTester::RemoveTest); - RunTest(&BagTester::HasElementTest); - RunTest(&BagTester::RemoveAllElementsTest); - RunTest(&BagTester::GetBlocksizeTest); - RunTest(&BagTester::SetBlocksizeTest); - RunTest(&BagTester::NumberOfElementsTest); - } + + + virtual void Run() override { + RunTest(&BagTester::IterPtrInitTest); + RunTest(&BagTester::IterRefInitTest); + RunTest(&BagTester::IterPtrStartTest); + RunTest(&BagTester::IterRefStartTest); + RunTest(&BagTester::IterStartOverTest); + RunTest(&BagTester::IterPPOperTest); + RunTest(&BagTester::GrowTest); + RunTest(&BagTester::AssignTest); + RunTest(&BagTester::CopyConstTest); + RunTest(&BagTester::EqualTest); + RunTest(&BagTester::DeleteEnumTest); + RunTest(&BagTester::RemoveTest); + RunTest(&BagTester::HasElementTest); + RunTest(&BagTester::RemoveAllElementsTest); + RunTest(&BagTester::GetBlocksizeTest); + RunTest(&BagTester::SetBlocksizeTest); + RunTest(&BagTester::NumberOfElementsTest); + } + + }; class BagTest : public FastOS_Application { public: - int Main() override; + + virtual int Main() override; }; + + diff --git a/fastlib/src/vespa/fastlib/util/tests/base64test.cpp b/fastlib/src/vespa/fastlib/util/tests/base64test.cpp index 92cc2fee719..970f87831b1 100644 --- a/fastlib/src/vespa/fastlib/util/tests/base64test.cpp +++ b/fastlib/src/vespa/fastlib/util/tests/base64test.cpp @@ -1,12 +1,14 @@ // 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/fastos/file.h> +#include <vespa/fastos/fastos.h> +#include <stdio.h> +#include <assert.h> +#include <memory> #include <vespa/vespalib/stllike/string.h> -#include <vespa/fastlib/util/base64.h> +#include "../base64.h" class Base64Test : public FastOS_Application { public: - int Main() override; + virtual int Main() override; }; int |