[PATCH] D56519: Filesystem tests: fix fs.op.relative

JF Bastien via Phabricator reviews at reviews.llvm.org
Wed Jan 9 15:37:36 PST 2019


jfb created this revision.
jfb added reviewers: ldionne, mclow.lists, EricWF.
Herald added subscribers: libcxx-commits, dexonsmith, jkorous, christof.

The test wasn't using the testing infrastructure properly.


Repository:
  rCXX libc++

https://reviews.llvm.org/D56519

Files:
  test/std/input.output/filesystems/fs.op.funcs/fs.op.relative/relative.pass.cpp


Index: test/std/input.output/filesystems/fs.op.funcs/fs.op.relative/relative.pass.cpp
===================================================================
--- test/std/input.output/filesystems/fs.op.funcs/fs.op.relative/relative.pass.cpp
+++ test/std/input.output/filesystems/fs.op.funcs/fs.op.relative/relative.pass.cpp
@@ -16,9 +16,8 @@
 // path proximate(const path& p, const path& base, error_code& ec);
 
 #include "filesystem_include.hpp"
+#include <string>
 #include <type_traits>
-#include <vector>
-#include <iostream>
 #include <cassert>
 
 #include "test_macros.h"
@@ -31,9 +30,6 @@
 TEST_SUITE(filesystem_proximate_path_test_suite)
 
 TEST_CASE(test_signature) {
-
-}
-int main() {
   // clang-format off
   struct {
     std::string input;
@@ -58,21 +54,12 @@
   };
   // clang-format on
   int ID = 0;
-  bool Failed = false;
   for (auto& TC : TestCases) {
     ++ID;
     fs::path p(TC.input);
     const fs::path output = fs::weakly_canonical(p);
-    if (output != TC.expect) {
-      Failed = true;
-      std::cerr << "TEST CASE #" << ID << " FAILED: \n";
-      std::cerr << "  Input: '" << TC.input << "'\n";
-      std::cerr << "  Expected: '" << TC.expect << "'\n";
-      std::cerr << "  Output: '" << output.native() << "'";
-      std::cerr << std::endl;
-    }
+    TEST_CHECK(output == TC.expect);
   }
-  return Failed;
 }
 
 TEST_SUITE_END()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56519.180949.patch
Type: text/x-patch
Size: 1372 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190109/118d1081/attachment.bin>


More information about the libcxx-commits mailing list