add a Timingtests target to check bad behaviour from the streaming engine

* Makefile.am: add a Timingtests target to check bad behaviour
  from the streaming engine
* dbgen.pl dbgenattr.pl: perl script to generate big instances
* xmlreader.c: fix a bad behaviour on large buffer inputs
Daniel
diff --git a/xmlreader.c b/xmlreader.c
index 30451b4..9592008 100644
--- a/xmlreader.c
+++ b/xmlreader.c
@@ -803,7 +803,8 @@
      * Discard the consumed input when needed and possible
      */
     if (reader->mode == XML_TEXTREADER_MODE_INTERACTIVE) {
-	if (reader->cur >= 4096) {
+	if ((reader->cur >= 4096) &&
+	    (inbuf->use - reader->cur <= CHUNK_SIZE)) {
 	    val = xmlBufferShrink(inbuf, reader->cur);
 	    if (val >= 0) {
 		reader->cur -= val;