[PATCH] D24941: [libc++][tests] Fixing some issues in unordered container tests

Oleg Ranevskyy via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 27 14:21:49 PDT 2016


iid_iunknown marked 3 inline comments as done.

================
Comment at: test/libcxx/containers/unord/unord.map/db_local_iterators_7.pass.cpp:35
@@ -34,3 +34,3 @@
     ++i;
     assert(false);
     }
----------------
iid_iunknown wrote:
> EricWF wrote:
> > All of the code below this is logically dead. Please either (A) remove it, or (B) define `_LIBCPP_ASSERT` so it doesn't exit when invoked. For example:
> > 
> > ```
> > #define _LIBCPP_ASSERT(p, m) ((p) ? (void)0 : throw 0)
> > int main()
> > {
> >     typedef std::unordered_map<int, std::string> C;
> >     C c(1);
> >     C::local_iterator i = c.begin(0);
> >     try {
> >       ++i;
> >       assert(false);
> >     } catch(int) {}
> >     // More tests can be written below
> > }
> > ```
> Agree. We build all the libc++ tests into a single executable binary to test on our system. We also have custom assert, exit() / abort() and _LIBCPP_ASSERT (similar to the one you suggested) so that test failures do not stop execution. Thus our testing env is not affected, which is why I didn't fix this. The usual test workflow does suffer from this however. Fixing these and some other tests according to your advice.
Agree. We build all the libc++ tests into a single executable binary to test on our system. We also have custom assert, exit() / abort() and _LIBCPP_ASSERT (similar to the one you suggested) so that test failures do not stop execution. Thus our testing env is not affected, which is why I didn't fix this. The usual test workflow does suffer from this however. Fixing these and some other tests according to your advice.


https://reviews.llvm.org/D24941





More information about the llvm-commits mailing list