Electroneum
Loading...
Searching...
No Matches
istreamwrappertest.cpp File Reference
#include "unittest.h"
#include "rapidjson/istreamwrapper.h"
#include "rapidjson/encodedstream.h"
#include "rapidjson/document.h"
#include <sstream>
#include <fstream>
Include dependency graph for istreamwrappertest.cpp:

Go to the source code of this file.

Functions

 TEST (IStreamWrapper, istringstream)
 TEST (IStreamWrapper, stringstream)
 TEST (IStreamWrapper, wistringstream)
 TEST (IStreamWrapper, wstringstream)
 TEST (IStreamWrapper, ifstream)
 TEST (IStreamWrapper, fstream)

Function Documentation

◆ TEST() [1/6]

TEST ( IStreamWrapper ,
fstream  )

Definition at line 135 of file istreamwrappertest.cpp.

135 {
136 fstream fs;
137 ASSERT_TRUE(Open(fs, "utf8bom.json"));
138 IStreamWrapper isw(fs);
140 Document d;
142 EXPECT_TRUE(d.IsObject());
143 EXPECT_EQ(5, d.MemberCount());
144}
Input byte stream wrapper with a statically bound encoding.
bool HasParseError() const
Whether a parse error has occurred in the last parsing.
Definition document.h:2394
GenericDocument & ParseStream(InputStream &is)
Parse JSON text from an input stream (with Encoding conversion).
Definition document.h:2265
GenericDocument< UTF8<> > Document
GenericDocument with UTF8 encoding.
Definition document.h:2512
#define EXPECT_EQ(val1, val2)
Definition gtest.h:1922
#define EXPECT_TRUE(condition)
Definition gtest.h:1859
#define ASSERT_TRUE(condition)
Definition gtest.h:1865
Here is the call graph for this function:

◆ TEST() [2/6]

TEST ( IStreamWrapper ,
ifstream  )

Definition at line 124 of file istreamwrappertest.cpp.

124 {
125 ifstream ifs;
126 ASSERT_TRUE(Open(ifs, "utf8bom.json"));
127 IStreamWrapper isw(ifs);
129 Document d;
131 EXPECT_TRUE(d.IsObject());
132 EXPECT_EQ(5, d.MemberCount());
133}
Here is the call graph for this function:

◆ TEST() [3/6]

TEST ( IStreamWrapper ,
istringstream  )

Definition at line 89 of file istreamwrappertest.cpp.

89 {
90 TestStringStream<istringstream>();
91}

◆ TEST() [4/6]

TEST ( IStreamWrapper ,
stringstream  )

Definition at line 93 of file istreamwrappertest.cpp.

93 {
94 TestStringStream<stringstream>();
95}

◆ TEST() [5/6]

TEST ( IStreamWrapper ,
wistringstream  )

Definition at line 97 of file istreamwrappertest.cpp.

97 {
98 TestStringStream<wistringstream>();
99}

◆ TEST() [6/6]

TEST ( IStreamWrapper ,
wstringstream  )

Definition at line 101 of file istreamwrappertest.cpp.

101 {
102 TestStringStream<wstringstream>();
103}