LCOV - code coverage report
Current view: top level - tests - BStringTests.cpp (source / functions) Hit Total Coverage
Test: cpp-bencoding code coverage Lines: 15 15 100.0 %
Date: 2018-04-21 15:28:44 Functions: 16 17 94.1 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /**
       2             : * @file      BStringTests.cpp
       3             : * @copyright (c) 2014 by Petr Zemek (s3rvac@gmail.com) and contributors
       4             : * @license   BSD, see the @c LICENSE file for more details
       5             : * @brief     Tests for the BString class.
       6             : */
       7             : 
       8             : #include <gtest/gtest.h>
       9             : 
      10             : #include "BString.h"
      11             : 
      12             : namespace bencoding {
      13             : namespace tests {
      14             : 
      15             : using namespace testing;
      16             : 
      17           6 : class BStringTests: public Test {};
      18             : 
      19           5 : TEST_F(BStringTests,
      20             : ValueReturnsCorrectValueAfterCreation) {
      21           2 :     auto s = BString::create("test");
      22             : 
      23           1 :     EXPECT_EQ("test", s->value());
      24           1 : }
      25             : 
      26           5 : TEST_F(BStringTests,
      27             : ValueReturnsCorrectValueAfterSet) {
      28           2 :     auto s = BString::create("test");
      29           1 :     s->setValue("other");
      30             : 
      31           1 :     EXPECT_EQ("other", s->value());
      32           1 : }
      33             : 
      34           5 : TEST_F(BStringTests,
      35             : LengthReturnsCorrectValue) {
      36           2 :     auto s = BString::create("test");
      37             : 
      38           1 :     EXPECT_EQ(4, s->length());
      39           1 : }
      40             : 
      41             : } // namespace tests
      42           3 : } // namespace bencoding

Generated by: LCOV version 1.13