aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Burdette <bburdette@gmail.com>2020-06-30 11:01:46 -0600
committerBen Burdette <bburdette@gmail.com>2020-06-30 11:01:46 -0600
commita0705e0dd152f2a19d096d02024723a5614c7726 (patch)
tree5a53ba43e8818f6673ea7417645dafce6150f5f3
parente72a16a339092359e58ac7626ea89d4182b26642 (diff)
invalid pos check
-rw-r--r--src/libutil/tests/logging.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libutil/tests/logging.cc b/src/libutil/tests/logging.cc
index 6a6fb4ac3..6a58b9425 100644
--- a/src/libutil/tests/logging.cc
+++ b/src/libutil/tests/logging.cc
@@ -289,4 +289,22 @@ namespace nix {
"what about this " ANSI_YELLOW "%3%" ANSI_NORMAL " " ANSI_YELLOW "one" ANSI_NORMAL);
}
+
+ /* ----------------------------------------------------------------------------
+ * ErrPos
+ * --------------------------------------------------------------------------*/
+
+ TEST(errpos, invalidPos) {
+
+ // contains an invalid symbol, which we should not dereference!
+ Pos invalid;
+
+ // constructing without access violation.
+ ErrPos ep(invalid);
+
+ // assignment without access violation.
+ ep = invalid;
+
+ }
+
}