Monero
Classes | Macros | Functions
valuetest.cpp File Reference
#include "unittest.h"
#include "rapidjson/document.h"
#include <algorithm>
Include dependency graph for valuetest.cpp:

Classes

struct  TerminateHandler< e >
 
struct  ValueIntComparer
 

Macros

#define TEST_TERMINATION(e, json)
 

Functions

 TEST (Value, Size)
 
 TEST (Value, DefaultConstructor)
 
 TEST (Value, AssignmentOperator)
 
template<typename A , typename B >
void TestEqual (const A &a, const B &b)
 
template<typename A , typename B >
void TestUnequal (const A &a, const B &b)
 
 TEST (Value, EqualtoOperator)
 
template<typename Value >
void TestCopyFrom ()
 
 TEST (Value, CopyFrom)
 
 TEST (Value, Swap)
 
 TEST (Value, Null)
 
 TEST (Value, True)
 
 TEST (Value, False)
 
 TEST (Value, Int)
 
 TEST (Value, Uint)
 
 TEST (Value, Int64)
 
 TEST (Value, Uint64)
 
 TEST (Value, Double)
 
 TEST (Value, Float)
 
 TEST (Value, IsLosslessDouble)
 
 TEST (Value, IsLosslessFloat)
 
 TEST (Value, String)
 
 TEST (Value, SetStringNull)
 
template<typename T , typename Allocator >
static void TestArray (T &x, Allocator &allocator)
 
 TEST (Value, Array)
 
 TEST (Value, ArrayHelper)
 
template<typename T , typename Allocator >
static void TestObject (T &x, Allocator &allocator)
 
 TEST (Value, Object)
 
 TEST (Value, ObjectHelper)
 
 TEST (Value, EraseMember_String)
 
 TEST (Value, BigNestedArray)
 
 TEST (Value, BigNestedObject)
 
 TEST (Value, RemoveLastElement)
 
 TEST (Document, CrtAllocator)
 
static void TestShortStringOptimization (const char *str)
 
 TEST (Value, AllocateShortString)
 
 TEST (Value, AcceptTerminationByHandler)
 
static void MergeDuplicateKey (Value &v, Value::AllocatorType &a)
 
 TEST (Value, MergeDuplicateKey)
 

Macro Definition Documentation

◆ TEST_TERMINATION

#define TEST_TERMINATION (   e,
  json 
)
Value:
{\
Document d; \
EXPECT_FALSE(d.Parse(json).HasParseError()); \
Reader reader; \
TerminateHandler<e> h;\
EXPECT_FALSE(d.Accept(h));\
}
Definition: d.py:1
d
Definition: pymoduletest.py:79
static uint64_t h
Definition: blockchain_stats.cpp:55
rapidjson::Document json
Definition: transport.cpp:49

Function Documentation

◆ MergeDuplicateKey()

static void MergeDuplicateKey ( Value v,
Value::AllocatorType a 
)
static

◆ TEST() [1/31]

TEST ( Value  ,
Size   
)

◆ TEST() [2/31]

TEST ( Value  ,
DefaultConstructor   
)

◆ TEST() [3/31]

TEST ( Value  ,
AssignmentOperator   
)

◆ TEST() [4/31]

TEST ( Value  ,
EqualtoOperator   
)

◆ TEST() [5/31]

TEST ( Value  ,
CopyFrom   
)

◆ TEST() [6/31]

TEST ( Value  ,
Swap   
)

◆ TEST() [7/31]

TEST ( Value  ,
Null   
)

◆ TEST() [8/31]

TEST ( Value  ,
True   
)

◆ TEST() [9/31]

TEST ( Value  ,
False   
)

◆ TEST() [10/31]

TEST ( Value  ,
Int   
)

◆ TEST() [11/31]

TEST ( Value  ,
Uint   
)

◆ TEST() [12/31]

TEST ( Value  ,
Int64   
)

◆ TEST() [13/31]

TEST ( Value  ,
Uint64   
)

◆ TEST() [14/31]

TEST ( Value  ,
Double   
)

◆ TEST() [15/31]

TEST ( Value  ,
Float   
)

◆ TEST() [16/31]

TEST ( Value  ,
IsLosslessDouble   
)

◆ TEST() [17/31]

TEST ( Value  ,
IsLosslessFloat   
)

◆ TEST() [18/31]

TEST ( Value  ,
String   
)

◆ TEST() [19/31]

TEST ( Value  ,
SetStringNull   
)

◆ TEST() [20/31]

TEST ( Value  ,
Array   
)

◆ TEST() [21/31]

TEST ( Value  ,
ArrayHelper   
)

◆ TEST() [22/31]

TEST ( Value  ,
Object   
)

◆ TEST() [23/31]

TEST ( Value  ,
ObjectHelper   
)

◆ TEST() [24/31]

TEST ( Value  ,
EraseMember_String   
)

◆ TEST() [25/31]

TEST ( Value  ,
BigNestedArray   
)

◆ TEST() [26/31]

TEST ( Value  ,
BigNestedObject   
)

◆ TEST() [27/31]

TEST ( Value  ,
RemoveLastElement   
)

◆ TEST() [28/31]

TEST ( Document  ,
CrtAllocator   
)

◆ TEST() [29/31]

TEST ( Value  ,
AllocateShortString   
)

◆ TEST() [30/31]

TEST ( Value  ,
AcceptTerminationByHandler   
)

◆ TEST() [31/31]

TEST ( Value  ,
MergeDuplicateKey   
)

◆ TestArray()

template<typename T , typename Allocator >
static void TestArray ( T x,
Allocator allocator 
)
static

◆ TestCopyFrom()

template<typename Value >
void TestCopyFrom ( )

◆ TestEqual()

template<typename A , typename B >
void TestEqual ( const A &  a,
const B &  b 
)

◆ TestObject()

template<typename T , typename Allocator >
static void TestObject ( T x,
Allocator allocator 
)
static

◆ TestShortStringOptimization()

static void TestShortStringOptimization ( const char *  str)
static

◆ TestUnequal()

template<typename A , typename B >
void TestUnequal ( const A &  a,
const B &  b 
)