diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2021-05-23 17:50:12 +0200 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2021-07-16 16:59:57 +0200 |
commit | 366590a71672106d8f8a820e79431df7f0c39337 (patch) | |
tree | af530265b03db60f5a9d5f39e7d9f4d098aa12f3 /tests/linux | |
parent | 7c4a957606f5a5b2afc8078228f228c8f87ccce5 (diff) | |
download | vala-366590a71672106d8f8a820e79431df7f0c39337.tar.gz |
tests: Add expected generated C sources
Diffstat (limited to 'tests/linux')
-rw-r--r-- | tests/linux/bug793444.c-expected | 25 | ||||
-rw-r--r-- | tests/linux/file-commandpipe.c-expected | 47 |
2 files changed, 72 insertions, 0 deletions
diff --git a/tests/linux/bug793444.c-expected b/tests/linux/bug793444.c-expected new file mode 100644 index 000000000..0d4973b08 --- /dev/null +++ b/tests/linux/bug793444.c-expected @@ -0,0 +1,25 @@ +/* linux_bug793444.c generated by valac, the Vala compiler + * generated from linux_bug793444.vala, do not modify */ + +#define _GNU_SOURCE + +#include <glib.h> +#include <fcntl.h> + +static void _vala_main (void); + +static void +_vala_main (void) +{ + gint flag = 0; + flag = O_DIRECT; +} + +int +main (int argc, + char ** argv) +{ + _vala_main (); + return 0; +} + diff --git a/tests/linux/file-commandpipe.c-expected b/tests/linux/file-commandpipe.c-expected new file mode 100644 index 000000000..be210e2a6 --- /dev/null +++ b/tests/linux/file-commandpipe.c-expected @@ -0,0 +1,47 @@ +/* linux_file_commandpipe.c generated by valac, the Vala compiler + * generated from linux_file_commandpipe.vala, do not modify */ + +#include <stdio.h> +#include <glib.h> + +#define _pclose0(var) ((var == NULL) ? NULL : (var = (pclose (var), NULL))) +#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); +#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; } +#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; } +#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); + +static void _vala_main (void); + +static void +_vala_main (void) +{ + { + FILE* pipe = NULL; + FILE* _tmp0_; + gint _result_ = 0; + FILE* _tmp1_; + _tmp0_ = popen ("sleep 0", "r"); + pipe = _tmp0_; + _tmp1_ = pipe; + pipe = NULL; + _result_ = pclose (_tmp1_); + _vala_assert (_result_ == 0, "result == 0"); + _pclose0 (pipe); + } + { + FILE* _tmp2_; + FILE* _tmp3_; + _tmp2_ = popen ("ls *", "r"); + _tmp3_ = _tmp2_; + _pclose0 (_tmp3_); + } +} + +int +main (int argc, + char ** argv) +{ + _vala_main (); + return 0; +} + |