LCOV - code coverage report
Current view: top level - test/lib - libTest.cpp (source / functions) Coverage Total Hit
Test: lcovResult Lines: 100.0 % 6 6
Test Date: 2024-10-23 20:19:12 Functions: 100.0 % 4 4
Branches: 50.0 % 2 1

             Branch data     Line data    Source code
       1                 :             : /** @file
       2                 :             :  * @brief Unit tests for Lib.
       3                 :             :  *
       4                 :             :  * It contains unit tests to test the Lib.
       5                 :             :  */
       6                 :             : 
       7                 :             : #include "gtest/gtest.h"
       8                 :             : #include "lib/lib.hpp"
       9                 :             : 
      10                 :             : #include <string>
      11                 :             : 
      12                 :             : /** @test
      13                 :             :  * @brief Test returning with expected string.
      14                 :             :  *
      15                 :             :  * It tests if Lib::createUpperString function returns with the expected (HELLO
      16                 :             :  *  LIBWORLD!) string.
      17                 :             :  */
      18                 :           4 : TEST(LibTestSuite, testCreateUpperString_ReturnExpectedString) {
      19                 :             :   // GIVEN
      20                 :           1 :   const lib::Lib lib;
      21                 :             :   // Silence since the default parameter was declared in std::basic_string
      22                 :             :   // NOLINTNEXTLINE(fuchsia-default-arguments-calls)
      23                 :           1 :   const std::string inputString{"Hello LibWorld!"};
      24                 :             : 
      25                 :             :   // WHEN
      26                 :           1 :   const std::string outputString{lib.createUpperString(inputString)};
      27                 :             : 
      28                 :             :   // THEN
      29         [ -  + ]:           1 :   EXPECT_STREQ(outputString.c_str(), "HELLO LIBWORLD!");
      30                 :           1 : }
        

Generated by: LCOV version 2.0-1