/* abstract-field-details.c generated by valac 0.13.1.106-1068, the Vala compiler
 * generated from abstract-field-details.vala, do not modify */

/*
 * Copyright (C) 2011 Collabora Ltd.
 *
 * This library is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Authors: Travis Reitter <travis.reitter@collabora.co.uk>
 */

#include <glib.h>
#include <glib-object.h>
#include <folks-test.h>
#include <stdlib.h>
#include <string.h>
#include <folks/folks.h>
#include <gee.h>


#define TYPE_EMAIL_FIELD_DETAILS_TESTS (email_field_details_tests_get_type ())
#define EMAIL_FIELD_DETAILS_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_EMAIL_FIELD_DETAILS_TESTS, EmailFieldDetailsTests))
#define EMAIL_FIELD_DETAILS_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_EMAIL_FIELD_DETAILS_TESTS, EmailFieldDetailsTestsClass))
#define IS_EMAIL_FIELD_DETAILS_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_EMAIL_FIELD_DETAILS_TESTS))
#define IS_EMAIL_FIELD_DETAILS_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_EMAIL_FIELD_DETAILS_TESTS))
#define EMAIL_FIELD_DETAILS_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_EMAIL_FIELD_DETAILS_TESTS, EmailFieldDetailsTestsClass))

typedef struct _EmailFieldDetailsTests EmailFieldDetailsTests;
typedef struct _EmailFieldDetailsTestsClass EmailFieldDetailsTestsClass;
typedef struct _EmailFieldDetailsTestsPrivate EmailFieldDetailsTestsPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define __g_list_free__g_free0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_free0_ (var), NULL)))

struct _EmailFieldDetailsTests {
	FolksTestCase parent_instance;
	EmailFieldDetailsTestsPrivate * priv;
};

struct _EmailFieldDetailsTestsClass {
	FolksTestCaseClass parent_class;
};


static gpointer email_field_details_tests_parent_class = NULL;

GType email_field_details_tests_get_type (void) G_GNUC_CONST;
enum  {
	EMAIL_FIELD_DETAILS_TESTS_DUMMY_PROPERTY
};
EmailFieldDetailsTests* email_field_details_tests_new (void);
EmailFieldDetailsTests* email_field_details_tests_construct (GType object_type);
void email_field_details_tests_test_param_replacement (EmailFieldDetailsTests* self);
static void _email_field_details_tests_test_param_replacement_folks_test_case_test_method (gpointer self);
void email_field_details_tests_test_simple_equality (EmailFieldDetailsTests* self);
static void _email_field_details_tests_test_simple_equality_folks_test_case_test_method (gpointer self);
void email_field_details_tests_test_params_equality (EmailFieldDetailsTests* self);
static void _email_field_details_tests_test_params_equality_folks_test_case_test_method (gpointer self);
void email_field_details_tests_test_im_field_details_equality (EmailFieldDetailsTests* self);
static void _email_field_details_tests_test_im_field_details_equality_folks_test_case_test_method (gpointer self);
static void email_field_details_tests_real_set_up (FolksTestCase* base);
static void email_field_details_tests_real_tear_down (FolksTestCase* base);
static void _g_free0_ (gpointer var);
static void _g_list_free__g_free0_ (GList* self);
gint _vala_main (gchar** args, int args_length1);
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 _email_field_details_tests_test_param_replacement_folks_test_case_test_method (gpointer self) {
	email_field_details_tests_test_param_replacement (self);
}


static void _email_field_details_tests_test_simple_equality_folks_test_case_test_method (gpointer self) {
	email_field_details_tests_test_simple_equality (self);
}


static void _email_field_details_tests_test_params_equality_folks_test_case_test_method (gpointer self) {
	email_field_details_tests_test_params_equality (self);
}


static void _email_field_details_tests_test_im_field_details_equality_folks_test_case_test_method (gpointer self) {
	email_field_details_tests_test_im_field_details_equality (self);
}


EmailFieldDetailsTests* email_field_details_tests_construct (GType object_type) {
	EmailFieldDetailsTests * self = NULL;
	self = (EmailFieldDetailsTests*) folks_test_case_construct (object_type, "EmailFieldDetails");
	folks_test_case_add_test ((FolksTestCase*) self, "parameter replacement", _email_field_details_tests_test_param_replacement_folks_test_case_test_method, self);
	folks_test_case_add_test ((FolksTestCase*) self, "simple equality", _email_field_details_tests_test_simple_equality_folks_test_case_test_method, self);
	folks_test_case_add_test ((FolksTestCase*) self, "parameter equality", _email_field_details_tests_test_params_equality_folks_test_case_test_method, self);
	folks_test_case_add_test ((FolksTestCase*) self, "ImFieldDetails equality", _email_field_details_tests_test_im_field_details_equality_folks_test_case_test_method, self);
	return self;
}


