Monero
Loading...
Searching...
No Matches
epee_utils.cpp File Reference
#include <array>
#include <boost/predef/other/endian.h>
#include <boost/endian/conversion.hpp>
#include <boost/range/algorithm/equal.hpp>
#include <boost/range/algorithm_ext/iota.hpp>
#include <boost/range/iterator_range.hpp>
#include <cstdint>
#include <gtest/gtest.h>
#include <iomanip>
#include <iterator>
#include <string>
#include <sstream>
#include <vector>
#include <arpa/inet.h>
#include "boost/archive/portable_binary_iarchive.hpp"
#include "boost/archive/portable_binary_oarchive.hpp"
#include "byte_slice.h"
#include "byte_stream.h"
#include "crypto/crypto.h"
#include "hex.h"
#include "net/net_utils_base.h"
#include "net/local_ip.h"
#include "net/buffer.h"
#include "p2p/net_peerlist_boost_serialization.h"
#include "span.h"
#include "string_tools.h"
#include "storages/parserse_base_utils.h"
Include dependency graph for epee_utils.cpp:

Macros

#define CHECK_EQUAL(lhs, rhs)
#define CHECK_LESS(lhs, rhs)
#define CHECK_LESS_ENDIAN(lhs, rhs)

Functions

 TEST (Span, Traits)
 TEST (Span, MutableConstruction)
 TEST (Span, ImmutableConstruction)
 TEST (Span, NoExcept)
 TEST (Span, Nullptr)
 TEST (Span, Writing)
 TEST (Span, RemovePrefix)
 TEST (Span, ToByteSpan)
 TEST (Span, AsByteSpan)
 TEST (Span, AsMutByteSpan)
 TEST (Span, ToMutSpan)
 TEST (ByteSlice, Construction)
 TEST (ByteSlice, DataReturnedMatches)
 TEST (ByteSlice, NoExcept)
 TEST (ByteSlice, Empty)
 TEST (ByteSlice, CopySpans)
 TEST (ByteSlice, AdaptString)
 TEST (ByteSlice, EmptyAdaptString)
 TEST (ByteSlice, AdaptVector)
 TEST (ByteSlice, EmptyAdaptVector)
 TEST (ByteSlice, Move)
 TEST (ByteSlice, Clone)
 TEST (ByteSlice, RemovePrefix)
 TEST (ByteSlice, TakeSlice)
 TEST (ByteSlice, GetSlice)
 TEST (ByteStream, Construction)
 TEST (ByteStream, Noexcept)
 TEST (ByteStream, Empty)
 TEST (ByteStream, Write)
 TEST (ByteStream, Put)
 TEST (ByteStream, PutN)
 TEST (ByteStream, Reserve)
 TEST (ByteStream, TakeBuffer)
 TEST (ByteStream, Move)
 TEST (ByteStream, ToByteSlice)
 TEST (ByteStream, Clear)
 TEST (ToHex, String)
 TEST (HexLocale, String)
 TEST (ToHex, Array)
 TEST (ToHex, ArrayFromPod)
 TEST (ToHex, Ostream)
 TEST (ToHex, Formatted)
 TEST (FromHex, ToString)
 TEST (FromHex, ToBuffer)
 TEST (StringTools, BuffToHex)
 TEST (StringTools, PodToHex)
 TEST (StringTools, ParseHex)
 TEST (StringTools, ParseNotHex)
 TEST (StringTools, GetIpString)
 TEST (StringTools, GetIpInt32)
 TEST (StringTools, GetExtension)
 TEST (StringTools, CutOffExtension)
 TEST (NetUtils, IPv4NetworkAddress)
 TEST (NetUtils, NetworkAddress)
static bool is_local (const char *s)
 TEST (NetUtils, PrivateRanges)
 TEST (net_buffer, basic)
 TEST (net_buffer, existing_capacity)
 TEST (net_buffer, reallocate)
 TEST (net_buffer, move)
 TEST (parsing, isspace)
 TEST (parsing, isdigit)
 TEST (parsing, number)
 TEST (parsing, unicode)
 TEST (parsing, strtoul)

Macro Definition Documentation

◆ CHECK_EQUAL

#define CHECK_EQUAL ( lhs,
rhs )
Value:
EXPECT_TRUE( lhs == rhs ); \
EXPECT_TRUE( rhs == lhs ); \
EXPECT_FALSE( lhs != rhs ); \
EXPECT_FALSE( rhs != lhs ); \
EXPECT_FALSE( lhs < rhs ); \
EXPECT_FALSE( rhs < lhs ); \
EXPECT_TRUE( lhs <= rhs ); \
EXPECT_TRUE( rhs <= lhs ); \
EXPECT_FALSE( lhs > rhs ); \
EXPECT_FALSE( rhs > lhs ); \
EXPECT_TRUE( lhs >= rhs ); \
EXPECT_TRUE( rhs >= lhs )
#define EXPECT_TRUE(condition)
Definition gtest.h:1859

◆ CHECK_LESS

#define CHECK_LESS ( lhs,
rhs )
Value:
EXPECT_FALSE( lhs == rhs ); \
EXPECT_FALSE( rhs == lhs ); \
EXPECT_TRUE( lhs != rhs ); \
EXPECT_TRUE( rhs != lhs ); \
EXPECT_TRUE( lhs < rhs ); \
EXPECT_FALSE( rhs < lhs ); \
EXPECT_TRUE( lhs <= rhs ); \
EXPECT_FALSE( rhs <= lhs ); \
EXPECT_FALSE( lhs > rhs ); \
EXPECT_TRUE( rhs > lhs ); \
EXPECT_FALSE( lhs >= rhs ); \
EXPECT_TRUE( rhs >= lhs )
#define EXPECT_FALSE(condition)
Definition gtest.h:1862

