summaryrefslogtreecommitdiffstats
path: root/vespalib
diff options
context:
space:
mode:
authorGeir Storli <geirst@vespa.ai>2024-03-08 20:26:21 +0100
committerGitHub <noreply@github.com>2024-03-08 20:26:21 +0100
commit7d6e7ffd35719acc6b062d68f83ffaf3679d29a0 (patch)
tree2dc19d48a53f92af38a351059dfcce60fbf0aa77 /vespalib
parent0a598408e9ea5658a054b7e131552bfc7d146848 (diff)
parent301969ec68da7355fc0bd569d7c49c9df6927e48 (diff)
Merge pull request #30524 from vespa-engine/toregge/rewrite-growable-byte-buffer-unit-test-to-gtest
Rewrite GroableByteBuffer unit test to gtest.
Diffstat (limited to 'vespalib')
-rw-r--r--vespalib/src/tests/growablebytebuffer/CMakeLists.txt1
-rw-r--r--vespalib/src/tests/growablebytebuffer/growablebytebuffer_test.cpp24
2 files changed, 5 insertions, 20 deletions
diff --git a/vespalib/src/tests/growablebytebuffer/CMakeLists.txt b/vespalib/src/tests/growablebytebuffer/CMakeLists.txt
index be3ba82594d..0448eedd488 100644
--- a/vespalib/src/tests/growablebytebuffer/CMakeLists.txt
+++ b/vespalib/src/tests/growablebytebuffer/CMakeLists.txt
@@ -4,5 +4,6 @@ vespa_add_executable(vespalib_growablebytebuffer_test_app TEST
growablebytebuffer_test.cpp
DEPENDS
vespalib
+ GTest::gtest
)
vespa_add_test(NAME vespalib_growablebytebuffer_test_app COMMAND vespalib_growablebytebuffer_test_app)
diff --git a/vespalib/src/tests/growablebytebuffer/growablebytebuffer_test.cpp b/vespalib/src/tests/growablebytebuffer/growablebytebuffer_test.cpp
index a94a150c4e1..00cc77d19cb 100644
--- a/vespalib/src/tests/growablebytebuffer/growablebytebuffer_test.cpp
+++ b/vespalib/src/tests/growablebytebuffer/growablebytebuffer_test.cpp
@@ -1,19 +1,11 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/vespalib/gtest/gtest.h>
#include <vespa/vespalib/util/growablebytebuffer.h>
using namespace vespalib;
-class Test : public TestApp
-{
-public:
- void testGrowing();
- int Main() override;
-};
-
-void
-Test::testGrowing()
+TEST(GrowableByteBufferTest, test_growing)
{
GrowableByteBuffer buf(10);
@@ -23,15 +15,7 @@ Test::testGrowing()
buf.putDouble(1234);
buf.putString("hei der");
- EXPECT_EQUAL(35u, buf.position());
-}
-
-int
-Test::Main()
-{
- TEST_INIT("guard_test");
- testGrowing();
- TEST_DONE();
+ EXPECT_EQ(35u, buf.position());
}
-TEST_APPHOOK(Test)
+GTEST_MAIN_RUN_ALL_TESTS()