EmailFieldDetailsTests* email_field_details_tests_new (void) {
	return email_field_details_tests_construct (TYPE_EMAIL_FIELD_DETAILS_TESTS);
}


static void email_field_details_tests_real_set_up (FolksTestCase* base) {
	EmailFieldDetailsTests * self;
	self = (EmailFieldDetailsTests*) base;
}


static void email_field_details_tests_real_tear_down (FolksTestCase* base) {
	EmailFieldDetailsTests * self;
	self = (EmailFieldDetailsTests*) base;
}


static void _g_free0_ (gpointer var) {
	var = (g_free (var), NULL);
}


static void _g_list_free__g_free0_ (GList* self) {
	g_list_foreach (self, (GFunc) _g_free0_, NULL);
	g_list_free (self);
}


void email_field_details_tests_test_param_replacement (EmailFieldDetailsTests* self) {
	gchar* _tmp0_;
	gchar* param_name;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar** _tmp4_ = NULL;
	gchar** values_1;
	gint values_1_length1;
	gint _values_1_size_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar** _tmp7_ = NULL;
	gchar** values_2;
	gint values_2_length1;
	gint _values_2_size_;
	FolksEmailFieldDetails* details = NULL;
	GeeCollection* values = NULL;
	const gchar* _tmp8_;
	FolksEmailFieldDetails* _tmp9_;
	gchar** _tmp10_;
	gint _tmp10__length1;
	FolksEmailFieldDetails* _tmp15_;
	const gchar* _tmp16_;
	GeeCollection* _tmp17_ = NULL;
	GeeCollection* _tmp18_;
	gint _tmp19_;
	gint _tmp20_;
	gchar** _tmp21_;
	gint _tmp21__length1;
	gchar** _tmp22_;
	gint _tmp22__length1;
	FolksEmailFieldDetails* _tmp27_;
	const gchar* _tmp28_;
	gchar** _tmp29_;
	gint _tmp29__length1;
	const gchar* _tmp30_;
	FolksEmailFieldDetails* _tmp31_;
	const gchar* _tmp32_;
	GeeCollection* _tmp33_ = NULL;
	GeeCollection* _tmp34_;
	gint _tmp35_;
	gint _tmp36_;
	GeeCollection* _tmp37_;
	gchar** _tmp38_;
	gint _tmp38__length1;
	const gchar* _tmp39_;
	gboolean _tmp40_ = FALSE;
	FolksEmailFieldDetails* _tmp41_;
	const gchar* _tmp42_;
	FolksEmailFieldDetails* _tmp43_;
	const gchar* _tmp44_;
	GeeCollection* _tmp45_ = NULL;
	GeeCollection* _tmp46_;
	gchar** _tmp47_;
	gint _tmp47__length1;
	GList* values_2_list;
	gchar** _tmp52_;
	gint _tmp52__length1;
	GeeHashMultiMap* _tmp56_;
	GeeHashMultiMap* param_table;
	GList* _tmp57_;
	FolksEmailFieldDetails* _tmp62_;
	GeeHashMultiMap* _tmp63_;
	FolksEmailFieldDetails* _tmp64_;
	const gchar* _tmp65_;
	GeeCollection* _tmp66_ = NULL;
	GeeCollection* _tmp67_;
	gint _tmp68_;
	gint _tmp69_;
	gchar** _tmp70_;
	gint _tmp70__length1;
	gchar** _tmp71_;
	gint _tmp71__length1;
	gchar** _tmp72_;
	gint _tmp72__length1;
	gchar** _tmp77_;
	gint _tmp77__length1;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup ("metasyntactic-variables");
	param_name = _tmp0_;
	_tmp1_ = g_strdup ("foo");
	_tmp2_ = g_strdup ("bar");
	_tmp3_ = g_strdup ("baz");
	_tmp4_ = g_new0 (gchar*, 3 + 1);
	_tmp4_[0] = _tmp1_;
	_tmp4_[1] = _tmp2_;
	_tmp4_[2] = _tmp3_;
	values_1 = _tmp4_;
	values_1_length1 = 3;
	_values_1_size_ = values_1_length1;
	_tmp5_ = g_strdup ("qux");
	_tmp6_ = g_strdup ("quxx");
	_tmp7_ = g_new0 (gchar*, 2 + 1);
	_tmp7_[0] = _tmp5_;
	_tmp7_[1] = _tmp6_;
	values_2 = _tmp7_;
	values_2_length1 = 2;
	_values_2_size_ = values_2_length1;
	_tmp8_ = param_name;
	_tmp9_ = folks_email_field_details_new (_tmp8_, NULL);
	_g_object_unref0 (details);
	details = _tmp9_;
	_tmp10_ = values_1;
	_tmp10__length1 = values_1_length1;
	{
		gchar** val_collection = NULL;
		gint val_collection_length1 = 0;
		gint _val_collection_size_ = 0;
		gint val_it = 0;
		val_collection = _tmp10_;
		val_collection_length1 = _tmp10__length1;
		for (val_it = 0; val_it < _tmp10__length1; val_it = val_it + 1) {
			gchar* _tmp11_;
			gchar* val = NULL;
			_tmp11_ = g_strdup (val_collection[val_it]);
			val = _tmp11_;
			{
				FolksEmailFieldDetails* _tmp12_;
				const gchar* _tmp13_;
				const gchar* _tmp14_;
				_tmp12_ = details;
				_tmp13_ = param_name;
				_tmp14_ = val;
				folks_abstract_field_details_add_parameter ((FolksAbstractFieldDetails*) _tmp12_, _tmp13_, _tmp14_);
				_g_free0 (val);
			}
		}
	}
	_tmp15_ = details;
	_tmp16_ = param_name;
	_tmp17_ = folks_abstract_field_details_get_parameter_values ((FolksAbstractFieldDetails*) _tmp15_, _tmp16_);
	_g_object_unref0 (values);
	values = _tmp17_;
	_tmp18_ = values;
	_tmp19_ = gee_collection_get_size (_tmp18_);
	_tmp20_ = _tmp19_;
	_tmp21_ = values_1;
	_tmp21__length1 = values_1_length1;
	g_assert (_tmp20_ == _tmp21__length1);
	_tmp22_ = values_1;
	_tmp22__length1 = values_1_length1;
	{
		gchar** val_collection = NULL;
		gint val_collection_length1 = 0;
		gint _val_collection_size_ = 0;
		gint val_it = 0;
		val_collection = _tmp22_;
		val_collection_length1 = _tmp22__length1;
		for (val_it = 0; val_it < _tmp22__length1; val_it = val_it + 1) {
			gchar* _tmp23_;
			gchar* val = NULL;
			_tmp23_ = g_strdup (val_collection[val_it]);
			val = _tmp23_;
			{
				GeeCollection* _tmp24_;
				const gchar* _tmp25_;
				gboolean _tmp26_ = FALSE;
				_tmp24_ = values;
				_tmp25_ = val;
				_tmp26_ = gee_collection_contains (_tmp24_, _tmp25_);
				g_assert (_tmp26_);
				_g_free0 (val);
			}
		}
	}
	_tmp27_ = details;
	_tmp28_ = param_name;
	_tmp29_ = values_2;
	_tmp29__length1 = values_2_length1;
	_tmp30_ = _tmp29_[0];
	folks_abstract_field_details_set_parameter ((FolksAbstractFieldDetails*) _tmp27_, _tmp28_, _tmp30_);
	_tmp31_ = details;
	_tmp32_ = param_name;
	_tmp33_ = folks_abstract_field_details_get_parameter_values ((FolksAbstractFieldDetails*) _tmp31_, _tmp32_);
	_g_object_unref0 (values);
	values = _tmp33_;
	_tmp34_ = values;
	_tmp35_ = gee_collection_get_size (_tmp34_);
	_tmp36_ = _tmp35_;
	g_assert (_tmp36_ == 1);
	_tmp37_ = values;
	_tmp38_ = values_2;
	_tmp38__length1 = values_2_length1;
	_tmp39_ = _tmp38_[0];
	_tmp40_ = gee_collection_contains (_tmp37_, _tmp39_);
	g_assert (_tmp40_);
	_tmp41_ = details;
	_tmp42_ = param_name;
	folks_abstract_field_details_remove_parameter_all ((FolksAbstractFieldDetails*) _tmp41_, _tmp42_);
	_tmp43_ = details;
	_tmp44_ = param_name;
	_tmp45_ = folks_abstract_field_details_get_parameter_values ((FolksAbstractFieldDetails*) _tmp43_, _tmp44_);
	_g_object_unref0 (values);
	values = _tmp45_;
	_tmp46_ = values;
	g_assert (_tmp46_ == NULL);
	_tmp47_ = values_1;
	_tmp47__length1 = values_1_length1;
	{
		gchar** val_collection = NULL;
		gint val_collection_length1 = 0;
		gint _val_collection_size_ = 0;
		gint val_it = 0;
		val_collection = _tmp47_;
		val_collection_length1 = _tmp47__length1;
		for (val_it = 0; val_it < _tmp47__length1; val_it = val_it + 1) {
			gchar* _tmp48_;
			gchar* val = NULL;
			_tmp48_ = g_strdup (val_collection[val_it]);
			val = _tmp48_;
			{
				FolksEmailFieldDetails* _tmp49_;
				const gchar* _tmp50_;
				const gchar* _tmp51_;
				_tmp49_ = details;
				_tmp50_ = param_name;
				_tmp51_ = val;
				folks_abstract_field_details_add_parameter ((FolksAbstractFieldDetails*) _tmp49_, _tmp50_, _tmp51_);
				_g_free0 (val);
			}
		}
	}
	values_2_list = NULL;
	_tmp52_ = values_2;
	_tmp52__length1 = values_2_length1;
	{
		gchar** val_collection = NULL;
		gint val_collection_length1 = 0;
		gint _val_collection_size_ = 0;
		gint val_it = 0;
		val_collection = _tmp52_;
		val_collection_length1 = _tmp52__length1;
		for (val_it = 0; val_it < _tmp52__length1; val_it = val_it + 1) {
			gchar* _tmp53_;
			gchar* val = NULL;
			_tmp53_ = g_strdup (val_collection[val_it]);
			val = _tmp53_;
			{
				const gchar* _tmp54_;
				gchar* _tmp55_;
				_tmp54_ = val;
				_tmp55_ = g_strdup (_tmp54_);
				values_2_list = g_list_append (values_2_list, _tmp55_);
				_g_free0 (val);
			}
		}
	}
	_tmp56_ = gee_hash_multi_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL);
	param_table = _tmp56_;
	_tmp57_ = values_2_list;
	{
		GList* val_collection = NULL;
		GList* val_it = NULL;
		val_collection = _tmp57_;
		for (val_it = val_collection; val_it != NULL; val_it = val_it->next) {
			gchar* _tmp58_;
			gchar* val = NULL;
			_tmp58_ = g_strdup ((const gchar*) val_it->data);
			val = _tmp58_;
			{
				GeeHashMultiMap* _tmp59_;
				const gchar* _tmp60_;
				const gchar* _tmp61_;
				_tmp59_ = param_table;
				_tmp60_ = param_name;
				_tmp61_ = val;
				gee_multi_map_set ((GeeMultiMap*) _tmp59_, _tmp60_, _tmp61_);
				_g_free0 (val);
			}
		}
	}
	_tmp62_ = details;
	_tmp63_ = param_table;
	folks_abstract_field_details_extend_parameters ((FolksAbstractFieldDetails*) _tmp62_, (GeeMultiMap*) _tmp63_);
	_tmp64_ = details;
	_tmp65_ = param_name;
	_tmp66_ = folks_abstract_field_details_get_parameter_values ((FolksAbstractFieldDetails*) _tmp64_, _tmp65_);
	_g_object_unref0 (values);
	values = _tmp66_;
	_tmp67_ = values;
	_tmp68_ = gee_collection_get_size (_tmp67_);
	_tmp69_ = _tmp68_;
	_tmp70_ = values_1;
	_tmp70__length1 = values_1_length1;
	_tmp71_ = values_2;
	_tmp71__length1 = values_2_length1;
	g_assert (_tmp69_ == (_tmp70__length1 + _tmp71__length1));
	_tmp72_ = values_1;
	_tmp72__length1 = values_1_length1;
	{
		gchar** val_collection = NULL;
		gint val_collection_length1 = 0;
		gint _val_collection_size_ = 0;
		gint val_it = 0;
		val_collection = _tmp72_;
		val_collection_length1 = _tmp72__length1;
		for (val_it = 0; val_it < _tmp72__length1; val_it = val_it + 1) {
			gchar* _tmp73_;
			gchar* val = NULL;
			_tmp73_ = g_strdup (val_collection[val_it]);
			val = _tmp73_;
			{
				GeeCollection* _tmp74_;
				const gchar* _tmp75_;
				gboolean _tmp76_ = FALSE;
				_tmp74_ = values;
				_tmp75_ = val;
				_tmp76_ = gee_collection_contains (_tmp74_, _tmp75_);
				g_assert (_tmp76_);
				_g_free0 (val);
			}
		}
	}
	_tmp77_ = values_2;
	_tmp77__length1 = values_2_length1;
	{
		gchar** val_collection = NULL;
		gint val_collection_length1 = 0;
		gint _val_collection_size_ = 0;
		gint val_it = 0;
		val_collection = _tmp77_;
		val_collection_length1 = _tmp77__length1;
		for (val_it = 0; val_it < _tmp77__length1; val_it = val_it + 1) {
			gchar* _tmp78_;
			gchar* val = NULL;
			_tmp78_ = g_strdup (val_collection[val_it]);
			val = _tmp78_;
			{
				GeeCollection* _tmp79_;
				const gchar* _tmp80_;
				gboolean _tmp81_ = FALSE;
				_tmp79_ = values;
				_tmp80_ = val;
				_tmp81_ = gee_collection_contains (_tmp79_, _tmp80_);
				g_assert (_tmp81_);
				_g_free0 (val);
			}
		}
	}
	_g_object_unref0 (param_table);
	__g_list_free__g_free0_0 (values_2_list);
	_g_object_unref0 (values);
	_g_object_unref0 (details);
	values_2 = (_vala_array_free (values_2, values_2_length1, (GDestroyNotify) g_free), NULL);
	values_1 = (_vala_array_free (values_1, values_1_length1, (GDestroyNotify) g_free), NULL);
	_g_free0 (param_name);
}


