Permalink
Browse files

Ne release: fixed configure to test for zlib1g-dev too.

updated NEWS and tests
  • Loading branch information...
kosloot committed Oct 18, 2016
1 parent c77b6e1 commit 8cee93ed2eb2f9cc9abc83a9d0d3e756b793a143
Showing with 64 additions and 25 deletions.
  1. +0 −1 .gitignore
  2. +4 −2 NEWS
  3. +1 −0 README
  4. +2 −2 README.md
  5. +0 −3 bootstrap.sh
  6. +2 −0 configure.ac
  7. +6 −3 src/runtest.cxx
  8. +49 −14 src/zipper.cxx
@@ -45,4 +45,3 @@ tests/Makefile.in
tests/sub1/Makefile
tests/sub1/Makefile.in
ticcutils.pc
README
6 NEWS
@@ -1,12 +1,14 @@
18 oct 2016
18 oct 2016 0.14
[Ko van der Sloot]
- fixed dependecy on zlib1g-dev in configure
- fixed pthread checking in configure
- fixed tests.
- added getatt() member to Configuration class, to get in line with setatt()
and clearatt(). lookUp() still supported

- added code to use TCP_KEEPALIVE. Not used and little tested.

26 jul 2016
26 jul 2016 0.13.1
[Maarten van Gompel]
- Very minor release update to facilitate debian packaging

1 README
@@ -0,0 +1 @@
Please see README.md for for information.
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/LanguageMachines/ticcutils.svg?branch=master)](https://travis-ci.org/LanguageMachines/ticcutils) [![Language Machines Badge](http://applejack.science.ru.nl/lamabadge.php/ticcutils)](http://applejack.science.ru.nl/languagemachines/)
[![Build Status](https://travis-ci.org/LanguageMachines/ticcutils.svg?branch=master)](https://travis-ci.org/LanguageMachines/ticcutils) [![Language Machines Badge](http://applejack.science.ru.nl/lamabadge.php/ticcutils)](http://applejack.science.ru.nl/languagemachines/)

==============
TiCC utils
@@ -38,7 +38,7 @@ following pakages:
- ``autotools``
- ``autoconf-archive``
- ``libxml2-dev``
- preferably also: ``libtar-dev``, ``libbz2-dev``, ``libboost-dev``, ``libboost-regex-dev``
- preferably also: ``libtar-dev``, ``libbz2-dev``, ``zlib1g-dev``, ``libboost-dev``, ``libboost-regex-dev``

--------------------------------
Installation Instructions
@@ -21,8 +21,6 @@
automake=automake
aclocal=aclocal

ln -s README.md README

# if you want to autogenerate a ChangeLog form svn:
#
# svn2cl, a python script, as used in the GNU Enterprise project.
@@ -87,4 +85,3 @@ AUTOMAKE=automake ACLOCAL=aclocal autoreconf --install \
# aclocal-1.9 \
# && automake-1.9 --add-missing --verbose --gnu \
# && autoconf

@@ -39,6 +39,8 @@ else
fi

#checks for libraries.
AX_CHECK_ZLIB( [],
[AC_MSG_NOTICE([libzlib1g-dev not found. gz support disabled.])] )

# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h sys/socket.h unistd.h sys/time.h])
@@ -390,9 +390,6 @@ void test_bz2compression( const string& path ){
assertEqual( buffer.substr(0,4), "This" );
string cmd = "diff " + path + "small.txt bzout.txt";
assertEqual( system( cmd.c_str() ), 0 );
assertTrue( gzDecompress( path + "nasty.bz2", "nasty.txt" ) );
cmd = "diff " + path + "nasty.bz2 nasty.txt";
assertEqual( system(cmd.c_str()), 0 );
}

void test_gzcompression( const string& path ){
@@ -571,9 +568,15 @@ int main( const int argc, const char* argv[] ){
string testdir;
bool dummy;
opts1.is_present( 'd', testdir, dummy );
#ifdef HAVE_BZLIB_H
test_bz2compression( testdir );
#endif
#ifdef HAVE_LIBZ
test_gzcompression( testdir );
#endif
#ifdef HAVE_LIBTAR_H
test_tar( testdir );
#endif
test_fileutils( testdir );
test_configuration( testdir );
test_logstream( testdir );
@@ -33,7 +33,9 @@
#include "bzlib.h"
#include "ticcutils/bz2stream.h"
#endif
#ifdef HAVE_LIBZ
#include "ticcutils/gzstream.h"
#endif

using namespace std;

@@ -44,24 +46,30 @@ namespace TiCC {
throw runtime_error( "unable to execute '" + f +"', BZ2 support not enabled." );
}

bool bz2Compress( const string& inName, const string& outName ){
bz2fail( "bz2Compress()" );
}
bool bz2Decompress( const string& inName, const string& outName ){
bool bz2Compress( const string&, const string& ){
bz2fail( "bz2Compress()" );
return false;
}
bool bz2Decompress( const string&, const string& ){
bz2fail( "bz2Decompress()" );
}
string bz2ReadStream( istream& is ){
return false;
}
string bz2ReadStream( istream& ){
bz2fail( "bz2ReadStream()" );
}
string bz2ReadFile( const string& inName ){
return "false";
}
string bz2ReadFile( const string& ){
bz2fail( "bz2CReadFile()" );
}
bool bz2WriteStream( ostream& outfile, const string& buffer ){
return "false";
}
bool bz2WriteStream( ostream&, const string& ){
bz2fail( "bz2WriteStream()" );
}
bool bz2WriteFile( const string& outName, const string& buffer ){
return false;
}
bool bz2WriteFile( const string&, const string& ){
bz2fail( "bz2WriteFile()" );
}
return false;
}
#else
bool bz2Compress( const string& inName, const string& outName ){
std::ifstream infile( inName, std::ios::binary);
@@ -153,6 +161,33 @@ namespace TiCC {
}
#endif

#ifndef HAVE_LIBZ
bool gzfail( const string&f ){
throw runtime_error( "unable to execute '" + f +"', GZ support not enabled." );
return false;
}
bool gzCompress( const string&, const string& ){
return gzfail( "gzCompress()" );
}
bool gzDecompress( const string&, const string& ){
return gzfail( "gzDecompress()" );
}
string gzReadStream( istream& ){
gzfail( "gzReadStream()" );
return "";
}
string gzReadFile( const string& ){
gzfail( "gzReadFile()" );
return "";
}
bool gzWriteStream( ostream&, const string& ){
return gzfail( "gbzWriteStream()" );
}
bool gzWriteFile( const string&, const string& ){
return gzfail( "gzWriteFile()" );
}

#else
string gzReadStream( istream& is ){
string result;
char c;
@@ -241,6 +276,6 @@ namespace TiCC {
outfile << c;
return true;
}

#endif

}

0 comments on commit 8cee93e

Please sign in to comment.