Bitcoin Core 32.1.0
P2P Digital Currency
Loading...
Searching...
No Matches
util_tests.cpp File Reference
#include <clientversion.h>
#include <common/signmessage.h>
#include <compat/compat.h>
#include <hash.h>
#include <key.h>
#include <script/parsing.h>
#include <span.h>
#include <sync.h>
#include <test/util/common.h>
#include <test/util/random.h>
#include <test/util/setup_common.h>
#include <test/util/time.h>
#include <uint256.h>
#include <univalue.h>
#include <util/bitdeque.h>
#include <util/byte_units.h>
#include <util/fs.h>
#include <util/fs_helpers.h>
#include <util/moneystr.h>
#include <util/overflow.h>
#include <util/readwritefile.h>
#include <util/strencodings.h>
#include <util/string.h>
#include <util/tokenbucket.h>
#include <util/vector.h>
#include <array>
#include <cmath>
#include <cstdint>
#include <cstring>
#include <fstream>
#include <limits>
#include <map>
#include <optional>
#include <string>
#include <thread>
#include <type_traits>
#include <utility>
#include <vector>
#include <sys/types.h>
#include <sys/wait.h>
#include <boost/test/unit_test.hpp>
Include dependency graph for util_tests.cpp:

Go to the source code of this file.

Namespaces

namespace  BCLog

Concepts

concept  BraceInitializesTo

Macros

#define B   "check_prefix"
#define E   "check_postfix"

Enumerations

enum  : char { ResSuccess = 2 , ResErrorWrite , ResErrorLock , ResUnlockSuccess }

Functions

std::string BCLog::LogEscapeMessage (std::string_view str)
 Belts and suspenders: make sure outgoing log messages don't contain potentially suspicious characters, such as terminal control codes.
 BOOST_AUTO_TEST_CASE (util_check)
 BOOST_AUTO_TEST_CASE (util_criticalsection)
 BOOST_AUTO_TEST_CASE (parse_hex)
 BOOST_AUTO_TEST_CASE (consteval_hex_digit)
 BOOST_AUTO_TEST_CASE (util_HexStr)
 BOOST_AUTO_TEST_CASE (span_write_bytes)
 BOOST_AUTO_TEST_CASE (util_Join)
 BOOST_AUTO_TEST_CASE (util_ReplaceAll)
 BOOST_AUTO_TEST_CASE (util_TrimString)
 BOOST_AUTO_TEST_CASE (util_ParseISO8601DateTime)
 BOOST_AUTO_TEST_CASE (util_FormatISO8601DateTime)
 BOOST_AUTO_TEST_CASE (util_FormatISO8601Date)
 BOOST_AUTO_TEST_CASE (util_FormatRFC1123DateTime)
 BOOST_AUTO_TEST_CASE (util_FormatMoney)
 BOOST_AUTO_TEST_CASE (util_ParseMoney)
 BOOST_AUTO_TEST_CASE (util_IsHex)
 BOOST_AUTO_TEST_CASE (util_seed_insecure_rand)
 BOOST_AUTO_TEST_CASE (util_TimingResistantEqual)
 BOOST_AUTO_TEST_CASE (strprintf_numbers)
 BOOST_AUTO_TEST_CASE (util_mocktime)
 BOOST_AUTO_TEST_CASE (util_ticksseconds)
 BOOST_AUTO_TEST_CASE (test_IsDigit)
template<typename T>
static void TestAddMatrixOverflow ()
template<typename T>
static void TestAddMatrix ()
 BOOST_AUTO_TEST_CASE (util_overflow)
template<typename T>
static void RunToIntegralTests ()
 BOOST_AUTO_TEST_CASE (test_ToIntegral)
int64_t atoi64_legacy (const std::string &str)
 BOOST_AUTO_TEST_CASE (test_LocaleIndependentAtoi)
 BOOST_AUTO_TEST_CASE (test_ToIntegralHex)
 BOOST_AUTO_TEST_CASE (test_FormatParagraph)
 BOOST_AUTO_TEST_CASE (test_FormatSubVersion)
 BOOST_AUTO_TEST_CASE (test_ParseFixedPoint)
