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 /fnet/src/tests | |
parent | 32ae190acc9ac5081049e1c7008d1602c68cf821 (diff) |
Revert "Balder/enforce override 2"
Diffstat (limited to 'fnet/src/tests')
-rw-r--r-- | fnet/src/tests/frt/method_pt/method_pt.cpp | 36 | ||||
-rw-r--r-- | fnet/src/tests/frt/rpc/invoke.cpp | 10 | ||||
-rw-r--r-- | fnet/src/tests/frt/rpc/sharedblob.cpp | 8 | ||||
-rw-r--r-- | fnet/src/tests/locking/castspeed.cpp | 4 | ||||
-rw-r--r-- | fnet/src/tests/locking/drainpackets.cpp | 6 | ||||
-rw-r--r-- | fnet/src/tests/scheduling/sloweventloop.cpp | 1 | ||||
-rw-r--r-- | fnet/src/tests/sync_execute/sync_execute.cpp | 6 |
7 files changed, 39 insertions, 32 deletions
diff --git a/fnet/src/tests/frt/method_pt/method_pt.cpp b/fnet/src/tests/frt/method_pt/method_pt.cpp index 98ab9d228a1..4b869f6ba9f 100644 --- a/fnet/src/tests/frt/method_pt/method_pt.cpp +++ b/fnet/src/tests/frt/method_pt/method_pt.cpp @@ -112,9 +112,9 @@ class MediumHandler1 : public FRT_Invokable, public MediumB { public: - void foo() override {} - void bar() override {} - void RPC_Method(FRT_RPCRequest *req); + virtual void foo() override {} + virtual void bar() override {} + void RPC_Method(FRT_RPCRequest *req); }; @@ -123,9 +123,9 @@ class MediumHandler2 : public MediumA, public MediumB { public: - void foo() override {} - void bar() override {} - void RPC_Method(FRT_RPCRequest *req); + virtual void foo() override {} + virtual void bar() override {} + void RPC_Method(FRT_RPCRequest *req); }; @@ -134,9 +134,9 @@ class MediumHandler3 : public MediumA, public FRT_Invokable { public: - void foo() override {} - void bar() override {} - void RPC_Method(FRT_RPCRequest *req); + virtual void foo() override {} + virtual void bar() override {} + void RPC_Method(FRT_RPCRequest *req); }; //------------------------------------------------------------- @@ -146,9 +146,9 @@ class ComplexHandler1 : public FRT_Invokable, public ComplexB { public: - void foo() override {} - void bar() override {} - void RPC_Method(FRT_RPCRequest *req); + virtual void foo() override {} + virtual void bar() override {} + void RPC_Method(FRT_RPCRequest *req); }; @@ -157,9 +157,9 @@ class ComplexHandler2 : public ComplexA, public ComplexB { public: - void foo() override {} - void bar() override {} - void RPC_Method(FRT_RPCRequest *req); + virtual void foo() override {} + virtual void bar() override {} + void RPC_Method(FRT_RPCRequest *req); }; @@ -168,9 +168,9 @@ class ComplexHandler3 : public ComplexA, public FRT_Invokable { public: - void foo() override {} - void bar() override {} - void RPC_Method(FRT_RPCRequest *req); + virtual void foo() override {} + virtual void bar() override {} + void RPC_Method(FRT_RPCRequest *req); }; //------------------------------------------------------------- diff --git a/fnet/src/tests/frt/rpc/invoke.cpp b/fnet/src/tests/frt/rpc/invoke.cpp index d51557e9cfd..7853c473f5e 100644 --- a/fnet/src/tests/frt/rpc/invoke.cpp +++ b/fnet/src/tests/frt/rpc/invoke.cpp @@ -48,7 +48,8 @@ struct LockedReqWait : public FRT_IRequestWait return ret; } - void RequestDone(FRT_RPCRequest *) override { + virtual void RequestDone(FRT_RPCRequest *) override + { _wasLocked = isLocked(); _cond.Lock(); _done = true; @@ -56,7 +57,8 @@ struct LockedReqWait : public FRT_IRequestWait _cond.Unlock(); } - void waitReq() { + void waitReq() + { _cond.Lock(); while(!_done) { _cond.Wait(); @@ -76,7 +78,9 @@ private: DelayedReturn &operator=(const DelayedReturn &); public: - DelayedReturn(FNET_Scheduler *sched, FRT_RPCRequest *req, double delay) + DelayedReturn(FNET_Scheduler *sched, + FRT_RPCRequest *req, + double delay) : FNET_Task(sched), _req(req) { diff --git a/fnet/src/tests/frt/rpc/sharedblob.cpp b/fnet/src/tests/frt/rpc/sharedblob.cpp index 363a7891cbd..a086584b36a 100644 --- a/fnet/src/tests/frt/rpc/sharedblob.cpp +++ b/fnet/src/tests/frt/rpc/sharedblob.cpp @@ -10,10 +10,10 @@ struct MyBlob : FRT_ISharedBlob { int refcnt; MyBlob() : refcnt(1) {} - uint32_t getLen() override { return (strlen("blob_test") + 1); } - const char *getData() override { return "blob_test"; } - void addRef() override { ++refcnt; } - void subRef() override { --refcnt; } + virtual uint32_t getLen() override { return (strlen("blob_test") + 1); } + virtual const char *getData() override { return "blob_test"; } + virtual void addRef() override { ++refcnt; } + virtual void subRef() override { --refcnt; } }; struct Data diff --git a/fnet/src/tests/locking/castspeed.cpp b/fnet/src/tests/locking/castspeed.cpp index 859ec08ec69..1f57bc4757c 100644 --- a/fnet/src/tests/locking/castspeed.cpp +++ b/fnet/src/tests/locking/castspeed.cpp @@ -18,14 +18,14 @@ class C: public A { public: B *otherB; - B* asB() override { return otherB; } + virtual B* asB() override { return otherB; } C() : otherB(nullptr) {} }; class B: public C { public: - B* asB() override { return this; } + virtual B* asB() override { return this; } }; diff --git a/fnet/src/tests/locking/drainpackets.cpp b/fnet/src/tests/locking/drainpackets.cpp index b453793843f..fb86371c9ec 100644 --- a/fnet/src/tests/locking/drainpackets.cpp +++ b/fnet/src/tests/locking/drainpackets.cpp @@ -2,13 +2,15 @@ #include <vespa/vespalib/testkit/test_kit.h> #include <vespa/fnet/fnet.h> + class MyPacket : public FNET_Packet { public: - uint32_t GetPCODE() override { return 0; } + uint32_t GetPCODE() override { return 0; } uint32_t GetLength() override { return 0; } void Encode(FNET_DataBuffer *) override {} - bool Decode(FNET_DataBuffer *, uint32_t) override { return true; } + bool Decode(FNET_DataBuffer *, uint32_t) override + { return true; } }; diff --git a/fnet/src/tests/scheduling/sloweventloop.cpp b/fnet/src/tests/scheduling/sloweventloop.cpp index a13205f4b0e..a4b57cfd218 100644 --- a/fnet/src/tests/scheduling/sloweventloop.cpp +++ b/fnet/src/tests/scheduling/sloweventloop.cpp @@ -2,6 +2,7 @@ #include <vespa/vespalib/testkit/test_kit.h> #include <vespa/fnet/fnet.h> + class MyTask : public FNET_Task { public: diff --git a/fnet/src/tests/sync_execute/sync_execute.cpp b/fnet/src/tests/sync_execute/sync_execute.cpp index ca77ab6f73b..c832ef0330d 100644 --- a/fnet/src/tests/sync_execute/sync_execute.cpp +++ b/fnet/src/tests/sync_execute/sync_execute.cpp @@ -1,11 +1,11 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/testkit/test_kit.h> -#include <vespa/fnet/transport.h> -#include <vespa/fnet/iexecutable.h> +#include <vespa/fnet/fnet.h> +#include <vespa/vespalib/util/sync.h> struct DoIt : public FNET_IExecutable { vespalib::Gate gate; - void execute() override { + virtual void execute() override { gate.countDown(); } }; |