summaryrefslogtreecommitdiffstats
path: root/src/web/server/h2o/libh2o/deps/yaml/tests/test-version.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 11:19:16 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 12:07:37 +0000
commitb485aab7e71c1625cfc27e0f92c9509f42378458 (patch)
treeae9abe108601079d1679194de237c9a435ae5b55 /src/web/server/h2o/libh2o/deps/yaml/tests/test-version.c
parentAdding upstream version 1.44.3. (diff)
downloadnetdata-b485aab7e71c1625cfc27e0f92c9509f42378458.tar.xz
netdata-b485aab7e71c1625cfc27e0f92c9509f42378458.zip
Adding upstream version 1.45.3+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/web/server/h2o/libh2o/deps/yaml/tests/test-version.c')
-rw-r--r--src/web/server/h2o/libh2o/deps/yaml/tests/test-version.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/web/server/h2o/libh2o/deps/yaml/tests/test-version.c b/src/web/server/h2o/libh2o/deps/yaml/tests/test-version.c
new file mode 100644
index 000000000..e3e4a1623
--- /dev/null
+++ b/src/web/server/h2o/libh2o/deps/yaml/tests/test-version.c
@@ -0,0 +1,29 @@
+#include <yaml.h>
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#ifdef NDEBUG
+#undef NDEBUG
+#endif
+#include <assert.h>
+
+int
+main(void)
+{
+ int major = -1;
+ int minor = -1;
+ int patch = -1;
+ char buf[64];
+
+ yaml_get_version(&major, &minor, &patch);
+ sprintf(buf, "%d.%d.%d", major, minor, patch);
+ assert(strcmp(buf, yaml_get_version_string()) == 0);
+
+ /* Print structure sizes. */
+ printf("sizeof(token) = %d\n", sizeof(yaml_token_t));
+ printf("sizeof(event) = %d\n", sizeof(yaml_event_t));
+ printf("sizeof(parser) = %d\n", sizeof(yaml_parser_t));
+
+ return 0;
+}