static void TestOtherProcess (fs::path dirname, fs::path lockname, int fd)
 BOOST_AUTO_TEST_CASE (test_LockDirectory)
 BOOST_AUTO_TEST_CASE (test_ToLower)
 BOOST_AUTO_TEST_CASE (test_ToUpper)
 BOOST_AUTO_TEST_CASE (test_Capitalize)
static std::string SpanToStr (const std::span< const char > &span)
 BOOST_AUTO_TEST_CASE (test_script_parsing)
 BOOST_AUTO_TEST_CASE (test_SplitString)
 BOOST_AUTO_TEST_CASE (test_LogEscapeMessage)
 BOOST_AUTO_TEST_CASE (test_tracked_vector)
 BOOST_AUTO_TEST_CASE (message_sign)
 BOOST_AUTO_TEST_CASE (message_verify)
 BOOST_AUTO_TEST_CASE (message_hash)
 BOOST_AUTO_TEST_CASE (remove_prefix)
 BOOST_AUTO_TEST_CASE (util_ParseByteUnits)
 BOOST_AUTO_TEST_CASE (util_ReadBinaryFile)
 BOOST_AUTO_TEST_CASE (util_WriteBinaryFile)
 BOOST_AUTO_TEST_CASE (clearshrink_test)
template<typename T>
void TestCheckedLeftShift ()
template<typename T>
void TestSaturatingLeftShift ()
 BOOST_AUTO_TEST_CASE (checked_left_shift_test)
 BOOST_AUTO_TEST_CASE (saturating_left_shift_test)
 BOOST_AUTO_TEST_CASE (mib_string_literal_test)
 BOOST_AUTO_TEST_CASE (ceil_div_test)
 BOOST_AUTO_TEST_CASE (gib_string_literal_test)
 BOOST_AUTO_TEST_CASE (token_bucket_initial_value)
 BOOST_AUTO_TEST_CASE (token_bucket_first_increment)
 BOOST_AUTO_TEST_CASE (token_bucket_refill_caps)
 BOOST_AUTO_TEST_CASE (token_bucket_time_backwards)
 BOOST_AUTO_TEST_CASE (token_bucket_decrement_no_debt)
 BOOST_AUTO_TEST_CASE (token_bucket_decrement_with_debt)
 BOOST_AUTO_TEST_CASE (token_bucket_drain_and_refill)
 BOOST_AUTO_TEST_CASE (token_bucket_first_increment_at_epoch)
 BOOST_AUTO_TEST_CASE (token_bucket_at_cap_advances_baseline)
 BOOST_AUTO_TEST_CASE (token_bucket_fractional_refill)
 BOOST_AUTO_TEST_CASE (token_bucket_refill_from_debt)
consteval uint8_t ConstevalHexDigit (const char c)
 consteval version of HexDigit() without the lookup table.
template<typename C, typename S, typename UnaryOp>
auto Join (const C &container, const S &separator, UnaryOp unary_op)
 Join all container items.
std::string RemovePrefix (std::string_view str, std::string_view prefix)
std::string_view RemovePrefixView (std::string_view str LIFETIMEBOUND, std::string_view prefix)
void ReplaceAll (std::string &in_out, std::string_view search, std::string_view substitute)
 Replace every non-overlapping occurrence of search with substitute, treating both literally; the replacement text is not searched again.
std::vector< std::string > SplitString (std::string_view str, char sep)
std::string TrimString (std::string_view str, std::string_view pattern=" \f\n\r\t\v")
std::string_view TrimStringView (std::string_view str LIFETIMEBOUND, std::string_view pattern=" \f\n\r\t\v")

Variables

static const std::string STRING_WITH_EMBEDDED_NULL_CHAR {"1"s "\0" "1"s}
constexpr char HEX_PARSE_INPUT [] = "04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f"
constexpr uint8_t HEX_PARSE_OUTPUT []
static constexpr char LockCommand = 'L'
static constexpr char UnlockCommand = 'U'
static constexpr char ExitCommand = 'X'

Macro Definition Documentation

