RetroArch
Classes | Macros | Functions
writertest.cpp File Reference
#include "unittest.h"
#include "rapidjson/document.h"
#include "rapidjson/reader.h"
#include "rapidjson/writer.h"
#include "rapidjson/stringbuffer.h"
#include "rapidjson/memorybuffer.h"
#include <sstream>
Include dependency graph for writertest.cpp:

Classes

class  OStreamWrapper
 

Macros

#define TEST_ROUNDTRIP(json)
 
#define T(x)
 
#define T(x)
 
#define T(x)
 

Functions

 TEST (Writer, Compact)
 
 TEST (Writer, Root)
 
 TEST (Writer, Int)
 
 TEST (Writer, UInt)
 
 TEST (Writer, Int64)
 
 TEST (Writer, Uint64)
 
 TEST (Writer, String)
 
 TEST (Writer, ScanWriteUnescapedString)
 
 TEST (Writer, Double)
 
template<typename TargetEncoding >
void TestTranscode (const char *json)
 
 TEST (Writer, Transcode)
 
 TEST (Writer, OStreamWrapper)
 
 TEST (Writer, AssertRootMayBeAnyValue)
 
 TEST (Writer, AssertIncorrectObjectLevel)
 
 TEST (Writer, AssertIncorrectArrayLevel)
 
 TEST (Writer, AssertIncorrectEndObject)
 
 TEST (Writer, AssertIncorrectEndArray)
 
 TEST (Writer, AssertObjectKeyNotString)
 
 TEST (Writer, AssertMultipleRoot)
 
 TEST (Writer, RootObjectIsComplete)
 
 TEST (Writer, RootArrayIsComplete)
 
 TEST (Writer, RootValueIsComplete)
 
 TEST (Writer, InvalidEncoding)
 
 TEST (Writer, ValidateEncoding)
 
 TEST (Writer, InvalidEventSequence)
 
 TEST (Writer, NaN)
 
 TEST (Writer, Inf)
 
 TEST (Writer, RawValue)
 

Macro Definition Documentation

◆ T [1/3]

#define T (   x)
Value:
{\
StringBuffer buffer;\
Writer<StringBuffer> writer(buffer);\
EXPECT_TRUE(x);\
}
GLuint buffer
Definition: glext.h:6555
static int writer(lua_State *L, const void *b, size_t size, void *B)
Definition: lstrlib.c:182
GLint GLint GLint GLint GLint x
Definition: glext.h:6295
Definition: video4linux2.c:51

◆ T [2/3]

#define T (   x)
Value:
{\
StringBuffer buffer;\
Writer<StringBuffer> writer(buffer);\
writer.StartObject();\
ASSERT_THROW(x, AssertException); \
}
GLuint buffer
Definition: glext.h:6555
static int writer(lua_State *L, const void *b, size_t size, void *B)
Definition: lstrlib.c:182
GLint GLint GLint GLint GLint x
Definition: glext.h:6295
Definition: video4linux2.c:51
Definition: unittest.h:109

◆ T [3/3]

#define T (   x)
Value:
{\
StringBuffer buffer;\
Writer<StringBuffer> writer(buffer);\
EXPECT_FALSE(writer.IsComplete()); \
x; \
EXPECT_TRUE(writer.IsComplete()); \
}
GLuint buffer
Definition: glext.h:6555
static int writer(lua_State *L, const void *b, size_t size, void *B)
Definition: lstrlib.c:182
Definition: video4linux2.c:51

◆ TEST_ROUNDTRIP

#define TEST_ROUNDTRIP (   json)
Value:
{ \
StringStream s(json); \
StringBuffer buffer; \
Writer<StringBuffer> writer(buffer); \
Reader reader; \
reader.Parse<kParseFullPrecisionFlag>(s, writer); \
EXPECT_STREQ(json, buffer.GetString()); \
EXPECT_TRUE(writer.IsComplete()); \
}
GLuint buffer
Definition: glext.h:6555
static const char * reader(lua_State *L, void *ud, size_t *size)
Definition: luac.c:122
static const char json[]
Definition: namespacetest.cpp:32
GLdouble s
Definition: glext.h:6390
static int writer(lua_State *L, const void *b, size_t size, void *B)
Definition: lstrlib.c:182
Parse number in full precision (but slower).
Definition: reader.h:151
Definition: video4linux2.c:51

Function Documentation

◆ TEST() [1/27]

TEST ( Writer  ,
Compact   
)
Here is the call graph for this function:

◆ TEST() [2/27]

TEST ( Writer  ,
Root   
)

◆ TEST() [3/27]

TEST ( Writer  ,
Int   
)

◆ TEST() [4/27]

TEST ( Writer  ,
UInt   
)

◆ TEST() [5/27]

TEST ( Writer  ,
Int64   
)

◆ TEST() [6/27]

TEST ( Writer  ,
Uint64   
)

◆ TEST() [7/27]

TEST ( Writer  ,
String   
)
Here is the call graph for this function:

◆ TEST() [8/27]

TEST ( Writer  ,
ScanWriteUnescapedString   
)
Here is the call graph for this function:

◆ TEST() [9/27]

TEST ( Writer  ,
Double   
)

◆ TEST() [10/27]

TEST ( Writer  ,
Transcode   
)
Here is the call graph for this function:

◆ TEST() [11/27]

TEST ( Writer  ,
OStreamWrapper   
)
Here is the call graph for this function:

◆ TEST() [12/27]

TEST ( Writer  ,
AssertRootMayBeAnyValue   
)
Here is the call graph for this function:

◆ TEST() [13/27]

TEST ( Writer  ,
AssertIncorrectObjectLevel   
)
Here is the call graph for this function:

◆ TEST() [14/27]

TEST ( Writer  ,
AssertIncorrectArrayLevel   
)
Here is the call graph for this function:

◆ TEST() [15/27]

TEST ( Writer  ,
AssertIncorrectEndObject   
)
Here is the call graph for this function:

◆ TEST() [16/27]

TEST ( Writer  ,
AssertIncorrectEndArray   
)
Here is the call graph for this function:

◆ TEST() [17/27]

TEST ( Writer  ,
AssertObjectKeyNotString   
)
Here is the call graph for this function:

◆ TEST() [18/27]

TEST ( Writer  ,
AssertMultipleRoot   
)
Here is the call graph for this function:

◆ TEST() [19/27]

TEST ( Writer  ,
RootObjectIsComplete   
)
Here is the call graph for this function:

◆ TEST() [20/27]

TEST ( Writer  ,
RootArrayIsComplete   
)
Here is the call graph for this function:

◆ TEST() [21/27]

TEST ( Writer  ,
RootValueIsComplete   
)
Here is the call graph for this function:

◆ TEST() [22/27]

TEST ( Writer  ,
InvalidEncoding   
)
Here is the call graph for this function:

◆ TEST() [23/27]

TEST ( Writer  ,
ValidateEncoding   
)
Here is the call graph for this function:

◆ TEST() [24/27]

TEST ( Writer  ,
InvalidEventSequence   
)
Here is the call graph for this function:

◆ TEST() [25/27]

TEST ( Writer  ,
NaN   
)
Here is the call graph for this function:

◆ TEST() [26/27]

TEST ( Writer  ,
Inf   
)
Here is the call graph for this function:

◆ TEST() [27/27]

TEST ( Writer  ,
RawValue   
)
Here is the call graph for this function:

◆ TestTranscode()

template<typename TargetEncoding >
void TestTranscode ( const char *  json)
Here is the call graph for this function: