Skip to content

Commit

Permalink
More test.
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Jun 28, 2019
1 parent b9be5ad commit b011592
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
7 changes: 6 additions & 1 deletion io/Ilvis2Reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ std::istream& operator >> (std::istream& in, Ilvis2Reader::IlvisMapping& mval)
{ "HIGH", Ilvis2Reader::IlvisMapping::HIGH },
{ "ALL", Ilvis2Reader::IlvisMapping::ALL } };

mval = m[s];
auto it = m.find(s);
if (it == m.end())
in.setstate(std::iosbase::failbit);
else
mval = it->second;
return in;
}

Expand Down Expand Up @@ -142,6 +146,7 @@ void Ilvis2Reader::addDimensions(PointLayoutPtr layout)

void Ilvis2Reader::initialize(PointTableRef)
{
std::cerr << "Initialize!\n";
readit(m_stream, m_filename);

std::cerr << "Skip init!\n";
Expand Down
8 changes: 7 additions & 1 deletion pdal/util/NullOStream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ class NullStreambuf : public std::streambuf
{
char dummyBuffer[64];
protected:
virtual ~NullStreambuf()
{}

virtual int overflow(int c)
{
setp(dummyBuffer, dummyBuffer + sizeof(dummyBuffer));
Expand All @@ -58,8 +61,11 @@ class NullOStream : private NullStreambuf, public std::ostream
public:
NullOStream() : std::ostream(this)
{}
virtual ~NullOStream()
{}

NullStreambuf* rdbuf() const
{ return const_cast<NullOStream *>(this); }
{ return const_cast<NullStreambuf *>(this); }
};

} // namespace
3 changes: 2 additions & 1 deletion test/unit/filters/MergeTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ TEST(MergeTest, test6)
//Added redirect.
std::ostringstream oss;
auto ctx = Utils::redirect(std::clog, oss);

std::cerr << "Before execute!\n";
mgr.execute();
std::cerr << "After execute!\n";

PointViewSet viewSet = mgr.views();
EXPECT_EQ(1u, viewSet.size());
Expand Down

0 comments on commit b011592

Please sign in to comment.