NthItemTest: Add definition for virtual destructor

This fixes a compiler warning from clang:

unittest/nthitem_test.cc:22:7: warning:
 'NthItemTest' has no out-of-line virtual method definitions;
 its vtable will be emitted in every translation unit [-Wweak-vtables]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2018-09-04 08:07:20 +02:00
parent 80c1235c12
commit 5178142ab1

View File

@ -21,6 +21,7 @@ int test_data[] = { 8, 1, 2, -4, 7, 9, 65536, 4, 9, 0, -32767, 6, 7};
// The fixture for testing GenericHeap and DoublePtr.
class NthItemTest : public testing::Test {
public:
virtual ~NthItemTest();
// Pushes the test data onto the KDVector.
void PushTestData(KDVector* v) {
for (int i = 0; i < ARRAYSIZE(test_data); ++i) {
@ -30,6 +31,11 @@ class NthItemTest : public testing::Test {
}
};
// Destructor.
// It is defined here, so the compiler can create a single vtable
// instead of a weak vtable (fixes compiler warning).
NthItemTest::~NthItemTest() = default;
// Tests basic results.
TEST_F(NthItemTest, GeneralTest) {
KDVector v;