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

          Line data    Source code
       1             : /**
       2             : * @file      TestUtils.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     Implementation of the test utilities.
       6             : */
       7             : 
       8             : #include "TestUtils.h"
       9             : 
      10             : #include <ios>
      11             : 
      12             : namespace bencoding {
      13             : namespace tests {
      14             : 
      15             : /**
      16             : * @brief Puts @a stream into an error state.
      17             : */
      18           4 : void putIntoErrorState(std::istream &stream) {
      19           4 :     stream.setstate(std::ios::badbit);
      20           4 : }
      21             : 
      22             : /**
      23             : * @brief Puts @a stream into an EOF state.
      24             : */
      25           5 : void putIntoEOFState(std::istream &stream) {
      26           5 :     stream.setstate(std::ios::eofbit);
      27           5 : }
      28             : 
      29             : } // namespace tests
      30           3 : } // namespace bencoding

Generated by: LCOV version 1.13