lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master d82b7fc 1/4: Demonstrate two defects


From: Greg Chicares
Subject: [lmi-commits] [lmi] master d82b7fc 1/4: Demonstrate two defects
Date: Thu, 2 Feb 2017 02:13:13 +0000 (UTC)

branch: master
commit d82b7fc67063cdadb4528b6d41bc68e951f9f674
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Demonstrate two defects
---
 input_seq_test.cpp |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/input_seq_test.cpp b/input_seq_test.cpp
index 0beb299..7562846 100644
--- a/input_seq_test.cpp
+++ b/input_seq_test.cpp
@@ -107,6 +107,26 @@ int test_main(int, char*[])
     //     w: default keyword
     //     o: keywords only
 
+    // Demonstrate a defect: the "expected" error message is of course
+    // not observed, but that should be reported.
+    {
+    int const n = 1;
+    double const d[n] = {0};
+    std::string const e(" ");
+    char const* x = "A mistakenly expected error message.";
+    check(__FILE__, __LINE__, d, n, e, x);
+    }
+
+    // Demonstrate a defect: [21.4.2/9] "shall not be a null pointer".
+    // Typing "x = 0" is a plausible mistake.
+    {
+    int const n = 1;
+    double const d[n] = {0};
+    std::string const e("0 [0,0)");
+    char const* x = 0;
+    check(__FILE__, __LINE__, d, n, e, x);
+    }
+
     // An all-blank string is treated as zero.
     {
     int const n = 9;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]