aboutsummaryrefslogtreecommitdiffstats
path: root/fastlib
diff options
context:
space:
mode:
authorArne H Juul <arnej@yahoo-inc.com>2017-05-02 11:05:57 +0200
committerArne H Juul <arnej@yahoo-inc.com>2017-05-02 11:09:00 +0200
commitc62a40b368c3f87f2af75038974961e83a48a779 (patch)
tree557a2e2241ef5d19d4236067dd3c05a868752b7a /fastlib
parentc638dea6f73bb3b250326f2c386b18a2120abfc3 (diff)
misc cleanup from Baldersheim
* include file cleanup * only do LOG_SETUP as needed * remove "virtual" where "override" is specified also * some minor reformatting and indentation changes
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.h22
-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, 60 insertions, 114 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..c4eb6867dbd 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
{
@@ -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