[PATCH] D33344: [compiler-rt] Add negative test for boolean flags.
Vitaly Buka via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 18 18:11:22 PDT 2017
vitalybuka created this revision.
Herald added subscribers: dberris, kubamracek.
https://reviews.llvm.org/D33344
Files:
lib/sanitizer_common/tests/sanitizer_flags_test.cc
Index: lib/sanitizer_common/tests/sanitizer_flags_test.cc
===================================================================
--- lib/sanitizer_common/tests/sanitizer_flags_test.cc
+++ lib/sanitizer_common/tests/sanitizer_flags_test.cc
@@ -59,6 +59,14 @@
TestFlag(true, "flag_name=0", false);
TestFlag(true, "flag_name=no", false);
TestFlag(true, "flag_name=false", false);
+
+ EXPECT_DEATH(TestFlag(false, "flag_name", true), "expected '='");
+ EXPECT_DEATH(TestFlag(false, "flag_name=", true),
+ "Invalid value for bool option: ''");
+ EXPECT_DEATH(TestFlag(false, "flag_name=2", true),
+ "Invalid value for bool option: '2'");
+ EXPECT_DEATH(TestFlag(false, "flag_name=-1", true),
+ "Invalid value for bool option: '-1'");
}
TEST(SanitizerCommon, IntFlags) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33344.99514.patch
Type: text/x-patch
Size: 821 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170519/5e6e4ab0/attachment.bin>
More information about the llvm-commits
mailing list