Monero
Macros | Functions
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)   CHECK_LESS( 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 
)    CHECK_LESS( lhs , rhs )

Function Documentation

◆ is_local()

static bool is_local ( const char *  s)
static

◆ TEST() [1/64]

TEST ( Span  ,
Traits   
)

◆ TEST() [2/64]

TEST ( Span  ,
MutableConstruction   
)

◆ TEST() [3/64]

TEST ( Span  ,
ImmutableConstruction   
)

◆ TEST() [4/64]

TEST ( Span  ,
NoExcept   
)

◆ TEST() [5/64]

TEST ( Span  ,
Nullptr   
)

◆ TEST() [6/64]

TEST ( Span  ,
Writing   
)

◆ TEST() [7/64]

TEST ( Span  ,
RemovePrefix   
)

◆ TEST() [8/64]

TEST ( Span  ,
ToByteSpan   
)

◆ TEST() [9/64]

TEST ( Span  ,
AsByteSpan   
)

◆ TEST() [10/64]

TEST ( Span  ,
AsMutByteSpan   
)

◆ TEST() [11/64]

TEST ( Span  ,
ToMutSpan   
)

◆ TEST() [12/64]

TEST ( ByteSlice  ,
Construction   
)

◆ TEST() [13/64]

TEST ( ByteSlice  ,
DataReturnedMatches   
)

◆ TEST() [14/64]

TEST ( ByteSlice  ,
NoExcept   
)

◆ TEST() [15/64]

TEST ( ByteSlice  ,
Empty   
)

◆ TEST() [16/64]

TEST ( ByteSlice  ,
CopySpans   
)

◆ TEST() [17/64]

TEST ( ByteSlice  ,
AdaptString   
)

◆ TEST() [18/64]

TEST ( ByteSlice  ,
EmptyAdaptString   
)

◆ TEST() [19/64]

TEST ( ByteSlice  ,
AdaptVector   
)

◆ TEST() [20/64]

TEST ( ByteSlice  ,
EmptyAdaptVector   
)

◆ TEST() [21/64]

TEST ( ByteSlice  ,
Move   
)

◆ TEST() [22/64]

TEST ( ByteSlice  ,
Clone   
)

◆ TEST() [23/64]

TEST ( ByteSlice  ,
RemovePrefix   
)

◆ TEST() [24/64]

TEST ( ByteSlice  ,
TakeSlice   
)

◆ TEST() [25/64]

TEST ( ByteSlice  ,
GetSlice   
)

◆ TEST() [26/64]

TEST ( ByteStream  ,
Construction   
)

◆ TEST() [27/64]

TEST ( ByteStream  ,
Noexcept   
)

◆ TEST() [28/64]

TEST ( ByteStream  ,
Empty   
)

◆ TEST() [29/64]

TEST ( ByteStream  ,
Write   
)

◆ TEST() [30/64]

TEST ( ByteStream  ,
Put   
)

◆ TEST() [31/64]

TEST ( ByteStream  ,
PutN   
)

◆ TEST() [32/64]

TEST ( ByteStream  ,
Reserve   
)

◆ TEST() [33/64]

TEST ( ByteStream  ,
TakeBuffer   
)

◆ TEST() [34/64]

TEST ( ByteStream  ,
Move   
)

◆ TEST() [35/64]

TEST ( ByteStream  ,
ToByteSlice   
)

◆ TEST() [36/64]

TEST ( ByteStream  ,
Clear   
)

◆ TEST() [37/64]

TEST ( ToHex  ,
String   
)

◆ TEST() [38/64]

TEST ( HexLocale  ,
String   
)

◆ TEST() [39/64]

TEST ( ToHex  ,
Array   
)

◆ TEST() [40/64]

TEST ( ToHex  ,
ArrayFromPod   
)

◆ TEST() [41/64]

TEST ( ToHex  ,
Ostream   
)

◆ TEST() [42/64]

TEST ( ToHex  ,
Formatted   
)

◆ TEST() [43/64]

TEST ( FromHex  ,
ToString   
)

◆ TEST() [44/64]

TEST ( FromHex  ,
ToBuffer   
)

◆ TEST() [45/64]

TEST ( StringTools  ,
BuffToHex   
)

◆ TEST() [46/64]

TEST ( StringTools  ,
PodToHex   
)

◆ TEST() [47/64]

TEST ( StringTools  ,
ParseHex   
)

◆ TEST() [48/64]

TEST ( StringTools  ,
ParseNotHex   
)

◆ TEST() [49/64]

TEST ( StringTools  ,
GetIpString   
)

◆ TEST() [50/64]

TEST ( StringTools  ,
GetIpInt32   
)

◆ TEST() [51/64]

TEST ( StringTools  ,
GetExtension   
)

◆ TEST() [52/64]

TEST ( StringTools  ,
CutOffExtension   
)

◆ TEST() [53/64]

TEST ( NetUtils  ,
IPv4NetworkAddress   
)

◆ TEST() [54/64]

TEST ( NetUtils  ,
NetworkAddress   
)

◆ TEST() [55/64]

TEST ( NetUtils  ,
PrivateRanges   
)

◆ TEST() [56/64]

TEST ( net_buffer  ,
basic   
)

◆ TEST() [57/64]

TEST ( net_buffer  ,
existing_capacity   
)

◆ TEST() [58/64]

TEST ( net_buffer  ,
reallocate   
)

◆ TEST() [59/64]

TEST ( net_buffer  ,
move   
)

◆ TEST() [60/64]

TEST ( parsing  ,
isspace   
)

◆ TEST() [61/64]

TEST ( parsing  ,
isdigit   
)

◆ TEST() [62/64]

TEST ( parsing  ,
number   
)

◆ TEST() [63/64]

TEST ( parsing  ,
unicode   
)

◆ TEST() [64/64]

TEST ( parsing  ,
strtoul   
)