[libcxx] r329194 - [libcxx][test] Improve assert message
Jan Korous via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 4 06:31:39 PDT 2018
Author: jkorous
Date: Wed Apr 4 06:31:39 2018
New Revision: 329194
URL: http://llvm.org/viewvc/llvm-project?rev=329194&view=rev
Log:
[libcxx][test] Improve assert message
Modified:
libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.proximate/proximate.pass.cpp
Modified: libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.proximate/proximate.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.proximate/proximate.pass.cpp?rev=329194&r1=329193&r2=329194&view=diff
==============================================================================
--- libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.proximate/proximate.pass.cpp (original)
+++ libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.proximate/proximate.pass.cpp Wed Apr 4 06:31:39 2018
@@ -102,9 +102,17 @@ TEST_CASE(basic_test) {
std::error_code ec = GetTestEC();
fs::path p(TC.input);
const fs::path output = fs::proximate(p, TC.base, ec);
- TEST_CHECK(!ec);
- TEST_CHECK(PathEq(output, TC.expect));
- if (!PathEq(output, TC.expect)) {
+ if (ec) {
+ TEST_CHECK(!ec);
+ std::cerr << "TEST CASE #" << ID << " FAILED: \n";
+ std::cerr << " Input: '" << TC.input << "'\n";
+ std::cerr << " Base: '" << TC.base << "'\n";
+ std::cerr << " Expected: '" << TC.expect << "'\n";
+
+ std::cerr << std::endl;
+ } else if (!PathEq(output, TC.expect)) {
+ TEST_CHECK(PathEq(output, TC.expect));
+
const path canon_input = fs::weakly_canonical(TC.input);
const path canon_base = fs::weakly_canonical(TC.base);
const path lexically_p = canon_input.lexically_proximate(canon_base);
More information about the cfe-commits
mailing list