void email_field_details_tests_test_simple_equality (EmailFieldDetailsTests* self) {
	FolksEmailFieldDetails* _tmp0_;
	FolksEmailFieldDetails* details_a_1;
	FolksEmailFieldDetails* _tmp1_;
	FolksEmailFieldDetails* details_a_2;
	FolksEmailFieldDetails* _tmp2_;
	FolksEmailFieldDetails* details_b_1;
	FolksEmailFieldDetails* _tmp3_;
	FolksEmailFieldDetails* _tmp4_;
	gboolean _tmp5_ = FALSE;
	FolksEmailFieldDetails* _tmp6_;
	FolksEmailFieldDetails* _tmp7_;
	gboolean _tmp8_ = FALSE;
	FolksEmailFieldDetails* _tmp9_;
	FolksEmailFieldDetails* _tmp10_;
	gboolean _tmp11_ = FALSE;
	FolksEmailFieldDetails* _tmp12_;
	FolksEmailFieldDetails* _tmp13_;
	gboolean _tmp14_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = folks_email_field_details_new ("foo", NULL);
	details_a_1 = _tmp0_;
	_tmp1_ = folks_email_field_details_new ("foo", NULL);
	details_a_2 = _tmp1_;
	_tmp2_ = folks_email_field_details_new ("bar", NULL);
	details_b_1 = _tmp2_;
	_tmp3_ = details_a_1;
	_tmp4_ = details_a_2;
	_tmp5_ = folks_abstract_field_details_equal ((FolksAbstractFieldDetails*) _tmp3_, (FolksAbstractFieldDetails*) _tmp4_);
	g_assert (_tmp5_);
	_tmp6_ = details_a_1;
	_tmp7_ = details_b_1;
	_tmp8_ = folks_abstract_field_details_equal ((FolksAbstractFieldDetails*) _tmp6_, (FolksAbstractFieldDetails*) _tmp7_);
	g_assert (!_tmp8_);
	_tmp9_ = details_b_1;
	_tmp10_ = details_a_1;
	_tmp11_ = folks_abstract_field_details_equal ((FolksAbstractFieldDetails*) _tmp9_, (FolksAbstractFieldDetails*) _tmp10_);
	g_assert (!_tmp11_);
	_tmp12_ = details_b_1;
	_tmp13_ = details_a_2;
	_tmp14_ = folks_abstract_field_details_equal ((FolksAbstractFieldDetails*) _tmp12_, (FolksAbstractFieldDetails*) _tmp13_);
	g_assert (!_tmp14_);
	_g_object_unref0 (details_b_1);
	_g_object_unref0 (details_a_2);
	_g_object_unref0 (details_a_1);
}


