Wire Sysio Wire Sysion 1.0.0
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;
141 EXPECT_TRUE(!d.ParseStream(eis).HasParseError());
142 EXPECT_TRUE(d.IsObject());
143 EXPECT_EQ(5u, d.MemberCount());
144}
Input byte stream wrapper with a statically bound encoding.
#define EXPECT_EQ(val1, val2)
Definition gtest.h:1954
#define EXPECT_TRUE(condition)
Definition gtest.h:1895
#define ASSERT_TRUE(condition)
Definition gtest.h:1901
static const Segment fs(Segment::fs)
CK_ULONG d

◆ 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;
130 EXPECT_TRUE(!d.ParseStream(eis).HasParseError());
131 EXPECT_TRUE(d.IsObject());
132 EXPECT_EQ(5u, d.MemberCount());
133}

◆ 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}