diff options
| author | ljfa-ag <ljfa-ag@web.de> | 2015-08-06 13:47:22 +0200 |
|---|---|---|
| committer | ljfa-ag <ljfa-ag@web.de> | 2015-08-06 13:47:22 +0200 |
| commit | 16a9df1556afc1650bbc883303ab0ee283710ce9 (patch) | |
| tree | b1006f534b3a4412dbfcb96377e6d2d85d5fb4a2 | |
| parent | 8565a07570ccd38209dd593c1116e917cd7c7230 (diff) | |
| download | Project-Tick-16a9df1556afc1650bbc883303ab0ee283710ce9.tar.gz Project-Tick-16a9df1556afc1650bbc883303ab0ee283710ce9.zip | |
Add test for missing tag_end
| -rw-r--r-- | test/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | test/io/errortest_noend | bin | 0 -> 48 bytes | |||
| -rw-r--r-- | test/io/read_test.cpp | 7 |
3 files changed, 9 insertions, 1 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index c24b7b7c23..cffce2ad7b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -15,5 +15,6 @@ target_link_libraries(read_test nbt++) add_custom_command(TARGET read_test POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/io/bigtest_uncompr ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/io/errortest_eof1 ${CMAKE_CURRENT_BINARY_DIR} - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/io/errortest_eof2 ${CMAKE_CURRENT_BINARY_DIR}) + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/io/errortest_eof2 ${CMAKE_CURRENT_BINARY_DIR} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/io/errortest_noend ${CMAKE_CURRENT_BINARY_DIR}) add_test(read_test read_test) diff --git a/test/io/errortest_noend b/test/io/errortest_noend Binary files differnew file mode 100644 index 0000000000..d90614628c --- /dev/null +++ b/test/io/errortest_noend diff --git a/test/io/read_test.cpp b/test/io/read_test.cpp index ab1a46cc97..85970fc069 100644 --- a/test/io/read_test.cpp +++ b/test/io/read_test.cpp @@ -160,6 +160,13 @@ void test_read_errors() ASSERT(file); EXPECT_EXCEPTION(reader.read_tag(), io::input_error); ASSERT(!file); + + //Missing tag_end + file.close(); + file.open("errortest_noend", std::ios::binary); + ASSERT(file); + EXPECT_EXCEPTION(reader.read_tag(), io::input_error); + ASSERT(!file); } int main() |
