[llvm] r284350 - unittests: Explicitly ignore some return values in crash tests

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 16 15:09:25 PDT 2016


Author: bogner
Date: Sun Oct 16 17:09:24 2016
New Revision: 284350

URL: http://llvm.org/viewvc/llvm-project?rev=284350&view=rev
Log:
unittests: Explicitly ignore some return values in crash tests

Ideally these would actually check that the results are reasonable,
but given that we're looping over so many different kinds of path that
isn't really practical.

Modified:
    llvm/trunk/unittests/Support/Path.cpp

Modified: llvm/trunk/unittests/Support/Path.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/Path.cpp?rev=284350&r1=284349&r2=284350&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/Path.cpp (original)
+++ llvm/trunk/unittests/Support/Path.cpp Sun Oct 16 17:09:24 2016
@@ -122,22 +122,24 @@ TEST(Support, Path) {
     }
     ASSERT_TRUE(ComponentStack.empty());
 
-    path::has_root_path(*i);
-    path::root_path(*i);
-    path::has_root_name(*i);
-    path::root_name(*i);
-    path::has_root_directory(*i);
-    path::root_directory(*i);
-    path::has_parent_path(*i);
-    path::parent_path(*i);
-    path::has_filename(*i);
-    path::filename(*i);
-    path::has_stem(*i);
-    path::stem(*i);
-    path::has_extension(*i);
-    path::extension(*i);
-    path::is_absolute(*i);
-    path::is_relative(*i);
+    // Crash test most of the API - since we're iterating over all of our paths
+    // here there isn't really anything reasonable to assert on in the results.
+    (void)path::has_root_path(*i);
+    (void)path::root_path(*i);
+    (void)path::has_root_name(*i);
+    (void)path::root_name(*i);
+    (void)path::has_root_directory(*i);
+    (void)path::root_directory(*i);
+    (void)path::has_parent_path(*i);
+    (void)path::parent_path(*i);
+    (void)path::has_filename(*i);
+    (void)path::filename(*i);
+    (void)path::has_stem(*i);
+    (void)path::stem(*i);
+    (void)path::has_extension(*i);
+    (void)path::extension(*i);
+    (void)path::is_absolute(*i);
+    (void)path::is_relative(*i);
 
     SmallString<128> temp_store;
     temp_store = *i;




More information about the llvm-commits mailing list