From 8f4f7eae527775258b4639e393e60d7432b9a445 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 19 Dec 2014 19:55:30 +0100 Subject: [PATCH] tests: add test case for segfaults/assertions from bug 1089 --- tests/results.txt | 1 + tests/test-449segfaults_assertions.rb | 19 +++++++++++++++++++ tests/test.d/simple_test.rb | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100755 tests/test-449segfaults_assertions.rb diff --git a/tests/results.txt b/tests/results.txt index cd8b2c862..b32f75b0b 100644 --- a/tests/results.txt +++ b/tests/results.txt @@ -294,3 +294,4 @@ T_445teletext_subs_missing_second_line:3ae84ffa0e4d96fa0d3ffd76ff06d956:passed:2 T_446mkvinfo_output:c85f150aecd50e5fcdafd78884feda5c-67c709937345391807d6842ac5221e4e-3e3db323b51cd44990ba28abfca53b1c-369ec6054e4171c9125b1d576880522a:passed:20141216-165433:2.799686224 T_447mkvinfo_rounded_timecodes:373f7a58724d15beb41dbc1f809351b5-be742d4b69c9da8746c869ce68378b1a-40400a7a5b44a88ef791a3e57d0a5500:passed:20141216-172642:1.712081143 T_448mpeg_ts_with_hevc:eae8d6e24e1c99ed070b4aec351502f1:passed:20141216-181650:1.133097273 +T_449segfaults_assertions:error-error-04aa38adf31451c85a19f490ca040dd8-e5484c528a96c5f3fd678ea6bd99a8f2-f3b5f64396c7d3907d5d81a2fdc3f077:passed:20141219-195127:0.251063917 diff --git a/tests/test-449segfaults_assertions.rb b/tests/test-449segfaults_assertions.rb new file mode 100755 index 000000000..b0636a1f1 --- /dev/null +++ b/tests/test-449segfaults_assertions.rb @@ -0,0 +1,19 @@ +#!/usr/bin/ruby -w + +# T_449segfaults_assertions +describe "mkvmerge & mkvinfo / segfaults and assertions" + +dir = "data/segfaults-assertions" + +test_merge "#{dir}/1089-1.mkv", :exit_code => :error +test_merge "#{dir}/1089-2.mkv", :exit_code => :error +test_merge "#{dir}/1089-3.mkv" + +test_info "#{dir}/1089-1.mkv", :args => "-v -v" + +# commented out because currently memory is allocated by not read to +# fully, therefore its content is still random. Has to be fixed in +# libmatroska/libebml. +#test_info "#{dir}/1089-2.mkv", :args => "-v -v" + +test_info "#{dir}/1089-3.mkv", :args => "-v -v" diff --git a/tests/test.d/simple_test.rb b/tests/test.d/simple_test.rb index 38a253f76..16abe3d21 100644 --- a/tests/test.d/simple_test.rb +++ b/tests/test.d/simple_test.rb @@ -110,7 +110,7 @@ class SimpleTest :block => lambda { output = options[:output] || tmp merge full_command_line, :exit_code => options[:exit_code], :output => output - options[:keep_tmp] ? hash_file(output) : hash_tmp + options[:exit_code] == :error ? 'error' : options[:keep_tmp] ? hash_file(output) : hash_tmp }, } end