void email_field_details_tests_test_params_equality (EmailFieldDetailsTests* self) {
	FolksEmailFieldDetails* _tmp0_;
	FolksEmailFieldDetails* details_a_1;
	FolksEmailFieldDetails* _tmp1_;
	FolksEmailFieldDetails* details_a_2;
	GeeHashMultiMap* _tmp2_;
	GeeHashMultiMap* parameters;
	GeeHashMultiMap* _tmp3_;
	GeeHashMultiMap* _tmp4_;
	GeeHashMultiMap* _tmp5_;
	FolksEmailFieldDetails* _tmp6_;
	GeeHashMultiMap* _tmp7_;
	FolksEmailFieldDetails* _tmp29_;
	FolksEmailFieldDetails* _tmp30_;
	gboolean _tmp31_ = FALSE;
	FolksEmailFieldDetails* _tmp32_;
	FolksEmailFieldDetails* _tmp33_;
	FolksEmailFieldDetails* _tmp34_;
	gboolean _tmp35_ = FALSE;
	FolksEmailFieldDetails* _tmp36_;
	FolksEmailFieldDetails* _tmp37_;
	FolksEmailFieldDetails* _tmp38_;
	gboolean _tmp39_ = FALSE;
	FolksEmailFieldDetails* _tmp40_;
	FolksEmailFieldDetails* _tmp41_;
	FolksEmailFieldDetails* _tmp42_;
	gboolean _tmp43_ = FALSE;
	FolksEmailFieldDetails* _tmp44_;
	FolksEmailFieldDetails* _tmp45_;
	FolksEmailFieldDetails* _tmp46_;
	gboolean _tmp47_ = FALSE;
	FolksEmailFieldDetails* _tmp48_;
	GeeMultiMap* _tmp49_;
	GeeMultiMap* _tmp50_;
	FolksEmailFieldDetails* _tmp51_;
	FolksEmailFieldDetails* _tmp52_;
	gboolean _tmp53_ = FALSE;
	FolksEmailFieldDetails* _tmp54_;
	GeeMultiMap* _tmp55_;
	GeeMultiMap* _tmp56_;
	FolksEmailFieldDetails* _tmp57_;
	FolksEmailFieldDetails* _tmp58_;
	gboolean _tmp59_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = folks_email_field_details_new ("foo", NULL);
	details_a_1 = _tmp0_;
	_tmp1_ = folks_email_field_details_new ("foo", NULL);
	details_a_2 = _tmp1_;
	_tmp2_ = gee_hash_multi_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL);
	parameters = _tmp2_;
	_tmp3_ = parameters;
	gee_multi_map_set ((GeeMultiMap*) _tmp3_, "bar", "baz");
	_tmp4_ = parameters;
	gee_multi_map_set ((GeeMultiMap*) _tmp4_, "qux", "quux");
	_tmp5_ = parameters;
	gee_multi_map_set ((GeeMultiMap*) _tmp5_, "qux", "quuux");
	_tmp6_ = details_a_1;
	_tmp7_ = parameters;
	folks_abstract_field_details_set_parameters ((FolksAbstractFieldDetails*) _tmp6_, (GeeMultiMap*) _tmp7_);
	{
		GeeHashMultiMap* _tmp8_;
		GeeSet* _tmp9_ = NULL;
		GeeSet* _tmp10_;
		GeeIterator* _tmp11_ = NULL;
		GeeIterator* _tmp12_;
		GeeIterator* _param_it;
		_tmp8_ = parameters;
		_tmp9_ = gee_multi_map_get_keys ((GeeMultiMap*) _tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = gee_iterable_iterator ((GeeIterable*) _tmp10_);
		_tmp12_ = _tmp11_;
		_g_object_unref0 (_tmp10_);
		_param_it = _tmp12_;
		while (TRUE) {
			GeeIterator* _tmp13_;
			gboolean _tmp14_ = FALSE;
			GeeIterator* _tmp15_;
			gpointer _tmp16_ = NULL;
			gchar* param;
			GeeHashMultiMap* _tmp17_;
			const gchar* _tmp18_;
			GeeCollection* _tmp19_ = NULL;
			GeeCollection* values;
			_tmp13_ = _param_it;
			_tmp14_ = gee_iterator_next (_tmp13_);
			if (!_tmp14_) {
				break;
			}
			_tmp15_ = _param_it;
			_tmp16_ = gee_iterator_get (_tmp15_);
			param = (gchar*) _tmp16_;
			_tmp17_ = parameters;
			_tmp18_ = param;
			_tmp19_ = gee_multi_map_get ((GeeMultiMap*) _tmp17_, _tmp18_);
			values = _tmp19_;
			{
				GeeCollection* _tmp20_;
				GeeIterator* _tmp21_ = NULL;
				GeeIterator* _value_it;
				_tmp20_ = values;
				_tmp21_ = gee_iterable_iterator ((GeeIterable*) _tmp20_);
				_value_it = _tmp21_;
				while (TRUE) {
					GeeIterator* _tmp22_;
					gboolean _tmp23_ = FALSE;
					GeeIterator* _tmp24_;
					gpointer _tmp25_ = NULL;
					gchar* value;
					FolksEmailFieldDetails* _tmp26_;
					const gchar* _tmp27_;
					const gchar* _tmp28_;
					_tmp22_ = _value_it;
					_tmp23_ = gee_iterator_next (_tmp22_);
					if (!_tmp23_) {
						break;
					}
					_tmp24_ = _value_it;
					_tmp25_ = gee_iterator_get (_tmp24_);
					value = (gchar*) _tmp25_;
					_tmp26_ = details_a_2;
					_tmp27_ = param;
					_tmp28_ = value;
					folks_abstract_field_details_add_parameter ((FolksAbstractFieldDetails*) _tmp26_, _tmp27_, _tmp28_);
					_g_free0 (value);
				}
				_g_object_unref0 (_value_it);
			}
			_g_object_unref0 (values);
			_g_free0 (param);
		}
		_g_object_unref0 (_param_it);
	}
	_tmp29_ = details_a_1;
	_tmp30_ = details_a_2;
	_tmp31_ = folks_abstract_field_details_equal ((FolksAbstractFieldDetails*) _tmp29_, (FolksAbstractFieldDetails*) _tmp30_);
	g_assert (_tmp31_);
	_tmp32_ = details_a_2;
	folks_abstract_field_details_add_parameter ((FolksAbstractFieldDetails*) _tmp32_, "bar", "baz");
	_tmp33_ = details_a_1;
	_tmp34_ = details_a_2;
	_tmp35_ = folks_abstract_field_details_equal ((FolksAbstractFieldDetails*) _tmp33_, (FolksAbstractFieldDetails*) _tmp34_);
	g_assert (_tmp35_);
	_tmp36_ = details_a_2;
	folks_abstract_field_details_add_parameter ((FolksAbstractFieldDetails*) _tmp36_, "bar", "new");
	_tmp37_ = details_a_1;
	_tmp38_ = details_a_2;
	_tmp39_ = folks_abstract_field_details_equal ((FolksAbstractFieldDetails*) _tmp37_, (FolksAbstractFieldDetails*) _tmp38_);
	g_assert (!_tmp39_);
	_tmp40_ = details_a_2;
	folks_abstract_field_details_set_parameter ((FolksAbstractFieldDetails*) _tmp40_, "bar", "baz");
	_tmp41_ = details_a_1;
	_tmp42_ = details_a_2;
	_tmp43_ = folks_abstract_field_details_equal ((FolksAbstractFieldDetails*) _tmp41_, (FolksAbstractFieldDetails*) _tmp42_);
	g_assert (_tmp43_);
	_tmp44_ = details_a_2;
	folks_abstract_field_details_add_parameter ((FolksAbstractFieldDetails*) _tmp44_, "bar", "new");
	_tmp45_ = details_a_1;
	_tmp46_ = details_a_2;
	_tmp47_ = folks_abstract_field_details_equal ((FolksAbstractFieldDetails*) _tmp45_, (FolksAbstractFieldDetails*) _tmp46_);
	g_assert (!_tmp47_);
	_tmp48_ = details_a_2;
	_tmp49_ = folks_abstract_field_details_get_parameters ((FolksAbstractFieldDetails*) _tmp48_);
	_tmp50_ = _tmp49_;
	gee_multi_map_remove (_tmp50_, "bar", "new");
	_tmp51_ = details_a_1;
	_tmp52_ = details_a_2;
	_tmp53_ = folks_abstract_field_details_equal ((FolksAbstractFieldDetails*) _tmp51_, (FolksAbstractFieldDetails*) _tmp52_);
	g_assert (_tmp53_);
	_tmp54_ = details_a_2;
	_tmp55_ = folks_abstract_field_details_get_parameters ((FolksAbstractFieldDetails*) _tmp54_);
	_tmp56_ = _tmp55_;
	gee_multi_map_remove_all (_tmp56_, "bar");
	_tmp57_ = details_a_1;
	_tmp58_ = details_a_2;
	_tmp59_ = folks_abstract_field_details_equal ((FolksAbstractFieldDetails*) _tmp57_, (FolksAbstractFieldDetails*) _tmp58_);
	g_assert (!_tmp59_);
	_g_object_unref0 (parameters);
	_g_object_unref0 (details_a_2);
	_g_object_unref0 (details_a_1);
}


