aboutsummaryrefslogtreecommitdiffstats
path: root/dbgenattr.pl
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2003-09-17 22:33:22 +0000
committerDaniel Veillard <veillard@src.gnome.org>2003-09-17 22:33:22 +0000
commitf6bc7c249e4e4a4189bedb5ef756c980491d08d8 (patch)
tree97a97f30c017da298553ff1cfb7f69df5c3704b9 /dbgenattr.pl
parentccc4d2b62ef2ae474b68168135cfbff47c499727 (diff)
downloadandroid_external_libxml2-f6bc7c249e4e4a4189bedb5ef756c980491d08d8.tar.gz
android_external_libxml2-f6bc7c249e4e4a4189bedb5ef756c980491d08d8.tar.bz2
android_external_libxml2-f6bc7c249e4e4a4189bedb5ef756c980491d08d8.zip
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
Diffstat (limited to 'dbgenattr.pl')
-rwxr-xr-xdbgenattr.pl42
1 files changed, 42 insertions, 0 deletions
diff --git a/dbgenattr.pl b/dbgenattr.pl
new file mode 100755
index 00000000..dce11cd8
--- /dev/null
+++ b/dbgenattr.pl
@@ -0,0 +1,42 @@
+#!/usr/bin/perl
+
+$size = shift;
+
+if ($size eq "")
+{
+ die "usage: dbgen.pl [size]\n";
+}
+
+@firstnames = ("Al", "Bob", "Charles", "David", "Egon", "Farbood",
+ "George", "Hank", "Inki", "James");
+@lastnames = ("Aranow", "Barker", "Corsetti", "Dershowitz", "Engleman",
+ "Franklin", "Grice", "Haverford", "Ilvedson", "Jones");
+@states = ("AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA",
+ "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD",
+ "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ",
+ "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC",
+ "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY");
+
+print "<?xml version=\"1.0\"?>\n";
+print "\n";
+print "<table>\n";
+
+for ($i=0; $i<$size; $i++)
+{
+ $first = $firstnames [$i % 10];
+ $last = $lastnames [($i / 10) % 10];
+ $state = $states [($i / 100) % 50];
+ $zip = 22000 + $i / 5000;
+
+ printf " <row\n";
+ printf " id='%04d'\n", $i;
+ printf " firstname='$first'\n", $i;
+ printf " lastname='$last'\n", $i;
+ printf " street='%d Any St.'\n", ($i % 100) + 1;
+ printf " city='Anytown'\n";
+ printf " state='$state'\n";
+ printf " zip='%d'/>\n", $zip;
+}
+
+print "</table>\n";
+