diff options
author | Tor Egge <Tor.Egge@online.no> | 2024-03-08 13:22:43 +0100 |
---|---|---|
committer | Tor Egge <Tor.Egge@online.no> | 2024-03-08 13:22:43 +0100 |
commit | 301969ec68da7355fc0bd569d7c49c9df6927e48 (patch) | |
tree | 02e341a296b6494980082d69b4a262804563e0f5 /vespalib | |
parent | 3ede5019a6fe0881917b165166f413c532fe4bc0 (diff) |
Rewrite GroableByteBuffer unit test to gtest.
Diffstat (limited to 'vespalib')
-rw-r--r-- | vespalib/src/tests/growablebytebuffer/CMakeLists.txt | 1 | ||||
-rw-r--r-- | vespalib/src/tests/growablebytebuffer/growablebytebuffer_test.cpp | 24 |
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() |