From 9e1481f1341f12a41b988d6dcb63e8256d1e54a3 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 7 Nov 2015 11:20:52 +0100 Subject: Adding upstream version 1.14~rc1. Signed-off-by: Daniel Baumann --- testsuite/check.sh | 11 ++++++++++- testsuite/unzcrash.cc | 31 +++++++++++-------------------- 2 files changed, 21 insertions(+), 21 deletions(-) (limited to 'testsuite') diff --git a/testsuite/check.sh b/testsuite/check.sh index 92dcfdd..bd77f02 100755 --- a/testsuite/check.sh +++ b/testsuite/check.sh @@ -1,6 +1,6 @@ #! /bin/sh # check script for Lziprecover - Data recovery tool for lzipped files -# Copyright (C) 2009, 2010, 2011, 2012 Antonio Diaz Diaz. +# Copyright (C) 2009, 2010, 2011, 2012, 2013 Antonio Diaz Diaz. # # This script is free software: you have unlimited permission # to copy, distribute and modify it. @@ -53,6 +53,15 @@ printf . cmp ${in} copy || fail=1 printf . +"${LZIPRECOVER}" -lq +if [ $? != 1 ] ; then fail=1 ; printf - ; else printf . ; fi +"${LZIPRECOVER}" -mq ${bad1_lz} +if [ $? != 1 ] ; then fail=1 ; printf - ; else printf . ; fi +"${LZIPRECOVER}" -Rq +if [ $? != 1 ] ; then fail=1 ; printf - ; else printf . ; fi +"${LZIPRECOVER}" -sq +if [ $? != 1 ] ; then fail=1 ; printf - ; else printf . ; fi + "${LZIPRECOVER}" -D 921-1921 -fo copy ${in_lz} || fail=1 cmp ${inD} copy || fail=1 printf . diff --git a/testsuite/unzcrash.cc b/testsuite/unzcrash.cc index 4c49035..abf61bb 100644 --- a/testsuite/unzcrash.cc +++ b/testsuite/unzcrash.cc @@ -1,7 +1,7 @@ /* Unzcrash - A test program written to test robustness to decompression of corrupted data. Inspired by unzcrash.c from Julian Seward's bzip2. - Copyright (C) 2008, 2009, 2010, 2011, 2012 Antonio Diaz Diaz. + Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013 Antonio Diaz Diaz. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -34,22 +34,12 @@ #error "Environments where CHAR_BIT != 8 are not supported." #endif -#ifndef LLONG_MAX -#define LLONG_MAX 0x7FFFFFFFFFFFFFFFLL -#endif -#ifndef LLONG_MIN -#define LLONG_MIN (-LLONG_MAX - 1LL) -#endif -#ifndef ULLONG_MAX -#define ULLONG_MAX 0xFFFFFFFFFFFFFFFFULL -#endif - namespace { const char * const Program_name = "Unzcrash"; const char * const program_name = "unzcrash"; -const char * const program_year = "2012"; +const char * const program_year = "2013"; const char * invocation_name = 0; int verbosity = 0; @@ -67,11 +57,12 @@ void show_help() "\nOptions:\n" " -h, --help display this help and exit\n" " -V, --version output version information and exit\n" - " -b, --bits=[,]... test -bit errors instead of full byte\n" + " -b, --bits= test N-bit errors instead of full byte\n" " -p, --position= first byte position to test\n" " -q, --quiet suppress all messages\n" " -s, --size= number of byte positions to test\n" " -v, --verbose be verbose (a 2nd -v gives more)\n" + "Examples of : 1 1,2,3 1-4 1,3-5,8\n" "\nReport bugs to lzip-bug@nongnu.org\n" "Lzip home page: http://www.nongnu.org/lzip/lzip.html\n" ); } @@ -99,7 +90,7 @@ void show_error( const char * const msg, const int errcode = 0, std::fprintf( stderr, ": %s", std::strerror( errcode ) ); std::fprintf( stderr, "\n" ); } - if( help && invocation_name && invocation_name[0] ) + if( help ) std::fprintf( stderr, "Try '%s --help' for more information.\n", invocation_name ); } @@ -114,13 +105,13 @@ void internal_error( const char * const msg ) } -long long getnum( const char * const ptr, - const long long llimit = LLONG_MIN + 1, - const long long ulimit = LLONG_MAX ) +unsigned long long getnum( const char * const ptr, + const unsigned long long llimit, + const unsigned long long ulimit ) { errno = 0; - char *tail; - long long result = strtoll( ptr, &tail, 0 ); + char * tail; + unsigned long long result = strtoull( ptr, &tail, 0 ); if( tail == ptr ) { show_error( "Bad or missing numerical argument.", 0, true ); @@ -155,7 +146,7 @@ long long getnum( const char * const ptr, } for( int i = 0; i < exponent; ++i ) { - if( LLONG_MAX / factor >= llabs( result ) ) result *= factor; + if( ulimit / factor >= result ) result *= factor; else { errno = ERANGE; break; } } } -- cgit v1.2.3