summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPhilip Chimento <philip.chimento@gmail.com>2019-12-14 13:43:53 -0800
committerPhilip Chimento <philip.chimento@gmail.com>2019-12-16 23:12:20 -0500
commit325525dba046d89187fce2b01c84796357eff29e (patch)
tree544a6d493c167361acd4fa87e1d1133f05031348 /tests
parent3c1250fc78f6fdb6957e523416a599a71d8e7f8d (diff)
assertion: Handle C++ try statements
We assume that in any catch blocks, program state has already been modified since an exception has been thrown, so we only look for assertion statements in the try block.
Diffstat (limited to 'tests')
-rw-r--r--tests/assertion-extraction-cpp.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/assertion-extraction-cpp.cpp b/tests/assertion-extraction-cpp.cpp
index cbf79e1..8d52f0c 100644
--- a/tests/assertion-extraction-cpp.cpp
+++ b/tests/assertion-extraction-cpp.cpp
@@ -15,3 +15,18 @@
};
g_return_if_fail (Temp () && some_str);
}
+
+/*
+ * null passed to a callee that requires a non-null argument
+ * assertion_func (NULL, 1, obj);
+ * ~~~~ ^
+ * null passed to a callee that requires a non-null argument
+ * assertion_func (NULL, 3, NULL);
+ * ~~~~ ^
+ */
+{
+ try {
+ g_return_if_fail (some_str);
+ } catch (...) {
+ }
+}