aboutsummaryrefslogtreecommitdiffstats
path: root/fastlib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-04-05 02:32:06 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2017-04-23 02:03:47 +0200
commitb57308e4a134fb6139d2cb52a031d3e7185f16cf (patch)
tree7c31d445e2f76bb737ef90ce29e0e7e6738d6eb1 /fastlib
parent40b8ba5a3f34028d208d4e0dc1b46940d6fe5a47 (diff)
Use override
Diffstat (limited to 'fastlib')
-rw-r--r--fastlib/src/vespa/fastlib/io/fileinputstream.h50
-rw-r--r--fastlib/src/vespa/fastlib/io/inputstream.h5
-rw-r--r--fastlib/src/vespa/fastlib/net/tests/httpheaderparsertest.cpp8
-rw-r--r--fastlib/src/vespa/fastlib/text/tests/latintokenizertest.h11
-rw-r--r--fastlib/src/vespa/fastlib/text/tests/unicodeutiltest.cpp1
-rw-r--r--fastlib/src/vespa/fastlib/text/tests/unicodeutiltest.h16
-rw-r--r--fastlib/src/vespa/fastlib/text/tests/wordfolderstest.h26
-rw-r--r--fastlib/src/vespa/fastlib/util/tests/bagtest.h51
-rw-r--r--fastlib/src/vespa/fastlib/util/tests/base64test.cpp10
9 files changed, 62 insertions, 116 deletions
diff --git a/fastlib/src/vespa/fastlib/io/fileinputstream.h b/fastlib/src/vespa/fastlib/io/fileinputstream.h
index 08806f1d19d..045fc61500f 100644
--- a/fastlib/src/vespa/fastlib/io/fileinputstream.h
+++ b/fastlib/src/vespa/fastlib/io/fileinputstream.h
@@ -1,39 +1,10 @@
// 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 <vespa/fastlib/io/inputstream.h>
-
+#pragma once
+#include "inputstream.h"
+#include <vespa/fastos/file.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:
@@ -48,21 +19,16 @@ private:
/** File opened ok flag */
bool _fileOpenedOk;
-
public:
-
- /** Constructor */
Fast_FileInputStream(const char *fileName);
-
- /** Destructor */
- virtual ~Fast_FileInputStream(void);
+ ~Fast_FileInputStream();
// Implementation of Fast_InputStream interface
- virtual ssize_t Read(void *targetBuffer, size_t bufferSize);
- virtual bool Close();
- virtual ssize_t Available();
- virtual ssize_t Skip(size_t);
+ ssize_t Read(void *targetBuffer, size_t bufferSize) override;
+ bool Close() override;
+ ssize_t Available() override;
+ ssize_t Skip(size_t) override;
};
diff --git a/fastlib/src/vespa/fastlib/io/inputstream.h b/fastlib/src/vespa/fastlib/io/inputstream.h
index 22f65eb95c3..d7b443d28ee 100644
--- a/fastlib/src/vespa/fastlib/io/inputstream.h
+++ b/fastlib/src/vespa/fastlib/io/inputstream.h
@@ -6,11 +6,10 @@
class Fast_InputStream
{
public:
-
virtual ~Fast_InputStream() { }
- virtual ssize_t Available(void) = 0;
- virtual bool Close(void) = 0;
+ virtual ssize_t Available() = 0;
+ virtual bool Close() = 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 6c355b78aa1..5c8f8d4d8f2 100644
--- a/fastlib/src/vespa/fastlib/net/tests/httpheaderparsertest.cpp
+++ b/fastlib/src/vespa/fastlib/net/tests/httpheaderparsertest.cpp
@@ -1,17 +1,13 @@
// 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 <vespa/fastos/app.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(void) override
+ int Main() 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 36477f6b010..082ab62a75e 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 "../latintokenizer.h"
+#include <vespa/fastlib/text/latintokenizer.h>
class Mapel_Pucntuation {
private:
@@ -142,10 +142,9 @@ private:
void TestTypeparamObservers();
public:
- LatinTokenizerTest();
- virtual ~LatinTokenizerTest();
-
- virtual void Run() override;
+ LatinTokenizerTest();
+ ~LatinTokenizerTest();
+ void Run() override;
};
@@ -459,7 +458,7 @@ void LatinTokenizerTest::Run()
class LatinTokenizerTestApp : public FastOS_Application
{
public:
- virtual int Main() override;
+ int Main() override;
};
diff --git a/fastlib/src/vespa/fastlib/text/tests/unicodeutiltest.cpp b/fastlib/src/vespa/fastlib/text/tests/unicodeutiltest.cpp
index b3bb709def9..98860410eef 100644
--- a/fastlib/src/vespa/fastlib/text/tests/unicodeutiltest.cpp
+++ b/fastlib/src/vespa/fastlib/text/tests/unicodeutiltest.cpp
@@ -1,5 +1,4 @@
// 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 28f1323384f..a18728c51a9 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 "../unicodeutil.h"
+#include <vespa/fastlib/text/unicodeutil.h>
+#include <vespa/fastos/app.h>
class UnicodeUtilTest : public Test
{
@@ -40,15 +40,15 @@ class UnicodeUtilTest : public Test
}
public:
- virtual void Run() override {
- // do the tests
- _test(GetUTF8Char_WrongInput());
- _test(IsTerminalPunctuationChar());
- }
+ void Run() override {
+ // do the tests
+ _test(GetUTF8Char_WrongInput());
+ _test(IsTerminalPunctuationChar());
+ }
};
class UnicodeUtilTestApp : public FastOS_Application
{
public:
- virtual int Main() override;
+ int Main() override;
};
diff --git a/fastlib/src/vespa/fastlib/text/tests/wordfolderstest.h b/fastlib/src/vespa/fastlib/text/tests/wordfolderstest.h
index 3c18be1d552..dc9ec0eeb4c 100644
--- a/fastlib/src/vespa/fastlib/text/tests/wordfolderstest.h
+++ b/fastlib/src/vespa/fastlib/text/tests/wordfolderstest.h
@@ -1,9 +1,6 @@
// 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 "../wordfolder.h"
-#include "../normwordfolder.h"
+#include <vespa/fastlib/text/normwordfolder.h>
class WordFoldersTest : public Test
{
@@ -99,9 +96,9 @@ class WordFoldersTest : public Test
bool AccentRemovalTest() {
auto freefunction = [] (char * ptr) { free(ptr); };
- auto input = std::unique_ptr<char, decltype(freefunction)>(Fast_UnicodeUtil::strdupLAT1("¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþpþ!"),
+ auto input = std::unique_ptr<char, decltype(freefunction)>(Fast_UnicodeUtil::strdupLAT1("����������������������������������������������������������������������������������������������p�!"),
freefunction);
- auto yelloutput = std::unique_ptr<char, decltype(freefunction)>(Fast_UnicodeUtil::strdupLAT1("¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿AAAAAEAAAECEEEEIIIIDNOOOOOE×OEUUUUEYTHssaaaaaeaaaeceeeeiiiidnoooooe÷oeuuuueythpth!"),
+ auto yelloutput = std::unique_ptr<char, decltype(freefunction)>(Fast_UnicodeUtil::strdupLAT1("�������������������������������AAAAAEAAAECEEEEIIIIDNOOOOOE�OEUUUUEYTHssaaaaaeaaaeceeeeiiiidnoooooe�oeuuuueythpth!"),
freefunction);
Fast_NormalizeWordFolder wordfolder;
int len = wordfolder.FoldedSizeAsUTF8(input.get());
@@ -115,17 +112,18 @@ class WordFoldersTest : public Test
public:
- virtual void Run() override {
- // do the tests
- _test(NormalizeWordFolderConstruction());
- _test(TokenizeAnnotatedBuffer());
- _test(TokenizeAnnotatedUCS4Buffer());
- _test(AccentRemovalTest());
- }
+
+ void Run() override {
+ // do the tests
+ _test(NormalizeWordFolderConstruction());
+ _test(TokenizeAnnotatedBuffer());
+ _test(TokenizeAnnotatedUCS4Buffer());
+ _test(AccentRemovalTest());
+ }
};
class WordFoldersTestApp : public FastOS_Application
{
public:
- virtual int Main() override;
+ int Main() override;
};
diff --git a/fastlib/src/vespa/fastlib/util/tests/bagtest.h b/fastlib/src/vespa/fastlib/util/tests/bagtest.h
index 7ca33f318f0..597317bf38e 100644
--- a/fastlib/src/vespa/fastlib/util/tests/bagtest.h
+++ b/fastlib/src/vespa/fastlib/util/tests/bagtest.h
@@ -1,10 +1,8 @@
// 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>
/**
@@ -527,37 +525,30 @@ public:
delete[] _array;
}
-
-
- 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);
- }
-
-
+ 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:
-
- virtual int Main() override;
+ int Main() override;
};
-
-
diff --git a/fastlib/src/vespa/fastlib/util/tests/base64test.cpp b/fastlib/src/vespa/fastlib/util/tests/base64test.cpp
index 970f87831b1..92cc2fee719 100644
--- a/fastlib/src/vespa/fastlib/util/tests/base64test.cpp
+++ b/fastlib/src/vespa/fastlib/util/tests/base64test.cpp
@@ -1,14 +1,12 @@
// 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 <stdio.h>
-#include <assert.h>
-#include <memory>
+#include <vespa/fastos/app.h>
+#include <vespa/fastos/file.h>
#include <vespa/vespalib/stllike/string.h>
-#include "../base64.h"
+#include <vespa/fastlib/util/base64.h>
class Base64Test : public FastOS_Application {
public:
- virtual int Main() override;
+ int Main() override;
};
int