◆ B

#define B   "check_prefix"

Definition at line 568 of file util_tests.cpp.

◆ E

#define E   "check_postfix"

Definition at line 569 of file util_tests.cpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum : char
Enumerator
ResSuccess 
ResErrorWrite 
ResErrorLock 
ResUnlockSuccess 

Definition at line 1018 of file util_tests.cpp.

Function Documentation

◆ atoi64_legacy()

int64_t atoi64_legacy ( const std::string & str)

Definition at line 773 of file util_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ BOOST_AUTO_TEST_CASE() [1/61]

BOOST_AUTO_TEST_CASE ( ceil_div_test )

Definition at line 1869 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [2/61]

BOOST_AUTO_TEST_CASE ( checked_left_shift_test )

Definition at line 1817 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [3/61]

BOOST_AUTO_TEST_CASE ( clearshrink_test )

Definition at line 1723 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [4/61]

BOOST_AUTO_TEST_CASE ( consteval_hex_digit )

Definition at line 233 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [5/61]

BOOST_AUTO_TEST_CASE ( gib_string_literal_test )

Definition at line 1906 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [6/61]

BOOST_AUTO_TEST_CASE ( message_hash )

Definition at line 1599 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [7/61]

BOOST_AUTO_TEST_CASE ( message_sign )

Definition at line 1511 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [8/61]

BOOST_AUTO_TEST_CASE ( message_verify )

Definition at line 1547 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [9/61]

BOOST_AUTO_TEST_CASE ( mib_string_literal_test )

Definition at line 1838 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [10/61]

BOOST_AUTO_TEST_CASE ( parse_hex )

Definition at line 157 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [11/61]

BOOST_AUTO_TEST_CASE ( remove_prefix )

Definition at line 1616 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [12/61]

BOOST_AUTO_TEST_CASE ( saturating_left_shift_test )

Definition at line 1826 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [13/61]

BOOST_AUTO_TEST_CASE ( span_write_bytes )

Definition at line 277 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [14/61]

BOOST_AUTO_TEST_CASE ( strprintf_numbers )

Definition at line 570 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [15/61]

BOOST_AUTO_TEST_CASE ( test_Capitalize )

Definition at line 1178 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [16/61]

BOOST_AUTO_TEST_CASE ( test_FormatParagraph )

Definition at line 901 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [17/61]

BOOST_AUTO_TEST_CASE ( test_FormatSubVersion )

Definition at line 928 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [18/61]

BOOST_AUTO_TEST_CASE ( test_IsDigit )

Definition at line 619 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [19/61]

BOOST_AUTO_TEST_CASE ( test_LocaleIndependentAtoi )

Definition at line 778 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [20/61]

BOOST_AUTO_TEST_CASE ( test_LockDirectory )

Definition at line 1060 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [21/61]

BOOST_AUTO_TEST_CASE ( test_LogEscapeMessage )

Definition at line 1397 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [22/61]

BOOST_AUTO_TEST_CASE ( test_ParseFixedPoint )

Definition at line 940 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [23/61]

BOOST_AUTO_TEST_CASE ( test_script_parsing )

Definition at line 1190 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [24/61]

BOOST_AUTO_TEST_CASE ( test_SplitString )

Definition at line 1335 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [25/61]

BOOST_AUTO_TEST_CASE ( test_ToIntegral )

Definition at line 711 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [26/61]

BOOST_AUTO_TEST_CASE ( test_ToIntegralHex )

Definition at line 869 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [27/61]

BOOST_AUTO_TEST_CASE ( test_ToLower )

Definition at line 1150 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [28/61]

BOOST_AUTO_TEST_CASE ( test_ToUpper )

Definition at line 1164 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [29/61]

BOOST_AUTO_TEST_CASE ( test_tracked_vector )

Definition at line 1434 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [30/61]

BOOST_AUTO_TEST_CASE ( token_bucket_at_cap_advances_baseline )

Definition at line 2024 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [31/61]

BOOST_AUTO_TEST_CASE ( token_bucket_decrement_no_debt )

Definition at line 1978 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [32/61]