void email_field_details_tests_test_im_field_details_equality (EmailFieldDetailsTests* self) {
	FolksImFieldDetails* _tmp0_;
	FolksImFieldDetails* details_a_1;
	FolksImFieldDetails* _tmp1_;
	FolksImFieldDetails* details_a_2;
	FolksImFieldDetails* _tmp2_;
	FolksImFieldDetails* details_b_1;
	FolksImFieldDetails* _tmp3_;
	FolksImFieldDetails* _tmp4_;
	gboolean _tmp5_ = FALSE;
	FolksImFieldDetails* _tmp6_;
	FolksImFieldDetails* _tmp7_;
	gboolean _tmp8_ = FALSE;
	FolksEmailFieldDetails* _tmp9_;
	FolksEmailFieldDetails* details_c_1;
	FolksImFieldDetails* _tmp10_;
	FolksEmailFieldDetails* _tmp11_;
	gboolean _tmp12_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = folks_im_field_details_new ("foo@example.org", NULL);
	details_a_1 = _tmp0_;
	_tmp1_ = folks_im_field_details_new ("foo@example.org", NULL);
	details_a_2 = _tmp1_;
	_tmp2_ = folks_im_field_details_new ("bar@other.example.org", NULL);
	details_b_1 = _tmp2_;
	_tmp3_ = details_a_1;
	_tmp4_ = details_a_2;
	_tmp5_ = folks_abstract_field_details_equal ((FolksAbstractFieldDetails*) _tmp3_, (FolksAbstractFieldDetails*) _tmp4_);
	g_assert (_tmp5_);
	_tmp6_ = details_a_1;
	_tmp7_ = details_b_1;
	_tmp8_ = folks_abstract_field_details_equal ((FolksAbstractFieldDetails*) _tmp6_, (FolksAbstractFieldDetails*) _tmp7_);
	g_assert (!_tmp8_);
	_tmp9_ = folks_email_field_details_new ("foo@example.org", NULL);
	details_c_1 = _tmp9_;
	_tmp10_ = details_a_1;
	_tmp11_ = details_c_1;
	_tmp12_ = folks_abstract_field_details_equal ((FolksAbstractFieldDetails*) _tmp10_, (FolksAbstractFieldDetails*) _tmp11_);
	g_assert (!_tmp12_);
	_g_object_unref0 (details_c_1);
	_g_object_unref0 (details_b_1);
	_g_object_unref0 (details_a_2);
	_g_object_unref0 (details_a_1);
}


