Bitcoin Core
28.99.0
P2P Digital Currency
src
test
translation_tests.cpp
Go to the documentation of this file.
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
BOOST_AUTO_TEST_CASE
(translation_namedparams)
13
{
14
bilingual_str
arg{
"original"
,
"translated"
};
15
bilingual_str
format
{
"original [%s]"
,
"translated [%s]"
};
16
bilingual_str
result{
strprintf
(
format
, arg)};
17
BOOST_CHECK_EQUAL
(result.original,
"original [original]"
);
18
BOOST_CHECK_EQUAL
(result.translated,
"translated [translated]"
);
19
}
20
21
BOOST_AUTO_TEST_SUITE_END
()
BOOST_AUTO_TEST_SUITE_END
BOOST_AUTO_TEST_SUITE_END()
tinyformat::format
void format(std::ostream &out, FormatStringCheck< sizeof...(Args)> fmt, const Args &... args)
Format list of arguments to the stream according to given format string.
Definition:
tinyformat.h:1072
BOOST_CHECK_EQUAL
#define BOOST_CHECK_EQUAL(v1, v2)
Definition:
object.cpp:18
bilingual_str
Bilingual messages:
Definition:
translation.h:21
tinyformat.h
strprintf
#define strprintf
Format arguments and return the string or write to given std::ostream (see tinyformat::format doc for...
Definition:
tinyformat.h:1165
translation.h
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(translation_namedparams)
Definition:
translation_tests.cpp:12
Generated on Wed Dec 18 2024 20:00:14 for Bitcoin Core by
1.9.4