summaryrefslogtreecommitdiff
path: root/support/dktools/test-strms.ctr
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/dktools/test-strms.ctr
Initial commit
Diffstat (limited to 'support/dktools/test-strms.ctr')
-rw-r--r--support/dktools/test-strms.ctr36
1 files changed, 36 insertions, 0 deletions
diff --git a/support/dktools/test-strms.ctr b/support/dktools/test-strms.ctr
new file mode 100644
index 0000000000..dd4910804c
--- /dev/null
+++ b/support/dktools/test-strms.ctr
@@ -0,0 +1,36 @@
+
+#include "dk4conf.h"
+
+#include <math.h>
+
+#include "dk4strm.h"
+#include "dk4strmw.h"
+#include "dk4strms.h"
+
+static const char t1[] = { "Dies ist ein Test-String." };
+
+int main(void)
+{
+ dk4_stream_t *wrstr;
+
+ wrstr = dk4stream_open_file_writer("/tmp/test.dat.gz", NULL);
+ if (NULL != wrstr) {
+ dk4stream_serialize_u32(wrstr, 25UL, NULL);
+ dk4stream_serialize_i32(wrstr, -16L, NULL);
+ dk4stream_serialize_string(wrstr, t1, NULL);
+ dk4stream_serialize_u16(wrstr, 50U, NULL);
+ dk4stream_serialize_double(wrstr, M_PI, 1.0e-6, NULL);
+ dk4stream_serialize_i16(wrstr, -32, NULL);
+ dk4stream_serialize_double_0(wrstr, NULL);
+ dk4stream_serialize_u8(wrstr, 100, NULL);
+ dk4stream_serialize_i8(wrstr, -64, NULL);
+ dk4stream_close(wrstr, NULL);
+ }
+ else {
+ }
+ return 0;
+}
+
+
+/* vim: set ai sw=4 ts=4 : */
+