◆ CHECK_LESS_ENDIAN

#define CHECK_LESS_ENDIAN ( lhs,
rhs )
Value:
CHECK_LESS( lhs , rhs )
#define CHECK_LESS(lhs, rhs)
Definition epee_utils.cpp:130

Function Documentation

◆ is_local()

bool is_local ( const char * s)
static

◆ TEST() [1/64]

TEST ( ByteSlice ,
AdaptString  )

◆ TEST() [2/64]

TEST ( ByteSlice ,
AdaptVector  )

◆ TEST() [3/64]

TEST ( ByteSlice ,
Clone  )

◆ TEST() [4/64]

TEST ( ByteSlice ,
Construction  )

◆ TEST() [5/64]

TEST ( ByteSlice ,
CopySpans  )

◆ TEST() [6/64]

TEST ( ByteSlice ,
DataReturnedMatches  )

◆ TEST() [7/64]

TEST ( ByteSlice ,
Empty  )

◆ TEST() [8/64]

TEST ( ByteSlice ,
EmptyAdaptString  )

◆ TEST() [9/64]

TEST ( ByteSlice ,
EmptyAdaptVector  )

◆ TEST() [10/64]

TEST ( ByteSlice ,
GetSlice  )

◆ TEST() [11/64]

TEST ( ByteSlice ,
Move  )

◆ TEST() [12/64]

TEST ( ByteSlice ,
NoExcept  )

◆ TEST() [13/64]

TEST ( ByteSlice ,
RemovePrefix  )

◆ TEST() [14/64]

TEST ( ByteSlice ,
TakeSlice  )

◆ TEST() [15/64]

TEST ( ByteStream ,
Clear  )

◆ TEST() [16/64]

TEST ( ByteStream ,
Construction  )

◆ TEST() [17/64]

TEST ( ByteStream ,
Empty  )

◆ TEST() [18/64]

TEST ( ByteStream ,
Move  )

◆ TEST() [19/64]

TEST ( ByteStream ,
Noexcept  )

◆ TEST() [20/64]

TEST ( ByteStream ,
Put  )

◆ TEST() [21/64]

TEST ( ByteStream ,
PutN  )

◆ TEST() [22/64]

TEST ( ByteStream ,
Reserve  )

◆ TEST() [23/64]

TEST ( ByteStream ,
TakeBuffer  )

◆ TEST() [24/64]

TEST ( ByteStream ,
ToByteSlice  )

◆ TEST() [25/64]

TEST ( ByteStream ,
Write  )

◆ TEST() [26/64]

TEST ( FromHex ,
ToBuffer  )

◆ TEST() [27/64]

TEST ( FromHex ,
ToString  )

◆ TEST() [28/64]

TEST ( HexLocale ,
String  )

◆ TEST() [29/64]

TEST ( net_buffer ,
basic  )

◆ TEST() [30/64]

TEST ( net_buffer ,
existing_capacity  )

◆ TEST() [31/64]

TEST ( net_buffer ,
move  )

◆ TEST() [32/64]

TEST ( net_buffer ,
reallocate  )

◆ TEST() [33/64]

TEST ( NetUtils ,
IPv4NetworkAddress  )

◆ TEST() [34/64]

TEST ( NetUtils ,
NetworkAddress  )

◆ TEST() [35/64]

TEST ( NetUtils ,
PrivateRanges  )

◆ TEST() [36/64]

TEST ( parsing ,
isdigit  )

◆ TEST() [37/64]

TEST ( parsing ,
isspace  )

◆ TEST() [38/64]

TEST ( parsing ,
number  )

◆ TEST() [39/64]

TEST ( parsing ,
strtoul  )

◆ TEST() [40/64]

TEST ( parsing ,
unicode  )

◆ TEST() [41/64]

TEST ( Span ,
AsByteSpan  )

◆ TEST() [42/64]

TEST ( Span ,
AsMutByteSpan  )

◆ TEST() [43/64]

TEST ( Span ,
ImmutableConstruction  )

◆ TEST() [44/64]

TEST ( Span ,
MutableConstruction  )

◆ TEST() [45/64]

TEST ( Span ,
NoExcept  )

◆ TEST() [46/64]

TEST ( Span ,
Nullptr  )

◆ TEST() [47/64]

TEST ( Span ,
RemovePrefix  )

◆ TEST() [48/64]

TEST ( Span ,
ToByteSpan  )

◆ TEST() [49/64]

TEST ( Span ,
ToMutSpan  )

◆ TEST() [50/64]

TEST ( Span ,
Traits  )

◆ TEST() [51/64]

TEST ( Span ,
Writing  )

◆ TEST() [52/64]

TEST ( StringTools ,
BuffToHex  )

◆ TEST() [53/64]

TEST ( StringTools ,
CutOffExtension  )

◆ TEST() [54/64]

TEST ( StringTools ,
GetExtension  )

◆ TEST() [55/64]

TEST ( StringTools ,
GetIpInt32  )

◆ TEST() [56/64]

TEST ( StringTools ,
GetIpString  )

◆ TEST() [57/64]

TEST ( StringTools ,
ParseHex  )

◆ TEST() [58/64]

TEST ( StringTools ,
ParseNotHex  )

◆ TEST() [59/64]

TEST ( StringTools ,
PodToHex  )

◆ TEST() [60/64]

TEST ( ToHex ,
Array  )

◆ TEST() [61/64]

TEST ( ToHex ,
ArrayFromPod  )

◆ TEST() [62/64]

TEST ( ToHex ,
Formatted  )

◆ TEST() [63/64]

TEST ( ToHex ,
Ostream  )

◆ TEST() [64/64]

TEST ( ToHex ,
String  )