summaryrefslogtreecommitdiff
path: root/tests/generics/foreach-iterator-nullable.c-expected
diff options
context:
space:
mode:
Diffstat (limited to 'tests/generics/foreach-iterator-nullable.c-expected')
-rw-r--r--tests/generics/foreach-iterator-nullable.c-expected98
1 files changed, 98 insertions, 0 deletions
diff --git a/tests/generics/foreach-iterator-nullable.c-expected b/tests/generics/foreach-iterator-nullable.c-expected
new file mode 100644
index 000000000..ba88ee255
--- /dev/null
+++ b/tests/generics/foreach-iterator-nullable.c-expected
@@ -0,0 +1,98 @@
+/* generics_foreach_iterator_nullable.c generated by valac, the Vala compiler
+ * generated from generics_foreach_iterator_nullable.vala, do not modify */
+
+#include <glib.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (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 _g_free0_ (gpointer var);
+
+static void
+_g_free0_ (gpointer var)
+{
+ var = (g_free (var), NULL);
+}
+
+static gconstpointer
+_vala_hash_set_next_value (GHashTableIter *self)
+{
+ void* vi = NULL;
+ GHashTableIter* htp = NULL;
+ void* _tmp0_;
+ gconstpointer value = NULL;
+ gconstpointer _tmp1_ = NULL;
+ gconstpointer _tmp2_ = NULL;
+ gboolean _tmp3_;
+ gconstpointer result;
+ vi = &(*self);
+ _tmp0_ = vi;
+ htp = _tmp0_;
+ _tmp3_ = g_hash_table_iter_next (htp, (gpointer*) (&_tmp2_), (gpointer*) NULL);
+ value = _tmp2_;
+ if (_tmp3_) {
+ gconstpointer _tmp4_;
+ _tmp4_ = value;
+ _tmp1_ = _tmp4_;
+ } else {
+ _tmp1_ = NULL;
+ }
+ result = _tmp1_;
+ return result;
+}
+
+static void
+_vala_main (void)
+{
+ GHashTable* gs = NULL;
+ GHashFunc _tmp0_;
+ GEqualFunc _tmp1_;
+ GHashTable* _tmp2_;
+ GHashTable* _tmp3_;
+ gchar* _tmp4_;
+ _tmp0_ = g_str_hash;
+ _tmp1_ = g_str_equal;
+ _tmp2_ = g_hash_table_new_full (_tmp0_, _tmp1_, NULL, _g_free0_);
+ gs = _tmp2_;
+ _tmp3_ = gs;
+ _tmp4_ = g_strdup ("foo");
+ g_hash_table_add (_tmp3_, _tmp4_);
+ {
+ GHashTableIter _s_it = {0};
+ GHashTable* _tmp5_;
+ GHashTableIter _tmp6_ = {0};
+ const gchar* s = NULL;
+ _tmp5_ = gs;
+ g_hash_table_iter_init (&_tmp6_, _tmp5_);
+ _s_it = _tmp6_;
+ while (TRUE) {
+ gconstpointer _tmp7_;
+ const gchar* _tmp8_;
+ const gchar* _tmp9_;
+ _tmp7_ = _vala_hash_set_next_value (&_s_it);
+ s = (const gchar*) _tmp7_;
+ _tmp8_ = s;
+ if (!(_tmp8_ != NULL)) {
+ break;
+ }
+ _tmp9_ = s;
+ _vala_assert (g_strcmp0 (_tmp9_, "foo") == 0, "s == \"foo\"");
+ }
+ }
+ _g_hash_table_unref0 (gs);
+}
+
+int
+main (int argc,
+ char ** argv)
+{
+ _vala_main ();
+ return 0;
+}
+