LCOV - code coverage report
Current view: top level - src/test - translation_tests.cpp (source / functions) Coverage Total Hit
Test: test_bitcoin_coverage.info Lines: 100.0 % 7 7
Test Date: 2024-08-28 04:44:32 Functions: 100.0 % 2 2
Branches: 50.0 % 70 35

             Branch data     Line data    Source code
       1                 :             : // Copyright (c) 2023 The Bitcoin Core developers
       2                 :             : // Distributed under the MIT software license, see the accompanying
       3                 :             : // file COPYING or http://www.opensource.org/licenses/mit-license.php.
       4                 :             : 
       5                 :             : #include <tinyformat.h>
       6                 :             : #include <util/translation.h>
       7                 :             : 
       8                 :             : #include <boost/test/unit_test.hpp>
       9                 :             : 
      10                 :             : BOOST_AUTO_TEST_SUITE(translation_tests)
      11                 :             : 
      12   [ +  -  +  -  :           7 : BOOST_AUTO_TEST_CASE(translation_namedparams)
          +  -  +  -  +  
          -  +  -  +  -  
          +  -  +  -  +  
          -  +  -  +  -  
          +  -  +  -  +  
          -  +  -  +  -  
          +  -  +  -  +  
          -  +  -  +  -  
          +  -  +  -  +  
                      - ]
      13                 :             : {
      14   [ +  -  +  - ]:           1 :     bilingual_str arg{"original", "translated"};
      15   [ +  -  +  -  :           1 :     bilingual_str format{"original [%s]", "translated [%s]"};
                   +  - ]
      16         [ +  - ]:           1 :     bilingual_str result{strprintf(format, arg)};
      17   [ +  -  +  - ]:           1 :     BOOST_CHECK_EQUAL(result.original, "original [original]");
      18   [ +  -  +  - ]:           1 :     BOOST_CHECK_EQUAL(result.translated, "translated [translated]");
      19                 :           3 : }
      20                 :             : 
      21                 :             : BOOST_AUTO_TEST_SUITE_END()
        

Generated by: LCOV version 2.0-1