aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Wouter van Kesteren <woutershep@gmail.com> 2015-05-02 20:32:32 +0200
committerAvatar Wouter van Kesteren <woutershep@gmail.com> 2015-05-02 21:57:30 +0200
commitfe3f71c48c42c17811ad612b00c7006dc57a370c (patch)
tree0ff143a4e0008381509f45b27ab8f1d97966cc0d
parent16acb5e446ea244c88cae8c25b4a6bd9cc8bae7d (diff)
downloadpaludis-fe3f71c48c42c17811ad612b00c7006dc57a370c.tar.gz
paludis-fe3f71c48c42c17811ad612b00c7006dc57a370c.tar.xz
Make stream conversions explicit for gtest
-rw-r--r--paludis/fs_merger_TEST.cc12
-rw-r--r--paludis/repositories/e/fetch_visitor_TEST.cc2
-rw-r--r--paludis/set_file_TEST.cc8
-rw-r--r--paludis/util/process_TEST.cc4
-rw-r--r--paludis/util/safe_ifstream_TEST.cc12
-rw-r--r--paludis/util/safe_ofstream_TEST.cc14
-rw-r--r--paludis/util/string_list_stream_TEST.cc8
7 files changed, 30 insertions, 30 deletions
diff --git a/paludis/fs_merger_TEST.cc b/paludis/fs_merger_TEST.cc
index 3b1fc06..9d35e5b 100644
--- a/paludis/fs_merger_TEST.cc
+++ b/paludis/fs_merger_TEST.cc
@@ -360,7 +360,7 @@ TEST(Merger, FileNothing)
ASSERT_TRUE((data->root_dir / "file").stat().is_regular_file());
SafeIFStream f(data->root_dir / "file");
- ASSERT_TRUE(f);
+ ASSERT_TRUE(bool(f));
std::string fs(std::string((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>()));
EXPECT_EQ("image contents\n", fs);
}
@@ -370,7 +370,7 @@ TEST(Merger, FileFile)
auto data(make_merger(et_file, et_file, 0));
ASSERT_TRUE((data->root_dir / "file").stat().is_regular_file());
SafeIFStream b(data->root_dir / "file");
- ASSERT_TRUE(b);
+ ASSERT_TRUE(bool(b));
std::string bs((std::istreambuf_iterator<char>(b)), std::istreambuf_iterator<char>());
EXPECT_EQ("root contents\n", bs);
@@ -379,7 +379,7 @@ TEST(Merger, FileFile)
ASSERT_TRUE((data->root_dir / "file").stat().is_regular_file());
SafeIFStream f(data->root_dir / "file");
- ASSERT_TRUE(f);
+ ASSERT_TRUE(bool(f));
std::string fs((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>());
EXPECT_EQ("image contents\n", fs);
}
@@ -396,19 +396,19 @@ TEST(Merger, FileSym)
ASSERT_TRUE((data->root_dir / "file1").stat().is_regular_file());
SafeIFStream f(data->root_dir / "file1");
- ASSERT_TRUE(f);
+ ASSERT_TRUE(bool(f));
std::string fs((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>());
EXPECT_EQ("image 1 contents\n", fs);
ASSERT_TRUE((data->root_dir / "file2").stat().is_regular_file());
SafeIFStream f2(data->root_dir / "file2");
- ASSERT_TRUE(f2);
+ ASSERT_TRUE(bool(f2));
std::string fs2((std::istreambuf_iterator<char>(f2)), std::istreambuf_iterator<char>());
EXPECT_EQ("image 2 contents\n", fs2);
ASSERT_TRUE((data->root_dir / "file3").stat().is_regular_file());
SafeIFStream f3(data->root_dir / "file3");
- ASSERT_TRUE(f3);
+ ASSERT_TRUE(bool(f3));
std::string fs3((std::istreambuf_iterator<char>(f3)), std::istreambuf_iterator<char>());
EXPECT_EQ("image 3 contents\n", fs3);
}
diff --git a/paludis/repositories/e/fetch_visitor_TEST.cc b/paludis/repositories/e/fetch_visitor_TEST.cc
index 24025d9..46c2894 100644
--- a/paludis/repositories/e/fetch_visitor_TEST.cc
+++ b/paludis/repositories/e/fetch_visitor_TEST.cc
@@ -84,7 +84,7 @@ TEST(FetchVisitor, Works)
ASSERT_TRUE(FSPath("fetch_visitor_TEST_dir/out/input1").stat().is_regular_file());
SafeIFStream f(FSPath("fetch_visitor_TEST_dir/out/input1"));
- ASSERT_TRUE(f);
+ ASSERT_TRUE(bool(f));
std::string s((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>());
EXPECT_EQ("contents of one\n", s);
}
diff --git a/paludis/set_file_TEST.cc b/paludis/set_file_TEST.cc
index 24329f1..2a4d1e6 100644
--- a/paludis/set_file_TEST.cc
+++ b/paludis/set_file_TEST.cc
@@ -91,7 +91,7 @@ TEST(SetFile, Simple)
{
SafeIFStream ff(FSPath("set_file_TEST_dir/simple1"));
- ASSERT_TRUE(ff);
+ ASSERT_TRUE(bool(ff));
std::string g((std::istreambuf_iterator<char>(ff)), std::istreambuf_iterator<char>());
EXPECT_EQ("# this is a comment\n\nfoo/bar\n>=bar/baz-1.23\n\n# the end\nmoo/oink\n", g);
}
@@ -109,7 +109,7 @@ TEST(SetFile, Simple)
{
SafeIFStream ff(FSPath("set_file_TEST_dir/simple1"));
- ASSERT_TRUE(ff);
+ ASSERT_TRUE(bool(ff));
std::string g((std::istreambuf_iterator<char>(ff)), std::istreambuf_iterator<char>());
EXPECT_EQ("# this is a comment\n\nfoo/bar\n\n# the end\nmoo/oink\n", g);
}
@@ -149,7 +149,7 @@ TEST(SetFile, PaludisConf)
{
SafeIFStream ff(FSPath("set_file_TEST_dir/paludisconf1"));
- ASSERT_TRUE(ff);
+ ASSERT_TRUE(bool(ff));
std::string g((std::istreambuf_iterator<char>(ff)), std::istreambuf_iterator<char>());
EXPECT_EQ("# this is a comment\n\n? foo/bar\n* >=bar/baz-1.23\n\n* set\n? settee\n\n# the end\n* moo/oink\n* couch\n", g);
}
@@ -168,7 +168,7 @@ TEST(SetFile, PaludisConf)
{
SafeIFStream ff(FSPath("set_file_TEST_dir/paludisconf1"));
- ASSERT_TRUE(ff);
+ ASSERT_TRUE(bool(ff));
std::string g((std::istreambuf_iterator<char>(ff)), std::istreambuf_iterator<char>());
EXPECT_EQ("# this is a comment\n\n? foo/bar\n\n? settee\n\n# the end\n* moo/oink\n* couch\n", g);
}
diff --git a/paludis/util/process_TEST.cc b/paludis/util/process_TEST.cc
index 0953554..8eedf03 100644
--- a/paludis/util/process_TEST.cc
+++ b/paludis/util/process_TEST.cc
@@ -129,7 +129,7 @@ TEST(Process, GrabStdoutLong)
std::string s;
for (int x(1) ; x <= 100000 ; ++x)
{
- ASSERT_TRUE(std::getline(stdout_stream, s));
+ ASSERT_TRUE(bool(std::getline(stdout_stream, s)));
ASSERT_EQ(stringify(x), s);
}
@@ -265,7 +265,7 @@ TEST(Process, CapturedPipeCommand)
EXPECT_EQ(13, one_two_three_process.run().wait());
std::string line;
- ASSERT_TRUE(std::getline(stdout_stream, line));
+ ASSERT_TRUE(bool(std::getline(stdout_stream, line)));
EXPECT_EQ("2", line);
ASSERT_TRUE(! std::getline(stdout_stream, line));
}
diff --git a/paludis/util/safe_ifstream_TEST.cc b/paludis/util/safe_ifstream_TEST.cc
index 9750aaf..a6aa779 100644
--- a/paludis/util/safe_ifstream_TEST.cc
+++ b/paludis/util/safe_ifstream_TEST.cc
@@ -30,10 +30,10 @@ using namespace paludis;
TEST(SafeIFStream, Existing)
{
SafeIFStream s(FSPath::cwd() / "safe_ifstream_TEST_dir" / "existing");
- ASSERT_TRUE(s);
+ ASSERT_TRUE(bool(s));
std::string t;
s >> t;
- ASSERT_TRUE(s);
+ ASSERT_TRUE(bool(s));
EXPECT_EQ("first", t);
s >> t;
EXPECT_EQ(std::string(1000, 'x'), t);
@@ -41,9 +41,9 @@ TEST(SafeIFStream, Existing)
s.clear();
s.seekg(0, std::ios::beg);
- ASSERT_TRUE(s);
+ ASSERT_TRUE(bool(s));
s >> t;
- ASSERT_TRUE(s);
+ ASSERT_TRUE(bool(s));
EXPECT_EQ("first", t);
s >> t;
EXPECT_EQ(std::string(1000, 'x'), t);
@@ -52,10 +52,10 @@ TEST(SafeIFStream, Existing)
TEST(SafeIFStream, ExistingSym)
{
SafeIFStream s(FSPath::cwd() / "safe_ifstream_TEST_dir" / "existing");
- ASSERT_TRUE(s);
+ ASSERT_TRUE(bool(s));
std::string t;
s >> t;
- ASSERT_TRUE(s);
+ ASSERT_TRUE(bool(s));
EXPECT_EQ("first", t);
s >> t;
EXPECT_EQ(std::string(1000, 'x'), t);
diff --git a/paludis/util/safe_ofstream_TEST.cc b/paludis/util/safe_ofstream_TEST.cc
index a33002b..b66777c 100644
--- a/paludis/util/safe_ofstream_TEST.cc
+++ b/paludis/util/safe_ofstream_TEST.cc
@@ -30,25 +30,25 @@ using namespace paludis;
TEST(SafeOFStream, New)
{
SafeOFStream s(FSPath::cwd() / "safe_ofstream_TEST_dir" / "new", -1, false);
- ASSERT_TRUE(s);
+ ASSERT_TRUE(bool(s));
s << "foo";
- ASSERT_TRUE(s);
+ ASSERT_TRUE(bool(s));
}
TEST(SafeOFStream, Existing)
{
SafeOFStream s(FSPath::cwd() / "safe_ofstream_TEST_dir" / "existing", -1, false);
- ASSERT_TRUE(s);
+ ASSERT_TRUE(bool(s));
s << "foo";
- ASSERT_TRUE(s);
+ ASSERT_TRUE(bool(s));
}
TEST(SafeOFStream, ExistingSym)
{
SafeOFStream s(FSPath::cwd() / "safe_ofstream_TEST_dir" / "existing_sym", -1, false);
- ASSERT_TRUE(s);
+ ASSERT_TRUE(bool(s));
s << "foo";
- ASSERT_TRUE(s);
+ ASSERT_TRUE(bool(s));
}
TEST(SafeOFStream, ExistingDir)
@@ -70,7 +70,7 @@ TEST(SafeOFStream, WriteFailure)
try
{
SafeOFStream s(FSPath("/dev/full"), -1, false);
- ASSERT_TRUE(s);
+ ASSERT_TRUE(bool(s));
s << "foo";
ASSERT_TRUE(! s);
}
diff --git a/paludis/util/string_list_stream_TEST.cc b/paludis/util/string_list_stream_TEST.cc
index ab1df95..309c4b6 100644
--- a/paludis/util/string_list_stream_TEST.cc
+++ b/paludis/util/string_list_stream_TEST.cc
@@ -49,13 +49,13 @@ TEST(StringListStream, Works)
std::string l;
- ASSERT_TRUE(std::getline(s, l));
+ ASSERT_TRUE(bool(std::getline(s, l)));
EXPECT_EQ("foo", l);
- ASSERT_TRUE(std::getline(s, l));
+ ASSERT_TRUE(bool(std::getline(s, l)));
EXPECT_EQ("bar", l);
- ASSERT_TRUE(std::getline(s, l));
+ ASSERT_TRUE(bool(std::getline(s, l)));
EXPECT_EQ("baz", l);
ASSERT_TRUE(! std::getline(s, l));
@@ -69,7 +69,7 @@ TEST(StringListStream, Threads)
std::string l;
for (int n(0) ; n < 100 ; ++n)
{
- ASSERT_TRUE(std::getline(s, l));
+ ASSERT_TRUE(bool(std::getline(s, l)));
EXPECT_EQ(stringify(n), l);
}