BOOST_AUTO_TEST_CASE ( token_bucket_decrement_with_debt )

Definition at line 1990 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [33/61]

BOOST_AUTO_TEST_CASE ( token_bucket_drain_and_refill )

Definition at line 2001 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [34/61]

BOOST_AUTO_TEST_CASE ( token_bucket_first_increment )

Definition at line 1948 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [35/61]

BOOST_AUTO_TEST_CASE ( token_bucket_first_increment_at_epoch )

Definition at line 2013 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [36/61]

BOOST_AUTO_TEST_CASE ( token_bucket_fractional_refill )

Definition at line 2045 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [37/61]

BOOST_AUTO_TEST_CASE ( token_bucket_initial_value )

Definition at line 1937 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [38/61]

BOOST_AUTO_TEST_CASE ( token_bucket_refill_caps )

Definition at line 1960 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [39/61]

BOOST_AUTO_TEST_CASE ( token_bucket_refill_from_debt )

Definition at line 2054 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [40/61]

BOOST_AUTO_TEST_CASE ( token_bucket_time_backwards )

Definition at line 1968 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [41/61]

BOOST_AUTO_TEST_CASE ( util_check )

Definition at line 100 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [42/61]

BOOST_AUTO_TEST_CASE ( util_criticalsection )

Definition at line 126 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [43/61]

BOOST_AUTO_TEST_CASE ( util_FormatISO8601Date )

Definition at line 387 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [44/61]

BOOST_AUTO_TEST_CASE ( util_FormatISO8601DateTime )

Definition at line 373 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [45/61]

BOOST_AUTO_TEST_CASE ( util_FormatMoney )

Definition at line 411 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [46/61]

BOOST_AUTO_TEST_CASE ( util_FormatRFC1123DateTime )

Definition at line 397 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [47/61]

BOOST_AUTO_TEST_CASE ( util_HexStr )

Definition at line 241 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [48/61]

BOOST_AUTO_TEST_CASE ( util_IsHex )

Definition at line 515 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [49/61]

BOOST_AUTO_TEST_CASE ( util_Join )

Definition at line 286 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [50/61]

BOOST_AUTO_TEST_CASE ( util_mocktime )

Definition at line 593 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [51/61]

BOOST_AUTO_TEST_CASE ( util_overflow )

Definition at line 676 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [52/61]

BOOST_AUTO_TEST_CASE ( util_ParseByteUnits )

Definition at line 1629 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [53/61]

BOOST_AUTO_TEST_CASE ( util_ParseISO8601DateTime )

Definition at line 335 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [54/61]

BOOST_AUTO_TEST_CASE ( util_ParseMoney )

Definition at line 446 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [55/61]

BOOST_AUTO_TEST_CASE ( util_ReadBinaryFile )

Definition at line 1677 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [56/61]

BOOST_AUTO_TEST_CASE ( util_ReplaceAll )

Definition at line 300 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [57/61]

BOOST_AUTO_TEST_CASE ( util_seed_insecure_rand )

Definition at line 530 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [58/61]

BOOST_AUTO_TEST_CASE ( util_ticksseconds )

Definition at line 610 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [59/61]

BOOST_AUTO_TEST_CASE ( util_TimingResistantEqual )

Definition at line 555 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [60/61]

BOOST_AUTO_TEST_CASE ( util_TrimString )

Definition at line 319 of file util_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [61/61]

BOOST_AUTO_TEST_CASE ( util_WriteBinaryFile )

Definition at line 1710 of file util_tests.cpp.

Here is the call graph for this function:

◆ ConstevalHexDigit()

uint8_t util::ConstevalHexDigit ( const char c)
consteval

consteval version of HexDigit() without the lookup table.

Definition at line 331 of file strencodings.h.

Here is the caller graph for this function:

◆ Join()

template<typename C, typename S, typename UnaryOp>
auto util::Join ( const C & container,
const S & separator,
UnaryOp unary_op )

Join all container items.

Typically used to concatenate strings but accepts containers with elements of any type.

Parameters
containerThe items to join
separatorThe separator
unary_opApply this operator to each item

