[libcxx-commits] [PATCH] D100595: [libcxx][test] Attempt to make debug mode tests more bulletproof

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon May 17 08:21:54 PDT 2021

Quuxplusone accepted this revision.
Quuxplusone added inline comments.
This revision is now accepted and ready to land.

Comment at: libcxx/test/libcxx/containers/sequences/vector/db_back_2.pass.cpp:24-30
 int main(int, char**) {
   typedef int T;
   typedef std::vector<T, min_allocator<T> > C;
   C c(1);
   assert(c.back() == 0);
+  TEST_LIBCPP_ASSERT_FAILURE(c.back(), "back() called on an empty vector");
krisb wrote:
> Quuxplusone wrote:
> > This test seems the same as the previous...?  Ah, I see, this one uses `vector<int, min_allocator<int>>` instead of `vector<int>`. However, IMHO we can just kill this test; it's not significantly different from the previous one. I recommend
> > ```
> > git rm db_back_2.pass.cpp
> > git rm db_cback_2.pass.cpp
> > git rm db_front_2.pass.cpp
> > git rm db_cfront_2.pass.cpp
> > git rm db_index_2.pass.cpp
> > git rm db_cindex_2.pass.cpp
> > ```
> I'd leave this out of the scope of this patch. We have similar tests for all the containers, and they tested the specific functionality at least at the moment they were added (I haven't checked how things are going now, though).
OK. I also realize now that `min_allocator` uses fancy pointers, so that //is// probably good to have coverage on. :)

Comment at: libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp:24
 struct X {
     constexpr int test() const {return 3;}
Nit: remove `constexpr` here

  rG LLVM Github Monorepo



More information about the libcxx-commits mailing list