diff options
author | Andrew Bartlett <abartlet@samba.org> | 2008-08-12 17:46:17 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2008-08-12 17:46:17 +1000 |
commit | 7177df5df95c9fc0d2bc36340b948697980f00d3 (patch) | |
tree | 43e9115d1a87dabe743cf5092de56a8bb239e05a /source4/lib/zlib/contrib/iostream2/zstream_test.cpp | |
parent | 5f873a4d8fbcd2eaeabb452ffba059338ed55dfc (diff) | |
parent | 0965b22ec561588201a3a79f1f1e316834c8ce0b (diff) | |
download | samba-7177df5df95c9fc0d2bc36340b948697980f00d3.tar.gz samba-7177df5df95c9fc0d2bc36340b948697980f00d3.tar.bz2 samba-7177df5df95c9fc0d2bc36340b948697980f00d3.zip |
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into 4-0-local
(This used to be commit ce7b1424c711949e6feb0181d3759133b77391ff)
Diffstat (limited to 'source4/lib/zlib/contrib/iostream2/zstream_test.cpp')
-rw-r--r-- | source4/lib/zlib/contrib/iostream2/zstream_test.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/source4/lib/zlib/contrib/iostream2/zstream_test.cpp b/source4/lib/zlib/contrib/iostream2/zstream_test.cpp new file mode 100644 index 0000000000..6273f62d62 --- /dev/null +++ b/source4/lib/zlib/contrib/iostream2/zstream_test.cpp @@ -0,0 +1,25 @@ +#include "zstream.h" +#include <math.h> +#include <stdlib.h> +#include <iomanip.h> + +void main() { + char h[256] = "Hello"; + char* g = "Goodbye"; + ozstream out("temp.gz"); + out < "This works well" < h < g; + out.close(); + + izstream in("temp.gz"); // read it back + char *x = read_string(in), *y = new char[256], z[256]; + in > y > z; + in.close(); + cout << x << endl << y << endl << z << endl; + + out.open("temp.gz"); // try ascii output; zcat temp.gz to see the results + out << setw(50) << setfill('#') << setprecision(20) << x << endl << y << endl << z << endl; + out << z << endl << y << endl << x << endl; + out << 1.1234567890123456789 << endl; + + delete[] x; delete[] y; +} |