diff options
author | Jon Bratseth <bratseth@yahoo-inc.com> | 2016-06-15 23:09:44 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@yahoo-inc.com> | 2016-06-15 23:09:44 +0200 |
commit | 72231250ed81e10d66bfe70701e64fa5fe50f712 (patch) | |
tree | 2728bba1131a6f6e5bdf95afec7d7ff9358dac50 /staging_vespalib/src/tests/growablebytebuffer/growablebytebuffer_test.cpp |
Publish
Diffstat (limited to 'staging_vespalib/src/tests/growablebytebuffer/growablebytebuffer_test.cpp')
-rw-r--r-- | staging_vespalib/src/tests/growablebytebuffer/growablebytebuffer_test.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/staging_vespalib/src/tests/growablebytebuffer/growablebytebuffer_test.cpp b/staging_vespalib/src/tests/growablebytebuffer/growablebytebuffer_test.cpp new file mode 100644 index 00000000000..121f8d2e011 --- /dev/null +++ b/staging_vespalib/src/tests/growablebytebuffer/growablebytebuffer_test.cpp @@ -0,0 +1,39 @@ +// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include <vespa/fastos/fastos.h> +#include <vespa/log/log.h> +LOG_SETUP("guard_test"); +#include <vespa/vespalib/testkit/testapp.h> +#include <vespa/vespalib/util/growablebytebuffer.h> + +using namespace vespalib; + +class Test : public TestApp +{ +public: + void testGrowing(); + int Main(); +}; + +void +Test::testGrowing() +{ + GrowableByteBuffer buf(10); + + buf.putInt(3); + buf.putInt(7); + buf.putLong(1234); + buf.putDouble(1234); + buf.putString("hei der"); + + EXPECT_EQUAL(35u, buf.position()); +} + +int +Test::Main() +{ + TEST_INIT("guard_test"); + testGrowing(); + TEST_DONE(); +} + +TEST_APPHOOK(Test) |