This is an archive of the discontinued LLVM Phabricator instance.

Protect std::experimental::optional tests under libcpp-no-exceptions
ClosedPublic

Authored by rogfer01 on Oct 31 2016, 4:27 AM.

Details

Summary

In these tests there are some paths that explicitly throw, so use
the TEST_THROW macro that was proposed for this and then skip the tests
that may enter the throwing path.

Diff Detail

Event Timeline

rogfer01 updated this revision to Diff 76383.Oct 31 2016, 4:27 AM
rogfer01 retitled this revision from to Protect std::experimental::optional tests under libcpp-no-exceptions.
rogfer01 updated this object.
rogfer01 added reviewers: mclow.lists, EricWF, rmaprath.
rogfer01 added a subscriber: cfe-commits.
EricWF accepted this revision.Nov 4 2016, 6:19 PM
EricWF edited edge metadata.

LGTM after addressing inline comments.

Thanks again!

test/std/experimental/optional/optional.object/optional.object.ctor/copy.pass.cpp
30
#ifdef TEST_HAS_NO_EXCEPTIONS
  if (is_going_to_throw) return;
#else
  try
#endif
41

also add `assert(is_going_to_throw);`

test/std/experimental/optional/optional.object/optional.object.ctor/move.pass.cpp
30

Some comments as above.

This revision is now accepted and ready to land.Nov 4 2016, 6:19 PM
rogfer01 updated this revision to Diff 77018.Nov 7 2016, 12:30 AM
rogfer01 edited edge metadata.

Updated with changes suggested by @EricWF

This revision was automatically updated to reflect the committed changes.