static void email_field_details_tests_class_init (EmailFieldDetailsTestsClass * klass) {
	email_field_details_tests_parent_class = g_type_class_peek_parent (klass);
	FOLKS_TEST_CASE_CLASS (klass)->set_up = email_field_details_tests_real_set_up;
	FOLKS_TEST_CASE_CLASS (klass)->tear_down = email_field_details_tests_real_tear_down;
}


static void email_field_details_tests_instance_init (EmailFieldDetailsTests * self) {
}


GType email_field_details_tests_get_type (void) {
	static volatile gsize email_field_details_tests_type_id__volatile = 0;
	if (g_once_init_enter (&email_field_details_tests_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (EmailFieldDetailsTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) email_field_details_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (EmailFieldDetailsTests), 0, (GInstanceInitFunc) email_field_details_tests_instance_init, NULL };
		GType email_field_details_tests_type_id;
		email_field_details_tests_type_id = g_type_register_static (FOLKS_TYPE_TEST_CASE, "EmailFieldDetailsTests", &g_define_type_info, 0);
		g_once_init_leave (&email_field_details_tests_type_id__volatile, email_field_details_tests_type_id);
	}
	return email_field_details_tests_type_id__volatile;
}


gint _vala_main (gchar** args, int args_length1) {
	gint result = 0;
	GTestSuite* _tmp0_ = NULL;
	GTestSuite* root;
	GTestSuite* _tmp1_;
	EmailFieldDetailsTests* _tmp2_;
	EmailFieldDetailsTests* _tmp3_;
	GTestSuite* _tmp4_ = NULL;
	g_test_init (&args_length1, &args, NULL);
	_tmp0_ = g_test_get_root ();
	root = _tmp0_;
	_tmp1_ = root;
	_tmp2_ = email_field_details_tests_new ();
	_tmp3_ = _tmp2_;
	_tmp4_ = folks_test_case_get_suite ((FolksTestCase*) _tmp3_);
	g_test_suite_add_suite (_tmp1_, _tmp4_);
	_g_object_unref0 (_tmp3_);
	g_test_run ();
	result = 0;
	return result;
}


int main (int argc, char ** argv) {
	g_type_init ();
	return _vala_main (argv, argc);
}


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);
}



