[PATCH] D26139: Tests for strings conversions under libcpp-no-exceptions

Roger Ferrer Ibanez via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 31 03:52:33 PDT 2016


rogfer01 created this revision.
rogfer01 added reviewers: mclow.lists, EricWF, rmaprath.
rogfer01 added a subscriber: cfe-commits.

These files have two styles of tests

  // First style
  try {
    action
    assert(something-expected);
  } catch ( exception ) {
    assert(false);
  }
  
  // Second style
  try {
    action
    assert(false);
  } catch ( exception ) {
    assert(something-expected);
  }

Under libcpp-no-exceptions, we still want to run what is inside the try
block (but not the catch) for first style tests. Second style tests are
skipped as a whole.

Conversions from integers only feature second style tests.

The diff is a bit noisy because it still has to skip `try` keywords
for first style tests. I prefer this to adding a magical TEST_TRY macro
here (catch blocks would look weird and introducing a TEST_CASE macro
does not look appealing to me either)


https://reviews.llvm.org/D26139

Files:
  test/std/strings/string.conversions/stod.pass.cpp
  test/std/strings/string.conversions/stof.pass.cpp
  test/std/strings/string.conversions/stoi.pass.cpp
  test/std/strings/string.conversions/stol.pass.cpp
  test/std/strings/string.conversions/stold.pass.cpp
  test/std/strings/string.conversions/stoll.pass.cpp
  test/std/strings/string.conversions/stoul.pass.cpp
  test/std/strings/string.conversions/stoull.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26139.76373.patch
Type: text/x-patch
Size: 11045 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161031/38aee60d/attachment.bin>


More information about the cfe-commits mailing list