Add transparent Contains() test to unowned_ptr_unittest.cpp Show that pdfium::Contains() can be applied as expected, as this eventually translates into a call to find() with a transparent comparison. Change-Id: I4ef6d1ec1cc5f675fb3c6ad51323b2c6cecdd749 Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/98392 Auto-Submit: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/core/fxcrt/unowned_ptr_unittest.cpp b/core/fxcrt/unowned_ptr_unittest.cpp index 92cf294..7862e5e 100644 --- a/core/fxcrt/unowned_ptr_unittest.cpp +++ b/core/fxcrt/unowned_ptr_unittest.cpp
@@ -10,6 +10,7 @@ #include <utility> #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/base/containers/contains.h" namespace fxcrt { namespace { @@ -203,6 +204,8 @@ holder.insert(ptr1); EXPECT_NE(holder.end(), holder.find(&foos[0])); EXPECT_EQ(holder.end(), holder.find(&foos[1])); + EXPECT_TRUE(pdfium::Contains(holder, &foos[0])); + EXPECT_FALSE(pdfium::Contains(holder, &foos[1])); } } // namespace fxcrt