14 #include <gtest/gtest.h> 15 #include "../../include/ecl/streams/string_stream.hpp" 28 TEST(StringStreams,floatTypes) {
34 EXPECT_FALSE(sstream.fail());
40 TEST(StringStreams,clearStream) {
45 EXPECT_FALSE(sstream.fail());
46 EXPECT_EQ(
string(
"aha"),sstream.
str());
49 TEST(StringStreams,integralTypes) {
55 EXPECT_FALSE(sstream.fail());
60 TEST(StringStreams,hexTypes) {
65 EXPECT_FALSE(sstream.fail());
69 TEST(StringStreams,multipleOps) {
74 EXPECT_FALSE(sstream.fail());
75 EXPECT_EQ(
string(
"Hello"),s);
78 EXPECT_FALSE(sstream.fail());
79 EXPECT_EQ(
string(
"Dude"),s);
82 TEST(StringStreams,readEmptyFail) {
86 EXPECT_TRUE(sstream.fail());
89 TEST(StringStreams,remaining) {
92 EXPECT_EQ(4,sstream.device().remaining());
99 int main(
int argc,
char** argv) {
100 testing::InitGoogleTest(&argc,argv);
101 return RUN_ALL_TESTS();
int main(int argc, char **argv)
TEST(StringStreams, floatTypes)
void clear()
Clears the underlying device's internal buffers.
Convenience wrapper for string device based textstreams.
std::string str()
String representation of the underlying device's contents.