@ -1337,45 +1337,42 @@ static void DoCompressionTest(CompressionType comp) {
}
TEST ( GeneralTableTest , ApproximateOffsetOfCompressed ) {
CompressionType compression_state [ 2 ] ;
int valid = 0 ;
std : : vector < CompressionType > compression_state ;
if ( ! SnappyCompressionSupported ( ) ) {
fprintf ( stderr , " skipping snappy compression tests \n " ) ;
} else {
compression_state [ valid ] = kSnappyCompression ;
valid + + ;
compression_state . push_back ( kSnappyCompression ) ;
}
if ( ! ZlibCompressionSupported ( ) ) {
fprintf ( stderr , " skipping zlib compression tests \n " ) ;
} else {
compression_state [ valid ] = kZlibCompression ;
valid + + ;
compression_state . push_back ( kZlibCompression ) ;
}
// TODO(kailiu) DoCompressionTest() doesn't work with BZip2.
/*
if ( ! BZip2CompressionSupported ( ) ) {
fprintf ( stderr , " skipping bzip2 compression tests \n " ) ;
} else {
compression_state [ valid ] = kBZip2Compression ;
valid + + ;
compression_state . push_back ( kBZip2Compression ) ;
}
*/
if ( ! LZ4CompressionSupported ( ) ) {
fprintf ( stderr , " skipping lz4 compression tests \n " ) ;
} else {
compression_state [ valid ] = kLZ4Compression ;
valid + + ;
compression_state . push_back ( kLZ4Compression ) ;
}
if ( ! LZ4HCCompressionSupported ( ) ) {
fprintf ( stderr , " skipping lz4hc compression tests \n " ) ;
} else {
compression_state [ valid ] = kLZ4HCCompression ;
valid + + ;
compression_state . push_back ( kLZ4HCCompression ) ;
}
for ( int i = 0 ; i < valid ; i + + ) {
DoCompressionTest ( compression_ state[ i ] ) ;
for ( auto state : compression_state ) {
DoCompressionTest ( state ) ;
}
}