From 9ff4bdb407ed8d855a3f86a17c99906ff738177b Mon Sep 17 00:00:00 2001 From: Arne H Juul Date: Mon, 24 Apr 2017 12:10:42 +0200 Subject: Revert "Balder/enforce override 2" --- fastlib/src/vespa/fastlib/io/fileinputstream.h | 50 +++++++++++++++++---- fastlib/src/vespa/fastlib/io/inputstream.h | 5 ++- .../fastlib/net/tests/httpheaderparsertest.cpp | 8 +++- .../vespa/fastlib/text/tests/latintokenizertest.h | 11 ++--- .../vespa/fastlib/text/tests/unicodeutiltest.cpp | 1 + .../src/vespa/fastlib/text/tests/unicodeutiltest.h | 16 +++---- .../src/vespa/fastlib/text/tests/wordfolderstest.h | 22 +++++----- fastlib/src/vespa/fastlib/util/tests/bagtest.h | 51 +++++++++++++--------- .../src/vespa/fastlib/util/tests/base64test.cpp | 10 +++-- 9 files changed, 114 insertions(+), 60 deletions(-) (limited to 'fastlib') 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 +#include + + + +/** +******************************************************************************** +* +* 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 +#include #include #include #include + + + 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 #include #include -#include +#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 #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 -#include -#include + +#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 #include -#include + +#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 + #include + #include -#include /** @@ -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 -#include +#include +#include +#include +#include #include -#include +#include "../base64.h" class Base64Test : public FastOS_Application { public: - int Main() override; + virtual int Main() override; }; int -- cgit v1.2.3