From 610ad3a5985c1eb40917eb948f5a09266270112c Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Mon, 10 Oct 2016 14:10:45 +0000 Subject: [PATCH] Add tests for LWG2544. We already implement this; just adding tests to make sure that we keep doing it. llvm-svn: 283749 --- .../istreambuf.iterator_equal/equal.pass.cpp | 22 ++++++++++++++++++++++ .../istreambuf.iterator_op!=/not_equal.pass.cpp | 22 ++++++++++++++++++++++ .../istreambuf.iterator_op==/equal.pass.cpp | 22 ++++++++++++++++++++++ 3 files changed, 66 insertions(+) diff --git a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_equal/equal.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_equal/equal.pass.cpp index 2005d30..0137664 100644 --- a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_equal/equal.pass.cpp +++ b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_equal/equal.pass.cpp @@ -26,26 +26,37 @@ int main() std::istreambuf_iterator i2(inf2); std::istreambuf_iterator i3; std::istreambuf_iterator i4; + std::istreambuf_iterator i5(nullptr); assert( i1.equal(i1)); assert( i1.equal(i2)); assert(!i1.equal(i3)); assert(!i1.equal(i4)); + assert(!i1.equal(i5)); assert( i2.equal(i1)); assert( i2.equal(i2)); assert(!i2.equal(i3)); assert(!i2.equal(i4)); + assert(!i2.equal(i5)); assert(!i3.equal(i1)); assert(!i3.equal(i2)); assert( i3.equal(i3)); assert( i3.equal(i4)); + assert( i3.equal(i5)); assert(!i4.equal(i1)); assert(!i4.equal(i2)); assert( i4.equal(i3)); assert( i4.equal(i4)); + assert( i4.equal(i5)); + + assert(!i5.equal(i1)); + assert(!i5.equal(i2)); + assert( i5.equal(i3)); + assert( i5.equal(i4)); + assert( i5.equal(i5)); } { std::wistringstream inf1(L"abc"); @@ -54,25 +65,36 @@ int main() std::istreambuf_iterator i2(inf2); std::istreambuf_iterator i3; std::istreambuf_iterator i4; + std::istreambuf_iterator i5(nullptr); assert( i1.equal(i1)); assert( i1.equal(i2)); assert(!i1.equal(i3)); assert(!i1.equal(i4)); + assert(!i1.equal(i5)); assert( i2.equal(i1)); assert( i2.equal(i2)); assert(!i2.equal(i3)); assert(!i2.equal(i4)); + assert(!i2.equal(i5)); assert(!i3.equal(i1)); assert(!i3.equal(i2)); assert( i3.equal(i3)); assert( i3.equal(i4)); + assert( i3.equal(i5)); assert(!i4.equal(i1)); assert(!i4.equal(i2)); assert( i4.equal(i3)); assert( i4.equal(i4)); + assert( i4.equal(i5)); + + assert(!i5.equal(i1)); + assert(!i5.equal(i2)); + assert( i5.equal(i3)); + assert( i5.equal(i4)); + assert( i5.equal(i5)); } } diff --git a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op!=/not_equal.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op!=/not_equal.pass.cpp index 5e85364..81e5f34 100644 --- a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op!=/not_equal.pass.cpp +++ b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op!=/not_equal.pass.cpp @@ -28,26 +28,37 @@ int main() std::istreambuf_iterator i2(inf2); std::istreambuf_iterator i3; std::istreambuf_iterator i4; + std::istreambuf_iterator i5(nullptr); assert(!(i1 != i1)); assert(!(i1 != i2)); assert( (i1 != i3)); assert( (i1 != i4)); + assert( (i1 != i5)); assert(!(i2 != i1)); assert(!(i2 != i2)); assert( (i2 != i3)); assert( (i2 != i4)); + assert( (i2 != i5)); assert( (i3 != i1)); assert( (i3 != i2)); assert(!(i3 != i3)); assert(!(i3 != i4)); + assert(!(i3 != i5)); assert( (i4 != i1)); assert( (i4 != i2)); assert(!(i4 != i3)); assert(!(i4 != i4)); + assert(!(i4 != i5)); + + assert( (i5 != i1)); + assert( (i5 != i2)); + assert(!(i5 != i3)); + assert(!(i5 != i4)); + assert(!(i5 != i5)); } { std::wistringstream inf1(L"abc"); @@ -56,25 +67,36 @@ int main() std::istreambuf_iterator i2(inf2); std::istreambuf_iterator i3; std::istreambuf_iterator i4; + std::istreambuf_iterator i5(nullptr); assert(!(i1 != i1)); assert(!(i1 != i2)); assert( (i1 != i3)); assert( (i1 != i4)); + assert( (i1 != i5)); assert(!(i2 != i1)); assert(!(i2 != i2)); assert( (i2 != i3)); assert( (i2 != i4)); + assert( (i2 != i5)); assert( (i3 != i1)); assert( (i3 != i2)); assert(!(i3 != i3)); assert(!(i3 != i4)); + assert(!(i3 != i5)); assert( (i4 != i1)); assert( (i4 != i2)); assert(!(i4 != i3)); assert(!(i4 != i4)); + assert(!(i4 != i5)); + + assert( (i5 != i1)); + assert( (i5 != i2)); + assert(!(i5 != i3)); + assert(!(i5 != i4)); + assert(!(i5 != i5)); } } diff --git a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op==/equal.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op==/equal.pass.cpp index 9195769..65a78cb 100644 --- a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op==/equal.pass.cpp +++ b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op==/equal.pass.cpp @@ -28,26 +28,37 @@ int main() std::istreambuf_iterator i2(inf2); std::istreambuf_iterator i3; std::istreambuf_iterator i4; + std::istreambuf_iterator i5(nullptr); assert( (i1 == i1)); assert( (i1 == i2)); assert(!(i1 == i3)); assert(!(i1 == i4)); + assert(!(i1 == i5)); assert( (i2 == i1)); assert( (i2 == i2)); assert(!(i2 == i3)); assert(!(i2 == i4)); + assert(!(i2 == i5)); assert(!(i3 == i1)); assert(!(i3 == i2)); assert( (i3 == i3)); assert( (i3 == i4)); + assert( (i3 == i5)); assert(!(i4 == i1)); assert(!(i4 == i2)); assert( (i4 == i3)); assert( (i4 == i4)); + assert( (i4 == i5)); + + assert(!(i5 == i1)); + assert(!(i5 == i2)); + assert( (i5 == i3)); + assert( (i5 == i4)); + assert( (i5 == i5)); } { std::wistringstream inf1(L"abc"); @@ -56,25 +67,36 @@ int main() std::istreambuf_iterator i2(inf2); std::istreambuf_iterator i3; std::istreambuf_iterator i4; + std::istreambuf_iterator i5(nullptr); assert( (i1 == i1)); assert( (i1 == i2)); assert(!(i1 == i3)); assert(!(i1 == i4)); + assert(!(i1 == i5)); assert( (i2 == i1)); assert( (i2 == i2)); assert(!(i2 == i3)); assert(!(i2 == i4)); + assert(!(i2 == i5)); assert(!(i3 == i1)); assert(!(i3 == i2)); assert( (i3 == i3)); assert( (i3 == i4)); + assert( (i3 == i5)); assert(!(i4 == i1)); assert(!(i4 == i2)); assert( (i4 == i3)); assert( (i4 == i4)); + assert( (i4 == i5)); + + assert(!(i5 == i1)); + assert(!(i5 == i2)); + assert( (i5 == i3)); + assert( (i5 == i4)); + assert( (i5 == i5)); } } -- 2.7.4