[libcxx-commits] [PATCH] D108321: [SystemZ][z/OS] Avoid assumption for character value in futures tests

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Aug 18 20:46:49 PDT 2021


Quuxplusone requested changes to this revision.
Quuxplusone added inline comments.
This revision now requires changes to proceed.


================
Comment at: libcxx/test/std/thread/futures/futures.task/futures.task.members/operator.pass.cpp:90
         support::make_test_thread(func0, std::move(p)).detach();
-        assert(f.get() == 105.0);
+        assert(f.get() == 8.0 + 'a');
     }
----------------
I suggest that a much //nicer// way to fix all these tests would be to eliminate the `(int, char)` signature and the cast-from-char-to-double entirely. Just have it take `double(int, float)` or something, and pass `4.0` instead of `'a'`.

Slightly less invasive: Leave the `(int, char)` signature, but pass `97` instead of `'a'`.

More invasive, and "clever," but clean-looking: Leave the signature, pass `'0'` instead of `'a'`, and check that the result is `(double)'8'`... no, wait, that would be really dumb. Don't do that. :)

Either way, please upload with full context: use `git show -U999` or `git diff -U999` or whatever the `arc` incantation is.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108321/new/

https://reviews.llvm.org/D108321



More information about the libcxx-commits mailing list