diff options
Diffstat (limited to 'tests/testdeque.c')
-rw-r--r-- | tests/testdeque.c | 2068 |
1 files changed, 1462 insertions, 606 deletions
diff --git a/tests/testdeque.c b/tests/testdeque.c index 4af05df..8cea5a5 100644 --- a/tests/testdeque.c +++ b/tests/testdeque.c @@ -129,13 +129,15 @@ enum { }; DequeTests* deque_tests_construct (GType object_type, const gchar* name); QueueTests* queue_tests_construct (GType object_type, const gchar* name); -void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target); +void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify); void deque_tests_test_queue_use (DequeTests* self); static void _deque_tests_test_queue_use_gee_test_case_test_method (gpointer self); void deque_tests_test_stack_use (DequeTests* self); static void _deque_tests_test_stack_use_gee_test_case_test_method (gpointer self); void deque_tests_test_reversed_stack_use (DequeTests* self); static void _deque_tests_test_reversed_stack_use_gee_test_case_test_method (gpointer self); +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); static void _deque_tests_test_queue_use_gee_test_case_test_method (gpointer self) { @@ -159,9 +161,9 @@ DequeTests* deque_tests_construct (GType object_type, const gchar* name) { g_return_val_if_fail (name != NULL, NULL); _tmp0_ = name; self = (DequeTests*) queue_tests_construct (object_type, _tmp0_); - gee_test_case_add_test ((GeeTestCase*) self, "[Deque] queue use", _deque_tests_test_queue_use_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[Deque] stack use", _deque_tests_test_stack_use_gee_test_case_test_method, self); - gee_test_case_add_test ((GeeTestCase*) self, "[Deque] reversed stack use", _deque_tests_test_reversed_stack_use_gee_test_case_test_method, self); + gee_test_case_add_test ((GeeTestCase*) self, "[Deque] queue use", _deque_tests_test_queue_use_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Deque] stack use", _deque_tests_test_stack_use_gee_test_case_test_method, g_object_ref (self), g_object_unref); + gee_test_case_add_test ((GeeTestCase*) self, "[Deque] reversed stack use", _deque_tests_test_reversed_stack_use_gee_test_case_test_method, g_object_ref (self), g_object_unref); return self; } @@ -177,221 +179,493 @@ void deque_tests_test_queue_use (DequeTests* self) { GeeDeque* test_deque; GeeArrayList* _tmp2_; GeeArrayList* recipient; - gboolean _tmp3_ = FALSE; - gint _tmp4_; - gint _tmp5_; - gboolean _tmp6_ = FALSE; - gint _tmp7_; - gint _tmp8_; - gboolean _tmp9_ = FALSE; - gint _tmp10_; - gint _tmp11_; - gboolean _tmp12_ = FALSE; - gint _tmp13_; - gint _tmp14_; - gpointer _tmp15_ = NULL; + GeeDeque* _tmp3_; + gchar* _tmp4_; + gchar* _tmp5_; + gchar* _tmp6_; + gchar* _tmp7_; + gchar* _tmp8_; + gchar* _tmp9_; + gchar* _tmp10_; + gchar* _tmp11_; + gchar* _tmp12_; + gchar* _tmp13_; + gchar* _tmp14_; + gchar* _tmp15_; gchar* _tmp16_; - gpointer _tmp17_ = NULL; + gchar* _tmp17_; gchar* _tmp18_; - gint _tmp19_; - gint _tmp20_; - gpointer _tmp21_ = NULL; + gchar* _tmp19_; + gchar* _tmp20_; + gchar* _tmp21_; gchar* _tmp22_; - gpointer _tmp23_ = NULL; + gchar* _tmp23_; gchar* _tmp24_; - gint _tmp25_; - gint _tmp26_; - gpointer _tmp27_ = NULL; + gchar* _tmp25_; + gchar* _tmp26_; + gchar* _tmp27_; gchar* _tmp28_; - gpointer _tmp29_ = NULL; + gchar* _tmp29_; gchar* _tmp30_; - gint _tmp31_; - gint _tmp32_; - gpointer _tmp33_ = NULL; + gchar* _tmp31_; + gchar* _tmp32_; + gchar* _tmp33_; gchar* _tmp34_; - gpointer _tmp35_ = NULL; + gchar* _tmp35_; gchar* _tmp36_; - gint _tmp37_; - gint _tmp38_; - gpointer _tmp39_ = NULL; + gchar* _tmp37_; + gchar* _tmp38_; + gchar* _tmp39_; gchar* _tmp40_; - gpointer _tmp41_ = NULL; + gchar* _tmp41_; gchar* _tmp42_; - gboolean _tmp43_ = FALSE; - gboolean _tmp44_ = FALSE; - gboolean _tmp45_ = FALSE; - gboolean _tmp46_ = FALSE; - gint _tmp47_; - gint _tmp48_; - gint _tmp49_ = 0; - gint _tmp50_; - gint _tmp51_; - gint _tmp52_; - gint _tmp53_; - gpointer _tmp54_ = NULL; - gchar* _tmp55_; - gint _tmp56_ = 0; - gint _tmp57_; - gint _tmp58_; - gint _tmp59_; - gint _tmp60_; - gpointer _tmp61_ = NULL; - gchar* _tmp62_; - gpointer _tmp63_ = NULL; - gchar* _tmp64_; - gpointer _tmp65_ = NULL; - gchar* _tmp66_; - gint _tmp67_ = 0; - gint _tmp68_; - gint _tmp69_; - gint _tmp70_; - gint _tmp71_; - gint _tmp72_ = 0; - gint _tmp73_; - gint _tmp74_; - gint _tmp75_; - gint _tmp76_; + gchar** _tmp43_ = NULL; + gchar** to_offer; + gint to_offer_length1; + gint _to_offer_size_; + GeeDeque* _tmp80_; + gpointer _tmp81_ = NULL; + gchar* _tmp82_; + GeeDeque* _tmp83_; + gpointer _tmp84_ = NULL; + gchar* _tmp85_; + GeeArrayList* _tmp86_; + GeeDeque* _tmp97_; + gint _tmp98_; + gint _tmp99_; + gchar** _tmp100_; + gint _tmp100__length1; + GeeDeque* _tmp101_; + GeeArrayList* _tmp102_; + gint _tmp103_ = 0; + GeeDeque* _tmp104_; + gint _tmp105_; + gint _tmp106_; + gchar** _tmp107_; + gint _tmp107__length1; + GeeArrayList* _tmp108_; + gint _tmp109_; + gint _tmp110_; + GeeArrayList* _tmp111_; + gpointer _tmp112_ = NULL; + gchar* _tmp113_; + gchar** _tmp114_; + gint _tmp114__length1; + const gchar* _tmp115_; + GeeDeque* _tmp116_; + GeeArrayList* _tmp117_; + gint _tmp118_ = 0; + gchar** _tmp119_; + gint _tmp119__length1; + GeeDeque* _tmp120_; + gint _tmp121_; + gint _tmp122_; + GeeArrayList* _tmp123_; + gint _tmp124_; + gint _tmp125_; + gchar** _tmp126_; + gint _tmp126__length1; + GeeArrayList* _tmp139_; + GeeDeque* _tmp140_; + GeeArrayList* _tmp141_; + gint _tmp142_ = 0; + GeeDeque* _tmp143_; + gint _tmp144_; + gint _tmp145_; + GeeArrayList* _tmp146_; + gint _tmp147_; + gint _tmp148_; + GeeArrayList* _tmp149_; + GeeDeque* _tmp150_; + GeeArrayList* _tmp151_; + gint _tmp152_ = 0; + GeeDeque* _tmp153_; + gint _tmp154_; + gint _tmp155_; + GeeArrayList* _tmp156_; + gint _tmp157_; + gint _tmp158_; g_return_if_fail (self != NULL); _tmp0_ = ((CollectionTests*) self)->test_collection; _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_DEQUE) ? ((GeeDeque*) _tmp0_) : NULL); test_deque = _tmp1_; - _tmp2_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL); + _tmp2_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL); recipient = _tmp2_; - _vala_assert (test_deque != NULL, "test_deque != null"); - _tmp3_ = gee_deque_offer_tail (test_deque, "one"); - _vala_assert (_tmp3_, "test_deque.offer_tail (\"one\")"); - _tmp4_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp5_ = _tmp4_; - _vala_assert (_tmp5_ == 1, "test_deque.size == 1"); - _tmp6_ = gee_deque_offer_tail (test_deque, "two"); - _vala_assert (_tmp6_, "test_deque.offer_tail (\"two\")"); - _tmp7_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp8_ = _tmp7_; - _vala_assert (_tmp8_ == 2, "test_deque.size == 2"); - _tmp9_ = gee_deque_offer_tail (test_deque, "three"); - _vala_assert (_tmp9_, "test_deque.offer_tail (\"three\")"); - _tmp10_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp11_ = _tmp10_; - _vala_assert (_tmp11_ == 3, "test_deque.size == 3"); - _tmp12_ = gee_deque_offer_tail (test_deque, "four"); - _vala_assert (_tmp12_, "test_deque.offer_tail (\"four\")"); - _tmp13_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp14_ = _tmp13_; - _vala_assert (_tmp14_ == 4, "test_deque.size == 4"); - _tmp15_ = gee_deque_peek_head (test_deque); - _tmp16_ = (gchar*) _tmp15_; - _vala_assert (g_strcmp0 (_tmp16_, "one") == 0, "test_deque.peek_head () == \"one\""); - _g_free0 (_tmp16_); - _tmp17_ = gee_deque_poll_head (test_deque); - _tmp18_ = (gchar*) _tmp17_; - _vala_assert (g_strcmp0 (_tmp18_, "one") == 0, "test_deque.poll_head () == \"one\""); - _g_free0 (_tmp18_); - _tmp19_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp20_ = _tmp19_; - _vala_assert (_tmp20_ == 3, "test_deque.size == 3"); - _tmp21_ = gee_deque_peek_head (test_deque); - _tmp22_ = (gchar*) _tmp21_; - _vala_assert (g_strcmp0 (_tmp22_, "two") == 0, "test_deque.peek_head () == \"two\""); - _g_free0 (_tmp22_); - _tmp23_ = gee_deque_poll_head (test_deque); - _tmp24_ = (gchar*) _tmp23_; - _vala_assert (g_strcmp0 (_tmp24_, "two") == 0, "test_deque.poll_head () == \"two\""); - _g_free0 (_tmp24_); - _tmp25_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp26_ = _tmp25_; - _vala_assert (_tmp26_ == 2, "test_deque.size == 2"); - _tmp27_ = gee_deque_peek_head (test_deque); - _tmp28_ = (gchar*) _tmp27_; - _vala_assert (g_strcmp0 (_tmp28_, "three") == 0, "test_deque.peek_head () == \"three\""); - _g_free0 (_tmp28_); - _tmp29_ = gee_deque_poll_head (test_deque); - _tmp30_ = (gchar*) _tmp29_; - _vala_assert (g_strcmp0 (_tmp30_, "three") == 0, "test_deque.poll_head () == \"three\""); - _g_free0 (_tmp30_); - _tmp31_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp32_ = _tmp31_; - _vala_assert (_tmp32_ == 1, "test_deque.size == 1"); - _tmp33_ = gee_deque_peek_head (test_deque); - _tmp34_ = (gchar*) _tmp33_; - _vala_assert (g_strcmp0 (_tmp34_, "four") == 0, "test_deque.peek_head () == \"four\""); - _g_free0 (_tmp34_); - _tmp35_ = gee_deque_poll_head (test_deque); - _tmp36_ = (gchar*) _tmp35_; - _vala_assert (g_strcmp0 (_tmp36_, "four") == 0, "test_deque.poll_head () == \"four\""); - _g_free0 (_tmp36_); - _tmp37_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp38_ = _tmp37_; - _vala_assert (_tmp38_ == 0, "test_deque.size == 0"); - _tmp39_ = gee_deque_peek_head (test_deque); - _tmp40_ = (gchar*) _tmp39_; - _vala_assert (_tmp40_ == NULL, "test_deque.peek_head () == null"); - _g_free0 (_tmp40_); - _tmp41_ = gee_deque_poll_head (test_deque); - _tmp42_ = (gchar*) _tmp41_; - _vala_assert (_tmp42_ == NULL, "test_deque.poll_head () == null"); - _g_free0 (_tmp42_); - gee_abstract_collection_clear ((GeeAbstractCollection*) recipient); - _tmp43_ = gee_deque_offer_tail (test_deque, "one"); - _vala_assert (_tmp43_, "test_deque.offer_tail (\"one\")"); - _tmp44_ = gee_deque_offer_tail (test_deque, "two"); - _vala_assert (_tmp44_, "test_deque.offer_tail (\"two\")"); - _tmp45_ = gee_deque_offer_tail (test_deque, "three"); - _vala_assert (_tmp45_, "test_deque.offer_tail (\"three\")"); - _tmp46_ = gee_deque_offer_tail (test_deque, "four"); - _vala_assert (_tmp46_, "test_deque.offer_tail (\"four\")"); - _tmp47_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp48_ = _tmp47_; - _vala_assert (_tmp48_ == 4, "test_deque.size == 4"); - _tmp49_ = gee_deque_drain_head (test_deque, (GeeCollection*) recipient, 1); - _vala_assert (_tmp49_ == 1, "test_deque.drain_head (recipient, 1) == 1"); - _tmp50_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp51_ = _tmp50_; - _vala_assert (_tmp51_ == 3, "test_deque.size == 3"); - _tmp52_ = gee_abstract_collection_get_size ((GeeCollection*) recipient); - _tmp53_ = _tmp52_; - _vala_assert (_tmp53_ == 1, "recipient.size == 1"); - _tmp54_ = gee_abstract_list_get ((GeeAbstractList*) recipient, 0); - _tmp55_ = (gchar*) _tmp54_; - _vala_assert (g_strcmp0 (_tmp55_, "one") == 0, "recipient.get (0) == \"one\""); - _g_free0 (_tmp55_); - _tmp56_ = gee_deque_drain_head (test_deque, (GeeCollection*) recipient, -1); - _vala_assert (_tmp56_ == 3, "test_deque.drain_head (recipient) == 3"); - _tmp57_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp58_ = _tmp57_; - _vala_assert (_tmp58_ == 0, "test_deque.size == 0"); - _tmp59_ = gee_abstract_collection_get_size ((GeeCollection*) recipient); - _tmp60_ = _tmp59_; - _vala_assert (_tmp60_ == 4, "recipient.size == 4"); - _tmp61_ = gee_abstract_list_get ((GeeAbstractList*) recipient, 1); - _tmp62_ = (gchar*) _tmp61_; - _vala_assert (g_strcmp0 (_tmp62_, "two") == 0, "recipient.get (1) == \"two\""); - _g_free0 (_tmp62_); - _tmp63_ = gee_abstract_list_get ((GeeAbstractList*) recipient, 2); - _tmp64_ = (gchar*) _tmp63_; - _vala_assert (g_strcmp0 (_tmp64_, "three") == 0, "recipient.get (2) == \"three\""); - _g_free0 (_tmp64_); - _tmp65_ = gee_abstract_list_get ((GeeAbstractList*) recipient, 3); - _tmp66_ = (gchar*) _tmp65_; - _vala_assert (g_strcmp0 (_tmp66_, "four") == 0, "recipient.get (3) == \"four\""); - _g_free0 (_tmp66_); - gee_abstract_collection_clear ((GeeAbstractCollection*) recipient); - _tmp67_ = gee_deque_drain_head (test_deque, (GeeCollection*) recipient, 1); - _vala_assert (_tmp67_ == 0, "test_deque.drain_head (recipient, 1) == 0"); - _tmp68_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp69_ = _tmp68_; - _vala_assert (_tmp69_ == 0, "test_deque.size == 0"); - _tmp70_ = gee_abstract_collection_get_size ((GeeCollection*) recipient); - _tmp71_ = _tmp70_; - _vala_assert (_tmp71_ == 0, "recipient.size == 0"); - gee_abstract_collection_clear ((GeeAbstractCollection*) recipient); - _tmp72_ = gee_deque_drain_head (test_deque, (GeeCollection*) recipient, -1); - _vala_assert (_tmp72_ == 0, "test_deque.drain_head (recipient) == 0"); - _tmp73_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp74_ = _tmp73_; - _vala_assert (_tmp74_ == 0, "test_deque.size == 0"); - _tmp75_ = gee_abstract_collection_get_size ((GeeCollection*) recipient); - _tmp76_ = _tmp75_; - _vala_assert (_tmp76_ == 0, "recipient.size == 0"); + _tmp3_ = test_deque; + _vala_assert (_tmp3_ != NULL, "test_deque != null"); + _tmp4_ = g_strdup ("one"); + _tmp5_ = g_strdup ("two"); + _tmp6_ = g_strdup ("three"); + _tmp7_ = g_strdup ("four"); + _tmp8_ = g_strdup ("five"); + _tmp9_ = g_strdup ("six"); + _tmp10_ = g_strdup ("seven"); + _tmp11_ = g_strdup ("\neight"); + _tmp12_ = g_strdup ("nine"); + _tmp13_ = g_strdup ("ten"); + _tmp14_ = g_strdup ("eleven"); + _tmp15_ = g_strdup ("twelve"); + _tmp16_ = g_strdup ("thirteen"); + _tmp17_ = g_strdup ("fourteen\n"); + _tmp18_ = g_strdup ("fifteen"); + _tmp19_ = g_strdup ("sixteen"); + _tmp20_ = g_strdup ("seventeen"); + _tmp21_ = g_strdup ("eighteen"); + _tmp22_ = g_strdup ("nineteen\n"); + _tmp23_ = g_strdup ("twenty"); + _tmp24_ = g_strdup ("twenty one"); + _tmp25_ = g_strdup ("twenty two"); + _tmp26_ = g_strdup ("twenty three"); + _tmp27_ = g_strdup ("twenty four"); + _tmp28_ = g_strdup ("twenty five"); + _tmp29_ = g_strdup ("twenty six"); + _tmp30_ = g_strdup ("twenty seven"); + _tmp31_ = g_strdup ("twenty eight"); + _tmp32_ = g_strdup ("twenty nine"); + _tmp33_ = g_strdup ("thirty"); + _tmp34_ = g_strdup ("thirty one"); + _tmp35_ = g_strdup ("thirty two"); + _tmp36_ = g_strdup ("thirty four"); + _tmp37_ = g_strdup ("thirty five"); + _tmp38_ = g_strdup ("thirty six"); + _tmp39_ = g_strdup ("thirty seven"); + _tmp40_ = g_strdup ("thirty eight"); + _tmp41_ = g_strdup ("thirty nine"); + _tmp42_ = g_strdup ("fourty"); + _tmp43_ = g_new0 (gchar*, 39 + 1); + _tmp43_[0] = _tmp4_; + _tmp43_[1] = _tmp5_; + _tmp43_[2] = _tmp6_; + _tmp43_[3] = _tmp7_; + _tmp43_[4] = _tmp8_; + _tmp43_[5] = _tmp9_; + _tmp43_[6] = _tmp10_; + _tmp43_[7] = _tmp11_; + _tmp43_[8] = _tmp12_; + _tmp43_[9] = _tmp13_; + _tmp43_[10] = _tmp14_; + _tmp43_[11] = _tmp15_; + _tmp43_[12] = _tmp16_; + _tmp43_[13] = _tmp17_; + _tmp43_[14] = _tmp18_; + _tmp43_[15] = _tmp19_; + _tmp43_[16] = _tmp20_; + _tmp43_[17] = _tmp21_; + _tmp43_[18] = _tmp22_; + _tmp43_[19] = _tmp23_; + _tmp43_[20] = _tmp24_; + _tmp43_[21] = _tmp25_; + _tmp43_[22] = _tmp26_; + _tmp43_[23] = _tmp27_; + _tmp43_[24] = _tmp28_; + _tmp43_[25] = _tmp29_; + _tmp43_[26] = _tmp30_; + _tmp43_[27] = _tmp31_; + _tmp43_[28] = _tmp32_; + _tmp43_[29] = _tmp33_; + _tmp43_[30] = _tmp34_; + _tmp43_[31] = _tmp35_; + _tmp43_[32] = _tmp36_; + _tmp43_[33] = _tmp37_; + _tmp43_[34] = _tmp38_; + _tmp43_[35] = _tmp39_; + _tmp43_[36] = _tmp40_; + _tmp43_[37] = _tmp41_; + _tmp43_[38] = _tmp42_; + to_offer = _tmp43_; + to_offer_length1 = 39; + _to_offer_size_ = to_offer_length1; + { + gint i; + i = 0; + { + gboolean _tmp44_; + _tmp44_ = TRUE; + while (TRUE) { + gboolean _tmp45_; + gint _tmp47_; + gchar** _tmp48_; + gint _tmp48__length1; + GeeDeque* _tmp49_; + gchar** _tmp50_; + gint _tmp50__length1; + gint _tmp51_; + const gchar* _tmp52_; + gboolean _tmp53_ = FALSE; + GeeDeque* _tmp54_; + gint _tmp55_; + gint _tmp56_; + gint _tmp57_; + _tmp45_ = _tmp44_; + if (!_tmp45_) { + gint _tmp46_; + _tmp46_ = i; + i = _tmp46_ + 1; + } + _tmp44_ = FALSE; + _tmp47_ = i; + _tmp48_ = to_offer; + _tmp48__length1 = to_offer_length1; + if (!(_tmp47_ < _tmp48__length1)) { + break; + } + _tmp49_ = test_deque; + _tmp50_ = to_offer; + _tmp50__length1 = to_offer_length1; + _tmp51_ = i; + _tmp52_ = _tmp50_[_tmp51_]; + _tmp53_ = gee_deque_offer_tail (_tmp49_, _tmp52_); + _vala_assert (_tmp53_, "test_deque.offer_tail (to_offer[i])"); + _tmp54_ = test_deque; + _tmp55_ = gee_collection_get_size ((GeeCollection*) _tmp54_); + _tmp56_ = _tmp55_; + _tmp57_ = i; + _vala_assert (_tmp56_ == (_tmp57_ + 1), "test_deque.size == i + 1"); + } + } + } + { + gint i; + i = 0; + { + gboolean _tmp58_; + _tmp58_ = TRUE; + while (TRUE) { + gboolean _tmp59_; + gint _tmp61_; + gchar** _tmp62_; + gint _tmp62__length1; + GeeDeque* _tmp63_; + gpointer _tmp64_ = NULL; + gchar* _tmp65_; + gchar** _tmp66_; + gint _tmp66__length1; + gint _tmp67_; + const gchar* _tmp68_; + GeeDeque* _tmp69_; + gpointer _tmp70_ = NULL; + gchar* _tmp71_; + gchar** _tmp72_; + gint _tmp72__length1; + gint _tmp73_; + const gchar* _tmp74_; + GeeDeque* _tmp75_; + gint _tmp76_; + gint _tmp77_; + gchar** _tmp78_; + gint _tmp78__length1; + gint _tmp79_; + _tmp59_ = _tmp58_; + if (!_tmp59_) { + gint _tmp60_; + _tmp60_ = i; + i = _tmp60_ + 1; + } + _tmp58_ = FALSE; + _tmp61_ = i; + _tmp62_ = to_offer; + _tmp62__length1 = to_offer_length1; + if (!(_tmp61_ < _tmp62__length1)) { + break; + } + _tmp63_ = test_deque; + _tmp64_ = gee_deque_peek_head (_tmp63_); + _tmp65_ = (gchar*) _tmp64_; + _tmp66_ = to_offer; + _tmp66__length1 = to_offer_length1; + _tmp67_ = i; + _tmp68_ = _tmp66_[_tmp67_]; + _vala_assert (g_strcmp0 (_tmp65_, _tmp68_) == 0, "test_deque.peek_head () == to_offer[i]"); + _g_free0 (_tmp65_); + _tmp69_ = test_deque; + _tmp70_ = gee_deque_poll_head (_tmp69_); + _tmp71_ = (gchar*) _tmp70_; + _tmp72_ = to_offer; + _tmp72__length1 = to_offer_length1; + _tmp73_ = i; + _tmp74_ = _tmp72_[_tmp73_]; + _vala_assert (g_strcmp0 (_tmp71_, _tmp74_) == 0, "test_deque.poll_head () == to_offer[i]"); + _g_free0 (_tmp71_); + _tmp75_ = test_deque; + _tmp76_ = gee_collection_get_size ((GeeCollection*) _tmp75_); + _tmp77_ = _tmp76_; + _tmp78_ = to_offer; + _tmp78__length1 = to_offer_length1; + _tmp79_ = i; + _vala_assert (_tmp77_ == ((_tmp78__length1 - _tmp79_) - 1), "test_deque.size == to_offer.length - i - 1"); + } + } + } + _tmp80_ = test_deque; + _tmp81_ = gee_deque_peek_head (_tmp80_); + _tmp82_ = (gchar*) _tmp81_; + _vala_assert (_tmp82_ == NULL, "test_deque.peek_head () == null"); + _g_free0 (_tmp82_); + _tmp83_ = test_deque; + _tmp84_ = gee_deque_poll_head (_tmp83_); + _tmp85_ = (gchar*) _tmp84_; + _vala_assert (_tmp85_ == NULL, "test_deque.poll_head () == null"); + _g_free0 (_tmp85_); + _tmp86_ = recipient; + gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp86_); + { + gint i; + i = 0; + { + gboolean _tmp87_; + _tmp87_ = TRUE; + while (TRUE) { + gboolean _tmp88_; + gint _tmp90_; + gchar** _tmp91_; + gint _tmp91__length1; + GeeDeque* _tmp92_; + gchar** _tmp93_; + gint _tmp93__length1; + gint _tmp94_; + const gchar* _tmp95_; + gboolean _tmp96_ = FALSE; + _tmp88_ = _tmp87_; + if (!_tmp88_) { + gint _tmp89_; + _tmp89_ = i; + i = _tmp89_ + 1; + } + _tmp87_ = FALSE; + _tmp90_ = i; + _tmp91_ = to_offer; + _tmp91__length1 = to_offer_length1; + if (!(_tmp90_ < _tmp91__length1)) { + break; + } + _tmp92_ = test_deque; + _tmp93_ = to_offer; + _tmp93__length1 = to_offer_length1; + _tmp94_ = i; + _tmp95_ = _tmp93_[_tmp94_]; + _tmp96_ = gee_deque_offer_tail (_tmp92_, _tmp95_); + _vala_assert (_tmp96_, "test_deque.offer_tail (to_offer[i])"); + } + } + } + _tmp97_ = test_deque; + _tmp98_ = gee_collection_get_size ((GeeCollection*) _tmp97_); + _tmp99_ = _tmp98_; + _tmp100_ = to_offer; + _tmp100__length1 = to_offer_length1; + _vala_assert (_tmp99_ == _tmp100__length1, "test_deque.size == to_offer.length"); + _tmp101_ = test_deque; + _tmp102_ = recipient; + _tmp103_ = gee_deque_drain_head (_tmp101_, (GeeCollection*) _tmp102_, 1); + _vala_assert (_tmp103_ == 1, "test_deque.drain_head (recipient, 1) == 1"); + _tmp104_ = test_deque; + _tmp105_ = gee_collection_get_size ((GeeCollection*) _tmp104_); + _tmp106_ = _tmp105_; + _tmp107_ = to_offer; + _tmp107__length1 = to_offer_length1; + _vala_assert (_tmp106_ == (_tmp107__length1 - 1), "test_deque.size == to_offer.length - 1"); + _tmp108_ = recipient; + _tmp109_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp108_); + _tmp110_ = _tmp109_; + _vala_assert (_tmp110_ == 1, "recipient.size == 1"); + _tmp111_ = recipient; + _tmp112_ = gee_abstract_list_get ((GeeAbstractList*) _tmp111_, 0); + _tmp113_ = (gchar*) _tmp112_; + _tmp114_ = to_offer; + _tmp114__length1 = to_offer_length1; + _tmp115_ = _tmp114_[0]; + _vala_assert (g_strcmp0 (_tmp113_, _tmp115_) == 0, "recipient.get (0) == to_offer[0]"); + _g_free0 (_tmp113_); + _tmp116_ = test_deque; + _tmp117_ = recipient; + _tmp118_ = gee_deque_drain_head (_tmp116_, (GeeCollection*) _tmp117_, -1); + _tmp119_ = to_offer; + _tmp119__length1 = to_offer_length1; + _vala_assert (_tmp118_ == (_tmp119__length1 - 1), "test_deque.drain_head (recipient) == to_offer.length - 1"); + _tmp120_ = test_deque; + _tmp121_ = gee_collection_get_size ((GeeCollection*) _tmp120_); + _tmp122_ = _tmp121_; + _vala_assert (_tmp122_ == 0, "test_deque.size == 0"); + _tmp123_ = recipient; + _tmp124_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp123_); + _tmp125_ = _tmp124_; + _tmp126_ = to_offer; + _tmp126__length1 = to_offer_length1; + _vala_assert (_tmp125_ == _tmp126__length1, "recipient.size == to_offer.length"); + { + gint i; + i = 1; + { + gboolean _tmp127_; + _tmp127_ = TRUE; + while (TRUE) { + gboolean _tmp128_; + gint _tmp130_; + gchar** _tmp131_; + gint _tmp131__length1; + GeeArrayList* _tmp132_; + gint _tmp133_; + gpointer _tmp134_ = NULL; + gchar* _tmp135_; + gchar** _tmp136_; + gint _tmp136__length1; + gint _tmp137_; + const gchar* _tmp138_; + _tmp128_ = _tmp127_; + if (!_tmp128_) { + gint _tmp129_; + _tmp129_ = i; + i = _tmp129_ + 1; + } + _tmp127_ = FALSE; + _tmp130_ = i; + _tmp131_ = to_offer; + _tmp131__length1 = to_offer_length1; + if (!(_tmp130_ < _tmp131__length1)) { + break; + } + _tmp132_ = recipient; + _tmp133_ = i; + _tmp134_ = gee_abstract_list_get ((GeeAbstractList*) _tmp132_, _tmp133_); + _tmp135_ = (gchar*) _tmp134_; + _tmp136_ = to_offer; + _tmp136__length1 = to_offer_length1; + _tmp137_ = i; + _tmp138_ = _tmp136_[_tmp137_]; + _vala_assert (g_strcmp0 (_tmp135_, _tmp138_) == 0, "recipient.get (i) == to_offer[i]"); + _g_free0 (_tmp135_); + } + } + } + _tmp139_ = recipient; + gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp139_); + _tmp140_ = test_deque; + _tmp141_ = recipient; + _tmp142_ = gee_deque_drain_head (_tmp140_, (GeeCollection*) _tmp141_, 1); + _vala_assert (_tmp142_ == 0, "test_deque.drain_head (recipient, 1) == 0"); + _tmp143_ = test_deque; + _tmp144_ = gee_collection_get_size ((GeeCollection*) _tmp143_); + _tmp145_ = _tmp144_; + _vala_assert (_tmp145_ == 0, "test_deque.size == 0"); + _tmp146_ = recipient; + _tmp147_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp146_); + _tmp148_ = _tmp147_; + _vala_assert (_tmp148_ == 0, "recipient.size == 0"); + _tmp149_ = recipient; + gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp149_); + _tmp150_ = test_deque; + _tmp151_ = recipient; + _tmp152_ = gee_deque_drain_head (_tmp150_, (GeeCollection*) _tmp151_, -1); + _vala_assert (_tmp152_ == 0, "test_deque.drain_head (recipient) == 0"); + _tmp153_ = test_deque; + _tmp154_ = gee_collection_get_size ((GeeCollection*) _tmp153_); + _tmp155_ = _tmp154_; + _vala_assert (_tmp155_ == 0, "test_deque.size == 0"); + _tmp156_ = recipient; + _tmp157_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp156_); + _tmp158_ = _tmp157_; + _vala_assert (_tmp158_ == 0, "recipient.size == 0"); + to_offer = (_vala_array_free (to_offer, to_offer_length1, (GDestroyNotify) g_free), NULL); _g_object_unref0 (recipient); _g_object_unref0 (test_deque); } @@ -403,221 +677,497 @@ void deque_tests_test_stack_use (DequeTests* self) { GeeDeque* test_deque; GeeArrayList* _tmp2_; GeeArrayList* recipient; - gboolean _tmp3_ = FALSE; - gint _tmp4_; - gint _tmp5_; - gboolean _tmp6_ = FALSE; - gint _tmp7_; - gint _tmp8_; - gboolean _tmp9_ = FALSE; - gint _tmp10_; - gint _tmp11_; - gboolean _tmp12_ = FALSE; - gint _tmp13_; - gint _tmp14_; - gpointer _tmp15_ = NULL; + gchar* _tmp3_; + gchar* _tmp4_; + gchar* _tmp5_; + gchar* _tmp6_; + gchar* _tmp7_; + gchar* _tmp8_; + gchar* _tmp9_; + gchar* _tmp10_; + gchar* _tmp11_; + gchar* _tmp12_; + gchar* _tmp13_; + gchar* _tmp14_; + gchar* _tmp15_; gchar* _tmp16_; - gpointer _tmp17_ = NULL; + gchar* _tmp17_; gchar* _tmp18_; - gint _tmp19_; - gint _tmp20_; - gpointer _tmp21_ = NULL; + gchar* _tmp19_; + gchar* _tmp20_; + gchar* _tmp21_; gchar* _tmp22_; - gpointer _tmp23_ = NULL; + gchar* _tmp23_; gchar* _tmp24_; - gint _tmp25_; - gint _tmp26_; - gpointer _tmp27_ = NULL; + gchar* _tmp25_; + gchar* _tmp26_; + gchar* _tmp27_; gchar* _tmp28_; - gpointer _tmp29_ = NULL; + gchar* _tmp29_; gchar* _tmp30_; - gint _tmp31_; - gint _tmp32_; - gpointer _tmp33_ = NULL; + gchar* _tmp31_; + gchar* _tmp32_; + gchar* _tmp33_; gchar* _tmp34_; - gpointer _tmp35_ = NULL; + gchar* _tmp35_; gchar* _tmp36_; - gint _tmp37_; - gint _tmp38_; - gpointer _tmp39_ = NULL; + gchar* _tmp37_; + gchar* _tmp38_; + gchar* _tmp39_; gchar* _tmp40_; - gpointer _tmp41_ = NULL; - gchar* _tmp42_; - gboolean _tmp43_ = FALSE; - gboolean _tmp44_ = FALSE; - gboolean _tmp45_ = FALSE; - gboolean _tmp46_ = FALSE; - gint _tmp47_; - gint _tmp48_; - gint _tmp49_ = 0; - gint _tmp50_; - gint _tmp51_; - gint _tmp52_; - gint _tmp53_; - gpointer _tmp54_ = NULL; - gchar* _tmp55_; - gint _tmp56_ = 0; - gint _tmp57_; - gint _tmp58_; - gint _tmp59_; - gint _tmp60_; - gpointer _tmp61_ = NULL; - gchar* _tmp62_; - gpointer _tmp63_ = NULL; - gchar* _tmp64_; - gpointer _tmp65_ = NULL; - gchar* _tmp66_; - gint _tmp67_ = 0; - gint _tmp68_; - gint _tmp69_; - gint _tmp70_; - gint _tmp71_; - gint _tmp72_ = 0; - gint _tmp73_; - gint _tmp74_; - gint _tmp75_; - gint _tmp76_; + gchar* _tmp41_; + gchar** _tmp42_ = NULL; + gchar** to_offer; + gint to_offer_length1; + gint _to_offer_size_; + GeeDeque* _tmp43_; + GeeDeque* _tmp79_; + gpointer _tmp80_ = NULL; + gchar* _tmp81_; + GeeDeque* _tmp82_; + gpointer _tmp83_ = NULL; + gchar* _tmp84_; + GeeArrayList* _tmp85_; + GeeDeque* _tmp96_; + gint _tmp97_; + gint _tmp98_; + gchar** _tmp99_; + gint _tmp99__length1; + GeeDeque* _tmp100_; + GeeArrayList* _tmp101_; + gint _tmp102_ = 0; + GeeDeque* _tmp103_; + gint _tmp104_; + gint _tmp105_; + gchar** _tmp106_; + gint _tmp106__length1; + GeeArrayList* _tmp107_; + gint _tmp108_; + gint _tmp109_; + GeeArrayList* _tmp110_; + gpointer _tmp111_ = NULL; + gchar* _tmp112_; + gchar** _tmp113_; + gint _tmp113__length1; + gchar** _tmp114_; + gint _tmp114__length1; + const gchar* _tmp115_; + GeeDeque* _tmp116_; + GeeArrayList* _tmp117_; + gint _tmp118_ = 0; + gchar** _tmp119_; + gint _tmp119__length1; + GeeDeque* _tmp120_; + gint _tmp121_; + gint _tmp122_; + GeeArrayList* _tmp123_; + gint _tmp124_; + gint _tmp125_; + gchar** _tmp126_; + gint _tmp126__length1; + GeeArrayList* _tmp140_; + GeeDeque* _tmp141_; + GeeArrayList* _tmp142_; + gint _tmp143_ = 0; + GeeDeque* _tmp144_; + gint _tmp145_; + gint _tmp146_; + GeeArrayList* _tmp147_; + gint _tmp148_; + gint _tmp149_; + GeeArrayList* _tmp150_; + GeeDeque* _tmp151_; + GeeArrayList* _tmp152_; + gint _tmp153_ = 0; + GeeDeque* _tmp154_; + gint _tmp155_; + gint _tmp156_; + GeeArrayList* _tmp157_; + gint _tmp158_; + gint _tmp159_; g_return_if_fail (self != NULL); _tmp0_ = ((CollectionTests*) self)->test_collection; _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_DEQUE) ? ((GeeDeque*) _tmp0_) : NULL); test_deque = _tmp1_; - _tmp2_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL); + _tmp2_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL); recipient = _tmp2_; - _vala_assert (test_deque != NULL, "test_deque != null"); - _tmp3_ = gee_deque_offer_head (test_deque, "one"); - _vala_assert (_tmp3_, "test_deque.offer_head (\"one\")"); - _tmp4_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp5_ = _tmp4_; - _vala_assert (_tmp5_ == 1, "test_deque.size == 1"); - _tmp6_ = gee_deque_offer_head (test_deque, "two"); - _vala_assert (_tmp6_, "test_deque.offer_head (\"two\")"); - _tmp7_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp8_ = _tmp7_; - _vala_assert (_tmp8_ == 2, "test_deque.size == 2"); - _tmp9_ = gee_deque_offer_head (test_deque, "three"); - _vala_assert (_tmp9_, "test_deque.offer_head (\"three\")"); - _tmp10_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp11_ = _tmp10_; - _vala_assert (_tmp11_ == 3, "test_deque.size == 3"); - _tmp12_ = gee_deque_offer_head (test_deque, "four"); - _vala_assert (_tmp12_, "test_deque.offer_head (\"four\")"); - _tmp13_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp14_ = _tmp13_; - _vala_assert (_tmp14_ == 4, "test_deque.size == 4"); - _tmp15_ = gee_deque_peek_head (test_deque); - _tmp16_ = (gchar*) _tmp15_; - _vala_assert (g_strcmp0 (_tmp16_, "four") == 0, "test_deque.peek_head () == \"four\""); - _g_free0 (_tmp16_); - _tmp17_ = gee_deque_poll_head (test_deque); - _tmp18_ = (gchar*) _tmp17_; - _vala_assert (g_strcmp0 (_tmp18_, "four") == 0, "test_deque.poll_head () == \"four\""); - _g_free0 (_tmp18_); - _tmp19_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp20_ = _tmp19_; - _vala_assert (_tmp20_ == 3, "test_deque.size == 3"); - _tmp21_ = gee_deque_peek_head (test_deque); - _tmp22_ = (gchar*) _tmp21_; - _vala_assert (g_strcmp0 (_tmp22_, "three") == 0, "test_deque.peek_head () == \"three\""); - _g_free0 (_tmp22_); - _tmp23_ = gee_deque_poll_head (test_deque); - _tmp24_ = (gchar*) _tmp23_; - _vala_assert (g_strcmp0 (_tmp24_, "three") == 0, "test_deque.poll_head () == \"three\""); - _g_free0 (_tmp24_); - _tmp25_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp26_ = _tmp25_; - _vala_assert (_tmp26_ == 2, "test_deque.size == 2"); - _tmp27_ = gee_deque_peek_head (test_deque); - _tmp28_ = (gchar*) _tmp27_; - _vala_assert (g_strcmp0 (_tmp28_, "two") == 0, "test_deque.peek_head () == \"two\""); - _g_free0 (_tmp28_); - _tmp29_ = gee_deque_poll_head (test_deque); - _tmp30_ = (gchar*) _tmp29_; - _vala_assert (g_strcmp0 (_tmp30_, "two") == 0, "test_deque.poll_head () == \"two\""); - _g_free0 (_tmp30_); - _tmp31_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp32_ = _tmp31_; - _vala_assert (_tmp32_ == 1, "test_deque.size == 1"); - _tmp33_ = gee_deque_peek_head (test_deque); - _tmp34_ = (gchar*) _tmp33_; - _vala_assert (g_strcmp0 (_tmp34_, "one") == 0, "test_deque.peek_head () == \"one\""); - _g_free0 (_tmp34_); - _tmp35_ = gee_deque_poll_head (test_deque); - _tmp36_ = (gchar*) _tmp35_; - _vala_assert (g_strcmp0 (_tmp36_, "one") == 0, "test_deque.poll_head () == \"one\""); - _g_free0 (_tmp36_); - _tmp37_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp38_ = _tmp37_; - _vala_assert (_tmp38_ == 0, "test_deque.size == 0"); - _tmp39_ = gee_deque_peek_head (test_deque); - _tmp40_ = (gchar*) _tmp39_; - _vala_assert (_tmp40_ == NULL, "test_deque.peek_head () == null"); - _g_free0 (_tmp40_); - _tmp41_ = gee_deque_poll_head (test_deque); - _tmp42_ = (gchar*) _tmp41_; - _vala_assert (_tmp42_ == NULL, "test_deque.poll_head () == null"); - _g_free0 (_tmp42_); - gee_abstract_collection_clear ((GeeAbstractCollection*) recipient); - _tmp43_ = gee_deque_offer_head (test_deque, "one"); - _vala_assert (_tmp43_, "test_deque.offer_head (\"one\")"); - _tmp44_ = gee_deque_offer_head (test_deque, "two"); - _vala_assert (_tmp44_, "test_deque.offer_head (\"two\")"); - _tmp45_ = gee_deque_offer_head (test_deque, "three"); - _vala_assert (_tmp45_, "test_deque.offer_head (\"three\")"); - _tmp46_ = gee_deque_offer_head (test_deque, "four"); - _vala_assert (_tmp46_, "test_deque.offer_head (\"four\")"); - _tmp47_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp48_ = _tmp47_; - _vala_assert (_tmp48_ == 4, "test_deque.size == 4"); - _tmp49_ = gee_deque_drain_head (test_deque, (GeeCollection*) recipient, 1); - _vala_assert (_tmp49_ == 1, "test_deque.drain_head (recipient, 1) == 1"); - _tmp50_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp51_ = _tmp50_; - _vala_assert (_tmp51_ == 3, "test_deque.size == 3"); - _tmp52_ = gee_abstract_collection_get_size ((GeeCollection*) recipient); - _tmp53_ = _tmp52_; - _vala_assert (_tmp53_ == 1, "recipient.size == 1"); - _tmp54_ = gee_abstract_list_get ((GeeAbstractList*) recipient, 0); - _tmp55_ = (gchar*) _tmp54_; - _vala_assert (g_strcmp0 (_tmp55_, "four") == 0, "recipient.get (0) == \"four\""); - _g_free0 (_tmp55_); - _tmp56_ = gee_deque_drain_head (test_deque, (GeeCollection*) recipient, -1); - _vala_assert (_tmp56_ == 3, "test_deque.drain_head (recipient) == 3"); - _tmp57_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp58_ = _tmp57_; - _vala_assert (_tmp58_ == 0, "test_deque.size == 0"); - _tmp59_ = gee_abstract_collection_get_size ((GeeCollection*) recipient); - _tmp60_ = _tmp59_; - _vala_assert (_tmp60_ == 4, "recipient.size == 4"); - _tmp61_ = gee_abstract_list_get ((GeeAbstractList*) recipient, 1); - _tmp62_ = (gchar*) _tmp61_; - _vala_assert (g_strcmp0 (_tmp62_, "three") == 0, "recipient.get (1) == \"three\""); - _g_free0 (_tmp62_); - _tmp63_ = gee_abstract_list_get ((GeeAbstractList*) recipient, 2); - _tmp64_ = (gchar*) _tmp63_; - _vala_assert (g_strcmp0 (_tmp64_, "two") == 0, "recipient.get (2) == \"two\""); - _g_free0 (_tmp64_); - _tmp65_ = gee_abstract_list_get ((GeeAbstractList*) recipient, 3); - _tmp66_ = (gchar*) _tmp65_; - _vala_assert (g_strcmp0 (_tmp66_, "one") == 0, "recipient.get (3) == \"one\""); - _g_free0 (_tmp66_); - gee_abstract_collection_clear ((GeeAbstractCollection*) recipient); - _tmp67_ = gee_deque_drain_head (test_deque, (GeeCollection*) recipient, 1); - _vala_assert (_tmp67_ == 0, "test_deque.drain_head (recipient, 1) == 0"); - _tmp68_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp69_ = _tmp68_; - _vala_assert (_tmp69_ == 0, "test_deque.size == 0"); - _tmp70_ = gee_abstract_collection_get_size ((GeeCollection*) recipient); - _tmp71_ = _tmp70_; - _vala_assert (_tmp71_ == 0, "recipient.size == 0"); - gee_abstract_collection_clear ((GeeAbstractCollection*) recipient); - _tmp72_ = gee_deque_drain_head (test_deque, (GeeCollection*) recipient, -1); - _vala_assert (_tmp72_ == 0, "test_deque.drain_head (recipient) == 0"); - _tmp73_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp74_ = _tmp73_; - _vala_assert (_tmp74_ == 0, "test_deque.size == 0"); - _tmp75_ = gee_abstract_collection_get_size ((GeeCollection*) recipient); - _tmp76_ = _tmp75_; - _vala_assert (_tmp76_ == 0, "recipient.size == 0"); + _tmp3_ = g_strdup ("one"); + _tmp4_ = g_strdup ("two"); + _tmp5_ = g_strdup ("three"); + _tmp6_ = g_strdup ("four"); + _tmp7_ = g_strdup ("five"); + _tmp8_ = g_strdup ("six"); + _tmp9_ = g_strdup ("seven"); + _tmp10_ = g_strdup ("\neight"); + _tmp11_ = g_strdup ("nine"); + _tmp12_ = g_strdup ("ten"); + _tmp13_ = g_strdup ("eleven"); + _tmp14_ = g_strdup ("twelve"); + _tmp15_ = g_strdup ("thirteen"); + _tmp16_ = g_strdup ("fourteen\n"); + _tmp17_ = g_strdup ("fifteen"); + _tmp18_ = g_strdup ("sixteen"); + _tmp19_ = g_strdup ("seventeen"); + _tmp20_ = g_strdup ("eighteen"); + _tmp21_ = g_strdup ("nineteen\n"); + _tmp22_ = g_strdup ("twenty"); + _tmp23_ = g_strdup ("twenty one"); + _tmp24_ = g_strdup ("twenty two"); + _tmp25_ = g_strdup ("twenty three"); + _tmp26_ = g_strdup ("twenty four"); + _tmp27_ = g_strdup ("twenty five"); + _tmp28_ = g_strdup ("twenty six"); + _tmp29_ = g_strdup ("twenty seven"); + _tmp30_ = g_strdup ("twenty eight"); + _tmp31_ = g_strdup ("twenty nine"); + _tmp32_ = g_strdup ("thirty"); + _tmp33_ = g_strdup ("thirty one"); + _tmp34_ = g_strdup ("thirty two"); + _tmp35_ = g_strdup ("thirty four"); + _tmp36_ = g_strdup ("thirty five"); + _tmp37_ = g_strdup ("thirty six"); + _tmp38_ = g_strdup ("thirty seven"); + _tmp39_ = g_strdup ("thirty eight"); + _tmp40_ = g_strdup ("thirty nine"); + _tmp41_ = g_strdup ("fourty"); + _tmp42_ = g_new0 (gchar*, 39 + 1); + _tmp42_[0] = _tmp3_; + _tmp42_[1] = _tmp4_; + _tmp42_[2] = _tmp5_; + _tmp42_[3] = _tmp6_; + _tmp42_[4] = _tmp7_; + _tmp42_[5] = _tmp8_; + _tmp42_[6] = _tmp9_; + _tmp42_[7] = _tmp10_; + _tmp42_[8] = _tmp11_; + _tmp42_[9] = _tmp12_; + _tmp42_[10] = _tmp13_; + _tmp42_[11] = _tmp14_; + _tmp42_[12] = _tmp15_; + _tmp42_[13] = _tmp16_; + _tmp42_[14] = _tmp17_; + _tmp42_[15] = _tmp18_; + _tmp42_[16] = _tmp19_; + _tmp42_[17] = _tmp20_; + _tmp42_[18] = _tmp21_; + _tmp42_[19] = _tmp22_; + _tmp42_[20] = _tmp23_; + _tmp42_[21] = _tmp24_; + _tmp42_[22] = _tmp25_; + _tmp42_[23] = _tmp26_; + _tmp42_[24] = _tmp27_; + _tmp42_[25] = _tmp28_; + _tmp42_[26] = _tmp29_; + _tmp42_[27] = _tmp30_; + _tmp42_[28] = _tmp31_; + _tmp42_[29] = _tmp32_; + _tmp42_[30] = _tmp33_; + _tmp42_[31] = _tmp34_; + _tmp42_[32] = _tmp35_; + _tmp42_[33] = _tmp36_; + _tmp42_[34] = _tmp37_; + _tmp42_[35] = _tmp38_; + _tmp42_[36] = _tmp39_; + _tmp42_[37] = _tmp40_; + _tmp42_[38] = _tmp41_; + to_offer = _tmp42_; + to_offer_length1 = 39; + _to_offer_size_ = to_offer_length1; + _tmp43_ = test_deque; + _vala_assert (_tmp43_ != NULL, "test_deque != null"); + { + gint i; + i = 0; + { + gboolean _tmp44_; + _tmp44_ = TRUE; + while (TRUE) { + gboolean _tmp45_; + gint _tmp47_; + gchar** _tmp48_; + gint _tmp48__length1; + GeeDeque* _tmp49_; + gchar** _tmp50_; + gint _tmp50__length1; + gint _tmp51_; + const gchar* _tmp52_; + gboolean _tmp53_ = FALSE; + GeeDeque* _tmp54_; + gint _tmp55_; + gint _tmp56_; + gint _tmp57_; + _tmp45_ = _tmp44_; + if (!_tmp45_) { + gint _tmp46_; + _tmp46_ = i; + i = _tmp46_ + 1; + } + _tmp44_ = FALSE; + _tmp47_ = i; + _tmp48_ = to_offer; + _tmp48__length1 = to_offer_length1; + if (!(_tmp47_ < _tmp48__length1)) { + break; + } + _tmp49_ = test_deque; + _tmp50_ = to_offer; + _tmp50__length1 = to_offer_length1; + _tmp51_ = i; + _tmp52_ = _tmp50_[_tmp51_]; + _tmp53_ = gee_deque_offer_head (_tmp49_, _tmp52_); + _vala_assert (_tmp53_, "test_deque.offer_head (to_offer[i])"); + _tmp54_ = test_deque; + _tmp55_ = gee_collection_get_size ((GeeCollection*) _tmp54_); + _tmp56_ = _tmp55_; + _tmp57_ = i; + _vala_assert (_tmp56_ == (_tmp57_ + 1), "test_deque.size == i + 1"); + } + } + } + { + gchar** _tmp58_; + gint _tmp58__length1; + gint i; + _tmp58_ = to_offer; + _tmp58__length1 = to_offer_length1; + i = _tmp58__length1 - 1; + { + gboolean _tmp59_; + _tmp59_ = TRUE; + while (TRUE) { + gboolean _tmp60_; + gint _tmp62_; + GeeDeque* _tmp63_; + gpointer _tmp64_ = NULL; + gchar* _tmp65_; + gchar** _tmp66_; + gint _tmp66__length1; + gint _tmp67_; + const gchar* _tmp68_; + GeeDeque* _tmp69_; + gpointer _tmp70_ = NULL; + gchar* _tmp71_; + gchar** _tmp72_; + gint _tmp72__length1; + gint _tmp73_; + const gchar* _tmp74_; + GeeDeque* _tmp75_; + gint _tmp76_; + gint _tmp77_; + gint _tmp78_; + _tmp60_ = _tmp59_; + if (!_tmp60_) { + gint _tmp61_; + _tmp61_ = i; + i = _tmp61_ - 1; + } + _tmp59_ = FALSE; + _tmp62_ = i; + if (!(_tmp62_ >= 0)) { + break; + } + _tmp63_ = test_deque; + _tmp64_ = gee_deque_peek_head (_tmp63_); + _tmp65_ = (gchar*) _tmp64_; + _tmp66_ = to_offer; + _tmp66__length1 = to_offer_length1; + _tmp67_ = i; + _tmp68_ = _tmp66_[_tmp67_]; + _vala_assert (g_strcmp0 (_tmp65_, _tmp68_) == 0, "test_deque.peek_head () == to_offer[i]"); + _g_free0 (_tmp65_); + _tmp69_ = test_deque; + _tmp70_ = gee_deque_poll_head (_tmp69_); + _tmp71_ = (gchar*) _tmp70_; + _tmp72_ = to_offer; + _tmp72__length1 = to_offer_length1; + _tmp73_ = i; + _tmp74_ = _tmp72_[_tmp73_]; + _vala_assert (g_strcmp0 (_tmp71_, _tmp74_) == 0, "test_deque.poll_head () == to_offer[i]"); + _g_free0 (_tmp71_); + _tmp75_ = test_deque; + _tmp76_ = gee_collection_get_size ((GeeCollection*) _tmp75_); + _tmp77_ = _tmp76_; + _tmp78_ = i; + _vala_assert (_tmp77_ == _tmp78_, "test_deque.size == i"); + } + } + } + _tmp79_ = test_deque; + _tmp80_ = gee_deque_peek_head (_tmp79_); + _tmp81_ = (gchar*) _tmp80_; + _vala_assert (_tmp81_ == NULL, "test_deque.peek_head () == null"); + _g_free0 (_tmp81_); + _tmp82_ = test_deque; + _tmp83_ = gee_deque_poll_head (_tmp82_); + _tmp84_ = (gchar*) _tmp83_; + _vala_assert (_tmp84_ == NULL, "test_deque.poll_head () == null"); + _g_free0 (_tmp84_); + _tmp85_ = recipient; + gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp85_); + { + gint i; + i = 0; + { + gboolean _tmp86_; + _tmp86_ = TRUE; + while (TRUE) { + gboolean _tmp87_; + gint _tmp89_; + gchar** _tmp90_; + gint _tmp90__length1; + GeeDeque* _tmp91_; + gchar** _tmp92_; + gint _tmp92__length1; + gint _tmp93_; + const gchar* _tmp94_; + gboolean _tmp95_ = FALSE; + _tmp87_ = _tmp86_; + if (!_tmp87_) { + gint _tmp88_; + _tmp88_ = i; + i = _tmp88_ + 1; + } + _tmp86_ = FALSE; + _tmp89_ = i; + _tmp90_ = to_offer; + _tmp90__length1 = to_offer_length1; + if (!(_tmp89_ < _tmp90__length1)) { + break; + } + _tmp91_ = test_deque; + _tmp92_ = to_offer; + _tmp92__length1 = to_offer_length1; + _tmp93_ = i; + _tmp94_ = _tmp92_[_tmp93_]; + _tmp95_ = gee_deque_offer_head (_tmp91_, _tmp94_); + _vala_assert (_tmp95_, "test_deque.offer_head (to_offer[i])"); + } + } + } + _tmp96_ = test_deque; + _tmp97_ = gee_collection_get_size ((GeeCollection*) _tmp96_); + _tmp98_ = _tmp97_; + _tmp99_ = to_offer; + _tmp99__length1 = to_offer_length1; + _vala_assert (_tmp98_ == _tmp99__length1, "test_deque.size == to_offer.length"); + _tmp100_ = test_deque; + _tmp101_ = recipient; + _tmp102_ = gee_deque_drain_head (_tmp100_, (GeeCollection*) _tmp101_, 1); + _vala_assert (_tmp102_ == 1, "test_deque.drain_head (recipient, 1) == 1"); + _tmp103_ = test_deque; + _tmp104_ = gee_collection_get_size ((GeeCollection*) _tmp103_); + _tmp105_ = _tmp104_; + _tmp106_ = to_offer; + _tmp106__length1 = to_offer_length1; + _vala_assert (_tmp105_ == (_tmp106__length1 - 1), "test_deque.size == to_offer.length - 1"); + _tmp107_ = recipient; + _tmp108_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp107_); + _tmp109_ = _tmp108_; + _vala_assert (_tmp109_ == 1, "recipient.size == 1"); + _tmp110_ = recipient; + _tmp111_ = gee_abstract_list_get ((GeeAbstractList*) _tmp110_, 0); + _tmp112_ = (gchar*) _tmp111_; + _tmp113_ = to_offer; + _tmp113__length1 = to_offer_length1; + _tmp114_ = to_offer; + _tmp114__length1 = to_offer_length1; + _tmp115_ = _tmp113_[_tmp114__length1 - 1]; + _vala_assert (g_strcmp0 (_tmp112_, _tmp115_) == 0, "recipient.get (0) == to_offer[to_offer.length - 1]"); + _g_free0 (_tmp112_); + _tmp116_ = test_deque; + _tmp117_ = recipient; + _tmp118_ = gee_deque_drain_head (_tmp116_, (GeeCollection*) _tmp117_, -1); + _tmp119_ = to_offer; + _tmp119__length1 = to_offer_length1; + _vala_assert (_tmp118_ == (_tmp119__length1 - 1), "test_deque.drain_head (recipient) == to_offer.length - 1"); + _tmp120_ = test_deque; + _tmp121_ = gee_collection_get_size ((GeeCollection*) _tmp120_); + _tmp122_ = _tmp121_; + _vala_assert (_tmp122_ == 0, "test_deque.size == 0"); + _tmp123_ = recipient; + _tmp124_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp123_); + _tmp125_ = _tmp124_; + _tmp126_ = to_offer; + _tmp126__length1 = to_offer_length1; + _vala_assert (_tmp125_ == _tmp126__length1, "recipient.size == to_offer.length"); + { + gint i; + i = 1; + { + gboolean _tmp127_; + _tmp127_ = TRUE; + while (TRUE) { + gboolean _tmp128_; + gint _tmp130_; + gchar** _tmp131_; + gint _tmp131__length1; + GeeArrayList* _tmp132_; + gint _tmp133_; + gpointer _tmp134_ = NULL; + gchar* _tmp135_; + gchar** _tmp136_; + gint _tmp136__length1; + gchar** _tmp137_; + gint _tmp137__length1; + gint _tmp138_; + const gchar* _tmp139_; + _tmp128_ = _tmp127_; + if (!_tmp128_) { + gint _tmp129_; + _tmp129_ = i; + i = _tmp129_ + 1; + } + _tmp127_ = FALSE; + _tmp130_ = i; + _tmp131_ = to_offer; + _tmp131__length1 = to_offer_length1; + if (!(_tmp130_ < _tmp131__length1)) { + break; + } + _tmp132_ = recipient; + _tmp133_ = i; + _tmp134_ = gee_abstract_list_get ((GeeAbstractList*) _tmp132_, _tmp133_); + _tmp135_ = (gchar*) _tmp134_; + _tmp136_ = to_offer; + _tmp136__length1 = to_offer_length1; + _tmp137_ = to_offer; + _tmp137__length1 = to_offer_length1; + _tmp138_ = i; + _tmp139_ = _tmp136_[(_tmp137__length1 - _tmp138_) - 1]; + _vala_assert (g_strcmp0 (_tmp135_, _tmp139_) == 0, "recipient.get (i) == to_offer[to_offer.length - i - 1]"); + _g_free0 (_tmp135_); + } + } + } + _tmp140_ = recipient; + gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp140_); + _tmp141_ = test_deque; + _tmp142_ = recipient; + _tmp143_ = gee_deque_drain_head (_tmp141_, (GeeCollection*) _tmp142_, 1); + _vala_assert (_tmp143_ == 0, "test_deque.drain_head (recipient, 1) == 0"); + _tmp144_ = test_deque; + _tmp145_ = gee_collection_get_size ((GeeCollection*) _tmp144_); + _tmp146_ = _tmp145_; + _vala_assert (_tmp146_ == 0, "test_deque.size == 0"); + _tmp147_ = recipient; + _tmp148_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp147_); + _tmp149_ = _tmp148_; + _vala_assert (_tmp149_ == 0, "recipient.size == 0"); + _tmp150_ = recipient; + gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp150_); + _tmp151_ = test_deque; + _tmp152_ = recipient; + _tmp153_ = gee_deque_drain_head (_tmp151_, (GeeCollection*) _tmp152_, -1); + _vala_assert (_tmp153_ == 0, "test_deque.drain_head (recipient) == 0"); + _tmp154_ = test_deque; + _tmp155_ = gee_collection_get_size ((GeeCollection*) _tmp154_); + _tmp156_ = _tmp155_; + _vala_assert (_tmp156_ == 0, "test_deque.size == 0"); + _tmp157_ = recipient; + _tmp158_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp157_); + _tmp159_ = _tmp158_; + _vala_assert (_tmp159_ == 0, "recipient.size == 0"); + to_offer = (_vala_array_free (to_offer, to_offer_length1, (GDestroyNotify) g_free), NULL); _g_object_unref0 (recipient); _g_object_unref0 (test_deque); } @@ -629,221 +1179,509 @@ void deque_tests_test_reversed_stack_use (DequeTests* self) { GeeDeque* test_deque; GeeArrayList* _tmp2_; GeeArrayList* recipient; - gboolean _tmp3_ = FALSE; - gint _tmp4_; - gint _tmp5_; - gboolean _tmp6_ = FALSE; - gint _tmp7_; - gint _tmp8_; - gboolean _tmp9_ = FALSE; - gint _tmp10_; - gint _tmp11_; - gboolean _tmp12_ = FALSE; - gint _tmp13_; - gint _tmp14_; - gpointer _tmp15_ = NULL; + gchar* _tmp3_; + gchar* _tmp4_; + gchar* _tmp5_; + gchar* _tmp6_; + gchar* _tmp7_; + gchar* _tmp8_; + gchar* _tmp9_; + gchar* _tmp10_; + gchar* _tmp11_; + gchar* _tmp12_; + gchar* _tmp13_; + gchar* _tmp14_; + gchar* _tmp15_; gchar* _tmp16_; - gpointer _tmp17_ = NULL; + gchar* _tmp17_; gchar* _tmp18_; - gint _tmp19_; - gint _tmp20_; - gpointer _tmp21_ = NULL; + gchar* _tmp19_; + gchar* _tmp20_; + gchar* _tmp21_; gchar* _tmp22_; - gpointer _tmp23_ = NULL; + gchar* _tmp23_; gchar* _tmp24_; - gint _tmp25_; - gint _tmp26_; - gpointer _tmp27_ = NULL; + gchar* _tmp25_; + gchar* _tmp26_; + gchar* _tmp27_; gchar* _tmp28_; - gpointer _tmp29_ = NULL; + gchar* _tmp29_; gchar* _tmp30_; - gint _tmp31_; - gint _tmp32_; - gpointer _tmp33_ = NULL; + gchar* _tmp31_; + gchar* _tmp32_; + gchar* _tmp33_; gchar* _tmp34_; - gpointer _tmp35_ = NULL; + gchar* _tmp35_; gchar* _tmp36_; - gint _tmp37_; - gint _tmp38_; - gpointer _tmp39_ = NULL; + gchar* _tmp37_; + gchar* _tmp38_; + gchar* _tmp39_; gchar* _tmp40_; - gpointer _tmp41_ = NULL; - gchar* _tmp42_; - gboolean _tmp43_ = FALSE; - gboolean _tmp44_ = FALSE; - gboolean _tmp45_ = FALSE; - gboolean _tmp46_ = FALSE; - gint _tmp47_; - gint _tmp48_; - gint _tmp49_ = 0; - gint _tmp50_; - gint _tmp51_; - gint _tmp52_; - gint _tmp53_; - gpointer _tmp54_ = NULL; - gchar* _tmp55_; - gint _tmp56_ = 0; - gint _tmp57_; - gint _tmp58_; - gint _tmp59_; - gint _tmp60_; - gpointer _tmp61_ = NULL; - gchar* _tmp62_; - gpointer _tmp63_ = NULL; - gchar* _tmp64_; - gpointer _tmp65_ = NULL; - gchar* _tmp66_; - gint _tmp67_ = 0; - gint _tmp68_; - gint _tmp69_; - gint _tmp70_; - gint _tmp71_; - gint _tmp72_ = 0; - gint _tmp73_; - gint _tmp74_; - gint _tmp75_; - gint _tmp76_; + gchar* _tmp41_; + gchar** _tmp42_ = NULL; + gchar** to_offer; + gint to_offer_length1; + gint _to_offer_size_; + GeeDeque* _tmp43_; + GeeDeque* _tmp82_; + gpointer _tmp83_ = NULL; + gchar* _tmp84_; + GeeDeque* _tmp85_; + gpointer _tmp86_ = NULL; + gchar* _tmp87_; + GeeArrayList* _tmp88_; + GeeDeque* _tmp99_; + gint _tmp100_; + gint _tmp101_; + gchar** _tmp102_; + gint _tmp102__length1; + GeeDeque* _tmp103_; + GeeArrayList* _tmp104_; + gint _tmp105_ = 0; + GeeDeque* _tmp106_; + gint _tmp107_; + gint _tmp108_; + gchar** _tmp109_; + gint _tmp109__length1; + GeeArrayList* _tmp110_; + gint _tmp111_; + gint _tmp112_; + GeeArrayList* _tmp113_; + gpointer _tmp114_ = NULL; + gchar* _tmp115_; + gchar** _tmp116_; + gint _tmp116__length1; + gchar** _tmp117_; + gint _tmp117__length1; + const gchar* _tmp118_; + GeeDeque* _tmp119_; + GeeArrayList* _tmp120_; + gint _tmp121_ = 0; + gchar** _tmp122_; + gint _tmp122__length1; + GeeDeque* _tmp123_; + gint _tmp124_; + gint _tmp125_; + GeeArrayList* _tmp126_; + gint _tmp127_; + gint _tmp128_; + gchar** _tmp129_; + gint _tmp129__length1; + GeeArrayList* _tmp143_; + GeeDeque* _tmp144_; + GeeArrayList* _tmp145_; + gint _tmp146_ = 0; + GeeDeque* _tmp147_; + gint _tmp148_; + gint _tmp149_; + GeeArrayList* _tmp150_; + gint _tmp151_; + gint _tmp152_; + GeeArrayList* _tmp153_; + GeeDeque* _tmp154_; + GeeArrayList* _tmp155_; + gint _tmp156_ = 0; + GeeDeque* _tmp157_; + gint _tmp158_; + gint _tmp159_; + GeeArrayList* _tmp160_; + gint _tmp161_; + gint _tmp162_; g_return_if_fail (self != NULL); _tmp0_ = ((CollectionTests*) self)->test_collection; _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_DEQUE) ? ((GeeDeque*) _tmp0_) : NULL); test_deque = _tmp1_; - _tmp2_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL); + _tmp2_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL); recipient = _tmp2_; - _vala_assert (test_deque != NULL, "test_deque != null"); - _tmp3_ = gee_deque_offer_tail (test_deque, "one"); - _vala_assert (_tmp3_, "test_deque.offer_tail (\"one\")"); - _tmp4_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp5_ = _tmp4_; - _vala_assert (_tmp5_ == 1, "test_deque.size == 1"); - _tmp6_ = gee_deque_offer_tail (test_deque, "two"); - _vala_assert (_tmp6_, "test_deque.offer_tail (\"two\")"); - _tmp7_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp8_ = _tmp7_; - _vala_assert (_tmp8_ == 2, "test_deque.size == 2"); - _tmp9_ = gee_deque_offer_tail (test_deque, "three"); - _vala_assert (_tmp9_, "test_deque.offer_tail (\"three\")"); - _tmp10_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp11_ = _tmp10_; - _vala_assert (_tmp11_ == 3, "test_deque.size == 3"); - _tmp12_ = gee_deque_offer_tail (test_deque, "four"); - _vala_assert (_tmp12_, "test_deque.offer_tail (\"four\")"); - _tmp13_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp14_ = _tmp13_; - _vala_assert (_tmp14_ == 4, "test_deque.size == 4"); - _tmp15_ = gee_deque_peek_tail (test_deque); - _tmp16_ = (gchar*) _tmp15_; - _vala_assert (g_strcmp0 (_tmp16_, "four") == 0, "test_deque.peek_tail () == \"four\""); - _g_free0 (_tmp16_); - _tmp17_ = gee_deque_poll_tail (test_deque); - _tmp18_ = (gchar*) _tmp17_; - _vala_assert (g_strcmp0 (_tmp18_, "four") == 0, "test_deque.poll_tail () == \"four\""); - _g_free0 (_tmp18_); - _tmp19_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp20_ = _tmp19_; - _vala_assert (_tmp20_ == 3, "test_deque.size == 3"); - _tmp21_ = gee_deque_peek_tail (test_deque); - _tmp22_ = (gchar*) _tmp21_; - _vala_assert (g_strcmp0 (_tmp22_, "three") == 0, "test_deque.peek_tail () == \"three\""); - _g_free0 (_tmp22_); - _tmp23_ = gee_deque_poll_tail (test_deque); - _tmp24_ = (gchar*) _tmp23_; - _vala_assert (g_strcmp0 (_tmp24_, "three") == 0, "test_deque.poll_tail () == \"three\""); - _g_free0 (_tmp24_); - _tmp25_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp26_ = _tmp25_; - _vala_assert (_tmp26_ == 2, "test_deque.size == 2"); - _tmp27_ = gee_deque_peek_tail (test_deque); - _tmp28_ = (gchar*) _tmp27_; - _vala_assert (g_strcmp0 (_tmp28_, "two") == 0, "test_deque.peek_tail () == \"two\""); - _g_free0 (_tmp28_); - _tmp29_ = gee_deque_poll_tail (test_deque); - _tmp30_ = (gchar*) _tmp29_; - _vala_assert (g_strcmp0 (_tmp30_, "two") == 0, "test_deque.poll_tail () == \"two\""); - _g_free0 (_tmp30_); - _tmp31_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp32_ = _tmp31_; - _vala_assert (_tmp32_ == 1, "test_deque.size == 1"); - _tmp33_ = gee_deque_peek_tail (test_deque); - _tmp34_ = (gchar*) _tmp33_; - _vala_assert (g_strcmp0 (_tmp34_, "one") == 0, "test_deque.peek_tail () == \"one\""); - _g_free0 (_tmp34_); - _tmp35_ = gee_deque_poll_tail (test_deque); - _tmp36_ = (gchar*) _tmp35_; - _vala_assert (g_strcmp0 (_tmp36_, "one") == 0, "test_deque.poll_tail () == \"one\""); - _g_free0 (_tmp36_); - _tmp37_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp38_ = _tmp37_; - _vala_assert (_tmp38_ == 0, "test_deque.size == 0"); - _tmp39_ = gee_deque_peek_tail (test_deque); - _tmp40_ = (gchar*) _tmp39_; - _vala_assert (_tmp40_ == NULL, "test_deque.peek_tail () == null"); - _g_free0 (_tmp40_); - _tmp41_ = gee_deque_poll_tail (test_deque); - _tmp42_ = (gchar*) _tmp41_; - _vala_assert (_tmp42_ == NULL, "test_deque.poll_tail () == null"); - _g_free0 (_tmp42_); - gee_abstract_collection_clear ((GeeAbstractCollection*) recipient); - _tmp43_ = gee_deque_offer_tail (test_deque, "one"); - _vala_assert (_tmp43_, "test_deque.offer_tail (\"one\")"); - _tmp44_ = gee_deque_offer_tail (test_deque, "two"); - _vala_assert (_tmp44_, "test_deque.offer_tail (\"two\")"); - _tmp45_ = gee_deque_offer_tail (test_deque, "three"); - _vala_assert (_tmp45_, "test_deque.offer_tail (\"three\")"); - _tmp46_ = gee_deque_offer_tail (test_deque, "four"); - _vala_assert (_tmp46_, "test_deque.offer_tail (\"four\")"); - _tmp47_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp48_ = _tmp47_; - _vala_assert (_tmp48_ == 4, "test_deque.size == 4"); - _tmp49_ = gee_deque_drain_tail (test_deque, (GeeCollection*) recipient, 1); - _vala_assert (_tmp49_ == 1, "test_deque.drain_tail (recipient, 1) == 1"); - _tmp50_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp51_ = _tmp50_; - _vala_assert (_tmp51_ == 3, "test_deque.size == 3"); - _tmp52_ = gee_abstract_collection_get_size ((GeeCollection*) recipient); - _tmp53_ = _tmp52_; - _vala_assert (_tmp53_ == 1, "recipient.size == 1"); - _tmp54_ = gee_abstract_list_get ((GeeAbstractList*) recipient, 0); - _tmp55_ = (gchar*) _tmp54_; - _vala_assert (g_strcmp0 (_tmp55_, "four") == 0, "recipient.get (0) == \"four\""); - _g_free0 (_tmp55_); - _tmp56_ = gee_deque_drain_tail (test_deque, (GeeCollection*) recipient, -1); - _vala_assert (_tmp56_ == 3, "test_deque.drain_tail (recipient) == 3"); - _tmp57_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp58_ = _tmp57_; - _vala_assert (_tmp58_ == 0, "test_deque.size == 0"); - _tmp59_ = gee_abstract_collection_get_size ((GeeCollection*) recipient); - _tmp60_ = _tmp59_; - _vala_assert (_tmp60_ == 4, "recipient.size == 4"); - _tmp61_ = gee_abstract_list_get ((GeeAbstractList*) recipient, 1); - _tmp62_ = (gchar*) _tmp61_; - _vala_assert (g_strcmp0 (_tmp62_, "three") == 0, "recipient.get (1) == \"three\""); - _g_free0 (_tmp62_); - _tmp63_ = gee_abstract_list_get ((GeeAbstractList*) recipient, 2); - _tmp64_ = (gchar*) _tmp63_; - _vala_assert (g_strcmp0 (_tmp64_, "two") == 0, "recipient.get (2) == \"two\""); - _g_free0 (_tmp64_); - _tmp65_ = gee_abstract_list_get ((GeeAbstractList*) recipient, 3); - _tmp66_ = (gchar*) _tmp65_; - _vala_assert (g_strcmp0 (_tmp66_, "one") == 0, "recipient.get (3) == \"one\""); - _g_free0 (_tmp66_); - gee_abstract_collection_clear ((GeeAbstractCollection*) recipient); - _tmp67_ = gee_deque_drain_tail (test_deque, (GeeCollection*) recipient, 1); - _vala_assert (_tmp67_ == 0, "test_deque.drain_tail (recipient, 1) == 0"); - _tmp68_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp69_ = _tmp68_; - _vala_assert (_tmp69_ == 0, "test_deque.size == 0"); - _tmp70_ = gee_abstract_collection_get_size ((GeeCollection*) recipient); - _tmp71_ = _tmp70_; - _vala_assert (_tmp71_ == 0, "recipient.size == 0"); - gee_abstract_collection_clear ((GeeAbstractCollection*) recipient); - _tmp72_ = gee_deque_drain_tail (test_deque, (GeeCollection*) recipient, -1); - _vala_assert (_tmp72_ == 0, "test_deque.drain_tail (recipient) == 0"); - _tmp73_ = gee_collection_get_size ((GeeCollection*) test_deque); - _tmp74_ = _tmp73_; - _vala_assert (_tmp74_ == 0, "test_deque.size == 0"); - _tmp75_ = gee_abstract_collection_get_size ((GeeCollection*) recipient); - _tmp76_ = _tmp75_; - _vala_assert (_tmp76_ == 0, "recipient.size == 0"); + _tmp3_ = g_strdup ("one"); + _tmp4_ = g_strdup ("two"); + _tmp5_ = g_strdup ("three"); + _tmp6_ = g_strdup ("four"); + _tmp7_ = g_strdup ("five"); + _tmp8_ = g_strdup ("six"); + _tmp9_ = g_strdup ("seven"); + _tmp10_ = g_strdup ("\neight"); + _tmp11_ = g_strdup ("nine"); + _tmp12_ = g_strdup ("ten"); + _tmp13_ = g_strdup ("eleven"); + _tmp14_ = g_strdup ("twelve"); + _tmp15_ = g_strdup ("thirteen"); + _tmp16_ = g_strdup ("fourteen\n"); + _tmp17_ = g_strdup ("fifteen"); + _tmp18_ = g_strdup ("sixteen"); + _tmp19_ = g_strdup ("seventeen"); + _tmp20_ = g_strdup ("eighteen"); + _tmp21_ = g_strdup ("nineteen\n"); + _tmp22_ = g_strdup ("twenty"); + _tmp23_ = g_strdup ("twenty one"); + _tmp24_ = g_strdup ("twenty two"); + _tmp25_ = g_strdup ("twenty three"); + _tmp26_ = g_strdup ("twenty four"); + _tmp27_ = g_strdup ("twenty five"); + _tmp28_ = g_strdup ("twenty six"); + _tmp29_ = g_strdup ("twenty seven"); + _tmp30_ = g_strdup ("twenty eight"); + _tmp31_ = g_strdup ("twenty nine"); + _tmp32_ = g_strdup ("thirty"); + _tmp33_ = g_strdup ("thirty one"); + _tmp34_ = g_strdup ("thirty two"); + _tmp35_ = g_strdup ("thirty four"); + _tmp36_ = g_strdup ("thirty five"); + _tmp37_ = g_strdup ("thirty six"); + _tmp38_ = g_strdup ("thirty seven"); + _tmp39_ = g_strdup ("thirty eight"); + _tmp40_ = g_strdup ("thirty nine"); + _tmp41_ = g_strdup ("fourty"); + _tmp42_ = g_new0 (gchar*, 39 + 1); + _tmp42_[0] = _tmp3_; + _tmp42_[1] = _tmp4_; + _tmp42_[2] = _tmp5_; + _tmp42_[3] = _tmp6_; + _tmp42_[4] = _tmp7_; + _tmp42_[5] = _tmp8_; + _tmp42_[6] = _tmp9_; + _tmp42_[7] = _tmp10_; + _tmp42_[8] = _tmp11_; + _tmp42_[9] = _tmp12_; + _tmp42_[10] = _tmp13_; + _tmp42_[11] = _tmp14_; + _tmp42_[12] = _tmp15_; + _tmp42_[13] = _tmp16_; + _tmp42_[14] = _tmp17_; + _tmp42_[15] = _tmp18_; + _tmp42_[16] = _tmp19_; + _tmp42_[17] = _tmp20_; + _tmp42_[18] = _tmp21_; + _tmp42_[19] = _tmp22_; + _tmp42_[20] = _tmp23_; + _tmp42_[21] = _tmp24_; + _tmp42_[22] = _tmp25_; + _tmp42_[23] = _tmp26_; + _tmp42_[24] = _tmp27_; + _tmp42_[25] = _tmp28_; + _tmp42_[26] = _tmp29_; + _tmp42_[27] = _tmp30_; + _tmp42_[28] = _tmp31_; + _tmp42_[29] = _tmp32_; + _tmp42_[30] = _tmp33_; + _tmp42_[31] = _tmp34_; + _tmp42_[32] = _tmp35_; + _tmp42_[33] = _tmp36_; + _tmp42_[34] = _tmp37_; + _tmp42_[35] = _tmp38_; + _tmp42_[36] = _tmp39_; + _tmp42_[37] = _tmp40_; + _tmp42_[38] = _tmp41_; + to_offer = _tmp42_; + to_offer_length1 = 39; + _to_offer_size_ = to_offer_length1; + _tmp43_ = test_deque; + _vala_assert (_tmp43_ != NULL, "test_deque != null"); + { + gint i; + i = 0; + { + gboolean _tmp44_; + _tmp44_ = TRUE; + while (TRUE) { + gboolean _tmp45_; + gint _tmp47_; + gchar** _tmp48_; + gint _tmp48__length1; + GeeDeque* _tmp49_; + gchar** _tmp50_; + gint _tmp50__length1; + gint _tmp51_; + const gchar* _tmp52_; + gboolean _tmp53_ = FALSE; + GeeDeque* _tmp54_; + gint _tmp55_; + gint _tmp56_; + gint _tmp57_; + _tmp45_ = _tmp44_; + if (!_tmp45_) { + gint _tmp46_; + _tmp46_ = i; + i = _tmp46_ + 1; + } + _tmp44_ = FALSE; + _tmp47_ = i; + _tmp48_ = to_offer; + _tmp48__length1 = to_offer_length1; + if (!(_tmp47_ < _tmp48__length1)) { + break; + } + _tmp49_ = test_deque; + _tmp50_ = to_offer; + _tmp50__length1 = to_offer_length1; + _tmp51_ = i; + _tmp52_ = _tmp50_[_tmp51_]; + _tmp53_ = gee_deque_offer_tail (_tmp49_, _tmp52_); + _vala_assert (_tmp53_, "test_deque.offer_tail (to_offer[i])"); + _tmp54_ = test_deque; + _tmp55_ = gee_collection_get_size ((GeeCollection*) _tmp54_); + _tmp56_ = _tmp55_; + _tmp57_ = i; + _vala_assert (_tmp56_ == (_tmp57_ + 1), "test_deque.size == i + 1"); + } + } + } + { + gint i; + i = 0; + { + gboolean _tmp58_; + _tmp58_ = TRUE; + while (TRUE) { + gboolean _tmp59_; + gint _tmp61_; + gchar** _tmp62_; + gint _tmp62__length1; + GeeDeque* _tmp63_; + gpointer _tmp64_ = NULL; + gchar* _tmp65_; + gchar** _tmp66_; + gint _tmp66__length1; + gchar** _tmp67_; + gint _tmp67__length1; + gint _tmp68_; + const gchar* _tmp69_; + GeeDeque* _tmp70_; + gpointer _tmp71_ = NULL; + gchar* _tmp72_; + gchar** _tmp73_; + gint _tmp73__length1; + gchar** _tmp74_; + gint _tmp74__length1; + gint _tmp75_; + const gchar* _tmp76_; + GeeDeque* _tmp77_; + gint _tmp78_; + gint _tmp79_; + gchar** _tmp80_; + gint _tmp80__length1; + gint _tmp81_; + _tmp59_ = _tmp58_; + if (!_tmp59_) { + gint _tmp60_; + _tmp60_ = i; + i = _tmp60_ + 1; + } + _tmp58_ = FALSE; + _tmp61_ = i; + _tmp62_ = to_offer; + _tmp62__length1 = to_offer_length1; + if (!(_tmp61_ < _tmp62__length1)) { + break; + } + _tmp63_ = test_deque; + _tmp64_ = gee_deque_peek_tail (_tmp63_); + _tmp65_ = (gchar*) _tmp64_; + _tmp66_ = to_offer; + _tmp66__length1 = to_offer_length1; + _tmp67_ = to_offer; + _tmp67__length1 = to_offer_length1; + _tmp68_ = i; + _tmp69_ = _tmp66_[(_tmp67__length1 - _tmp68_) - 1]; + _vala_assert (g_strcmp0 (_tmp65_, _tmp69_) == 0, "test_deque.peek_tail () == to_offer[to_offer.length - i - 1]"); + _g_free0 (_tmp65_); + _tmp70_ = test_deque; + _tmp71_ = gee_deque_poll_tail (_tmp70_); + _tmp72_ = (gchar*) _tmp71_; + _tmp73_ = to_offer; + _tmp73__length1 = to_offer_length1; + _tmp74_ = to_offer; + _tmp74__length1 = to_offer_length1; + _tmp75_ = i; + _tmp76_ = _tmp73_[(_tmp74__length1 - _tmp75_) - 1]; + _vala_assert (g_strcmp0 (_tmp72_, _tmp76_) == 0, "test_deque.poll_tail () == to_offer[to_offer.length - i - 1]"); + _g_free0 (_tmp72_); + _tmp77_ = test_deque; + _tmp78_ = gee_collection_get_size ((GeeCollection*) _tmp77_); + _tmp79_ = _tmp78_; + _tmp80_ = to_offer; + _tmp80__length1 = to_offer_length1; + _tmp81_ = i; + _vala_assert (_tmp79_ == ((_tmp80__length1 - _tmp81_) - 1), "test_deque.size == to_offer.length - i - 1"); + } + } + } + _tmp82_ = test_deque; + _tmp83_ = gee_deque_peek_tail (_tmp82_); + _tmp84_ = (gchar*) _tmp83_; + _vala_assert (_tmp84_ == NULL, "test_deque.peek_tail () == null"); + _g_free0 (_tmp84_); + _tmp85_ = test_deque; + _tmp86_ = gee_deque_poll_tail (_tmp85_); + _tmp87_ = (gchar*) _tmp86_; + _vala_assert (_tmp87_ == NULL, "test_deque.poll_tail () == null"); + _g_free0 (_tmp87_); + _tmp88_ = recipient; + gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp88_); + { + gint i; + i = 0; + { + gboolean _tmp89_; + _tmp89_ = TRUE; + while (TRUE) { + gboolean _tmp90_; + gint _tmp92_; + gchar** _tmp93_; + gint _tmp93__length1; + GeeDeque* _tmp94_; + gchar** _tmp95_; + gint _tmp95__length1; + gint _tmp96_; + const gchar* _tmp97_; + gboolean _tmp98_ = FALSE; + _tmp90_ = _tmp89_; + if (!_tmp90_) { + gint _tmp91_; + _tmp91_ = i; + i = _tmp91_ + 1; + } + _tmp89_ = FALSE; + _tmp92_ = i; + _tmp93_ = to_offer; + _tmp93__length1 = to_offer_length1; + if (!(_tmp92_ < _tmp93__length1)) { + break; + } + _tmp94_ = test_deque; + _tmp95_ = to_offer; + _tmp95__length1 = to_offer_length1; + _tmp96_ = i; + _tmp97_ = _tmp95_[_tmp96_]; + _tmp98_ = gee_deque_offer_tail (_tmp94_, _tmp97_); + _vala_assert (_tmp98_, "test_deque.offer_tail (to_offer[i])"); + } + } + } + _tmp99_ = test_deque; + _tmp100_ = gee_collection_get_size ((GeeCollection*) _tmp99_); + _tmp101_ = _tmp100_; + _tmp102_ = to_offer; + _tmp102__length1 = to_offer_length1; + _vala_assert (_tmp101_ == _tmp102__length1, "test_deque.size == to_offer.length"); + _tmp103_ = test_deque; + _tmp104_ = recipient; + _tmp105_ = gee_deque_drain_tail (_tmp103_, (GeeCollection*) _tmp104_, 1); + _vala_assert (_tmp105_ == 1, "test_deque.drain_tail (recipient, 1) == 1"); + _tmp106_ = test_deque; + _tmp107_ = gee_collection_get_size ((GeeCollection*) _tmp106_); + _tmp108_ = _tmp107_; + _tmp109_ = to_offer; + _tmp109__length1 = to_offer_length1; + _vala_assert (_tmp108_ == (_tmp109__length1 - 1), "test_deque.size == to_offer.length - 1"); + _tmp110_ = recipient; + _tmp111_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp110_); + _tmp112_ = _tmp111_; + _vala_assert (_tmp112_ == 1, "recipient.size == 1"); + _tmp113_ = recipient; + _tmp114_ = gee_abstract_list_get ((GeeAbstractList*) _tmp113_, 0); + _tmp115_ = (gchar*) _tmp114_; + _tmp116_ = to_offer; + _tmp116__length1 = to_offer_length1; + _tmp117_ = to_offer; + _tmp117__length1 = to_offer_length1; + _tmp118_ = _tmp116_[_tmp117__length1 - 1]; + _vala_assert (g_strcmp0 (_tmp115_, _tmp118_) == 0, "recipient.get (0) == to_offer[to_offer.length - 1]"); + _g_free0 (_tmp115_); + _tmp119_ = test_deque; + _tmp120_ = recipient; + _tmp121_ = gee_deque_drain_tail (_tmp119_, (GeeCollection*) _tmp120_, -1); + _tmp122_ = to_offer; + _tmp122__length1 = to_offer_length1; + _vala_assert (_tmp121_ == (_tmp122__length1 - 1), "test_deque.drain_tail (recipient) == to_offer.length - 1"); + _tmp123_ = test_deque; + _tmp124_ = gee_collection_get_size ((GeeCollection*) _tmp123_); + _tmp125_ = _tmp124_; + _vala_assert (_tmp125_ == 0, "test_deque.size == 0"); + _tmp126_ = recipient; + _tmp127_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp126_); + _tmp128_ = _tmp127_; + _tmp129_ = to_offer; + _tmp129__length1 = to_offer_length1; + _vala_assert (_tmp128_ == _tmp129__length1, "recipient.size == to_offer.length"); + { + gint i; + i = 1; + { + gboolean _tmp130_; + _tmp130_ = TRUE; + while (TRUE) { + gboolean _tmp131_; + gint _tmp133_; + gchar** _tmp134_; + gint _tmp134__length1; + GeeArrayList* _tmp135_; + gint _tmp136_; + gpointer _tmp137_ = NULL; + gchar* _tmp138_; + gchar** _tmp139_; + gint _tmp139__length1; + gchar** _tmp140_; + gint _tmp140__length1; + gint _tmp141_; + const gchar* _tmp142_; + _tmp131_ = _tmp130_; + if (!_tmp131_) { + gint _tmp132_; + _tmp132_ = i; + i = _tmp132_ + 1; + } + _tmp130_ = FALSE; + _tmp133_ = i; + _tmp134_ = to_offer; + _tmp134__length1 = to_offer_length1; + if (!(_tmp133_ < _tmp134__length1)) { + break; + } + _tmp135_ = recipient; + _tmp136_ = i; + _tmp137_ = gee_abstract_list_get ((GeeAbstractList*) _tmp135_, _tmp136_); + _tmp138_ = (gchar*) _tmp137_; + _tmp139_ = to_offer; + _tmp139__length1 = to_offer_length1; + _tmp140_ = to_offer; + _tmp140__length1 = to_offer_length1; + _tmp141_ = i; + _tmp142_ = _tmp139_[(_tmp140__length1 - _tmp141_) - 1]; + _vala_assert (g_strcmp0 (_tmp138_, _tmp142_) == 0, "recipient.get (i) == to_offer[to_offer.length - i - 1]"); + _g_free0 (_tmp138_); + } + } + } + _tmp143_ = recipient; + gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp143_); + _tmp144_ = test_deque; + _tmp145_ = recipient; + _tmp146_ = gee_deque_drain_tail (_tmp144_, (GeeCollection*) _tmp145_, 1); + _vala_assert (_tmp146_ == 0, "test_deque.drain_tail (recipient, 1) == 0"); + _tmp147_ = test_deque; + _tmp148_ = gee_collection_get_size ((GeeCollection*) _tmp147_); + _tmp149_ = _tmp148_; + _vala_assert (_tmp149_ == 0, "test_deque.size == 0"); + _tmp150_ = recipient; + _tmp151_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp150_); + _tmp152_ = _tmp151_; + _vala_assert (_tmp152_ == 0, "recipient.size == 0"); + _tmp153_ = recipient; + gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp153_); + _tmp154_ = test_deque; + _tmp155_ = recipient; + _tmp156_ = gee_deque_drain_tail (_tmp154_, (GeeCollection*) _tmp155_, -1); + _vala_assert (_tmp156_ == 0, "test_deque.drain_tail (recipient) == 0"); + _tmp157_ = test_deque; + _tmp158_ = gee_collection_get_size ((GeeCollection*) _tmp157_); + _tmp159_ = _tmp158_; + _vala_assert (_tmp159_ == 0, "test_deque.size == 0"); + _tmp160_ = recipient; + _tmp161_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp160_); + _tmp162_ = _tmp161_; + _vala_assert (_tmp162_ == 0, "recipient.size == 0"); + to_offer = (_vala_array_free (to_offer, to_offer_length1, (GDestroyNotify) g_free), NULL); _g_object_unref0 (recipient); _g_object_unref0 (test_deque); } @@ -870,4 +1708,22 @@ GType deque_tests_get_type (void) { } +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { + if ((array != NULL) && (destroy_func != NULL)) { + int i; + for (i = 0; i < array_length; i = i + 1) { + if (((gpointer*) array)[i] != NULL) { + destroy_func (((gpointer*) array)[i]); + } + } + } +} + + +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { + _vala_array_destroy (array, array_length, destroy_func); + g_free (array); +} + + |