Definition at line 209 of file string.h.

◆ RemovePrefix()

std::string util::RemovePrefix ( std::string_view str,
std::string_view prefix )
inlinenodiscard

Definition at line 194 of file string.h.

◆ RemovePrefixView()

std::string_view util::RemovePrefixView ( std::string_view str LIFETIMEBOUND,
std::string_view prefix )
inlinenodiscard

Definition at line 186 of file string.h.

◆ ReplaceAll()

void util::ReplaceAll ( std::string & in_out,
std::string_view search,
std::string_view substitute )

Replace every non-overlapping occurrence of search with substitute, treating both literally; the replacement text is not searched again.

Definition at line 14 of file string.cpp.

◆ RunToIntegralTests()

template<typename T>
void RunToIntegralTests ( )
static

Definition at line 683 of file util_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SpanToStr()

std::string SpanToStr ( const std::span< const char > & span)
static

Definition at line 1185 of file util_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SplitString()

std::vector< std::string > util::SplitString ( std::string_view str,
char sep )
inlinenodiscard

Definition at line 153 of file string.h.

◆ TestAddMatrix()

template<typename T>
void TestAddMatrix ( )
static

Definition at line 656 of file util_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TestAddMatrixOverflow()

template<typename T>
void TestAddMatrixOverflow ( )
static

Definition at line 636 of file util_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TestCheckedLeftShift()

template<typename T>
void TestCheckedLeftShift ( )

Definition at line 1748 of file util_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TestOtherProcess()

void TestOtherProcess ( fs::path dirname,
fs::path lockname,
int fd )
static

Definition at line 1025 of file util_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TestSaturatingLeftShift()

template<typename T>
void TestSaturatingLeftShift ( )

Definition at line 1783 of file util_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TrimString()

std::string util::TrimString ( std::string_view str,
std::string_view pattern = " \f\n\r\t\v" )
inlinenodiscard

Definition at line 173 of file string.h.

◆ TrimStringView()

std::string_view util::TrimStringView ( std::string_view str LIFETIMEBOUND,
std::string_view pattern = " \f\n\r\t\v" )
inlinenodiscard

Definition at line 163 of file string.h.

Variable Documentation

◆ ExitCommand

char ExitCommand = 'X'
staticconstexpr

Definition at line 1017 of file util_tests.cpp.

◆ HEX_PARSE_INPUT

char HEX_PARSE_INPUT[] = "04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f"
constexpr

Definition at line 148 of file util_tests.cpp.

◆ HEX_PARSE_OUTPUT

uint8_t HEX_PARSE_OUTPUT[]
constexpr
Initial value:
= {
0x04, 0x67, 0x8a, 0xfd, 0xb0, 0xfe, 0x55, 0x48, 0x27, 0x19, 0x67, 0xf1, 0xa6, 0x71, 0x30, 0xb7,
0x10, 0x5c, 0xd6, 0xa8, 0x28, 0xe0, 0x39, 0x09, 0xa6, 0x79, 0x62, 0xe0, 0xea, 0x1f, 0x61, 0xde,
0xb6, 0x49, 0xf6, 0xbc, 0x3f, 0x4c, 0xef, 0x38, 0xc4, 0xf3, 0x55, 0x04, 0xe5, 0x1e, 0xc1, 0x12,
0xde, 0x5c, 0x38, 0x4d, 0xf7, 0xba, 0x0b, 0x8d, 0x57, 0x8a, 0x4c, 0x70, 0x2b, 0x6b, 0xf1, 0x1d,
0x5f
}

Definition at line 149 of file util_tests.cpp.

◆ LockCommand

char LockCommand = 'L'
staticconstexpr

Definition at line 1015 of file util_tests.cpp.

◆ STRING_WITH_EMBEDDED_NULL_CHAR

const std::string STRING_WITH_EMBEDDED_NULL_CHAR {"1"s "\0" "1"s}
static

Definition at line 66 of file util_tests.cpp.

◆ UnlockCommand

char UnlockCommand = 'U'
staticconstexpr

Definition at line 1016 of file util_tests.cpp.