diff options
author | Andres Noetzli <andres.noetzli@gmail.com> | 2018-08-23 16:28:21 -0700 |
---|---|---|
committer | Aina Niemetz <aina.niemetz@gmail.com> | 2018-08-23 16:28:21 -0700 |
commit | 11a34205808098e503f145b2a779078dd509729e (patch) | |
tree | bd4a69d62192273d4de237d8c7252448cef41c95 /test/unit/context/context_black.h | |
parent | 860ae582f334bea2835806b0d5044ca1b6e90d76 (diff) |
Add missing overrides in unit tests (#2362)
Diffstat (limited to 'test/unit/context/context_black.h')
-rw-r--r-- | test/unit/context/context_black.h | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/test/unit/context/context_black.h b/test/unit/context/context_black.h index 63b60edc9..b4be4197c 100644 --- a/test/unit/context/context_black.h +++ b/test/unit/context/context_black.h @@ -36,12 +36,10 @@ struct MyContextNotifyObj : public ContextNotifyObj { ContextNotifyObj(context, pre), nCalls(0) { } - - virtual ~MyContextNotifyObj() {} - void contextNotifyPop() { - ++nCalls; - } + ~MyContextNotifyObj() override {} + + void contextNotifyPop() override { ++nCalls; } }; class MyContextObj : public ContextObj { @@ -75,18 +73,15 @@ public: nSaves(0) { } - virtual ~MyContextObj() { - destroy(); - } + ~MyContextObj() override { destroy(); } - ContextObj* save(ContextMemoryManager* pcmm) { + ContextObj* save(ContextMemoryManager* pcmm) override + { ++nSaves; return new(pcmm) MyContextObj(*this); } - void restore(ContextObj* contextObj) { - nCalls = notify.nCalls; - } + void restore(ContextObj* contextObj) override { nCalls = notify.nCalls; } void makeCurrent() { ContextObj::makeCurrent(); @@ -99,17 +94,13 @@ private: Context* d_context; -public: + public: + void setUp() override { d_context = new Context; } - void setUp() { - d_context = new Context; - } - - void tearDown() { - delete d_context; - } + void tearDown() override { delete d_context; } - void testContextPushPop() { + void testContextPushPop() + { // Test what happens when the context is popped below 0 // the interface doesn't declare any exceptions d_context->push(); |