diff options
author | Brad King <brad.king@kitware.com> | 2012-04-17 14:32:46 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-04-17 15:07:07 (GMT) |
commit | 05604eb9cb7ced290af67dcc392f0a9a10e64386 (patch) | |
tree | a5f1992189bf18999e411a7a251ef6cd8c1c49f3 /Tests/RunCMake/list/EmptyGet0-stderr.txt | |
parent | 3f29f755c7e633752c62c785b42e21bb388fa650 (diff) | |
download | CMake-05604eb9cb7ced290af67dcc392f0a9a10e64386.zip CMake-05604eb9cb7ced290af67dcc392f0a9a10e64386.tar.gz CMake-05604eb9cb7ced290af67dcc392f0a9a10e64386.tar.bz2 |
list: Handle errors on empty lists more gracefully (#13138)
Since commit ed1ea24c (Fix INSERT to allow inserting to empty list,
2006-05-15) the list command allows insertion into an empty list at
index 0. Fix rejection of insertion at non-zero (negative) indices to
present an error message instead of crashing.
While at it, fix the error message of the GET and REMOVE_AT operations
when the list is empty to not present a bogus allowed range.
Add a "RunCMake.list" test to cover failure cases on empty lists.
Diffstat (limited to 'Tests/RunCMake/list/EmptyGet0-stderr.txt')
-rw-r--r-- | Tests/RunCMake/list/EmptyGet0-stderr.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Tests/RunCMake/list/EmptyGet0-stderr.txt b/Tests/RunCMake/list/EmptyGet0-stderr.txt new file mode 100644 index 0000000..0c61b01 --- /dev/null +++ b/Tests/RunCMake/list/EmptyGet0-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at EmptyGet0.cmake:2 \(list\): + list GET given empty list +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ |