/* tests-integrity.c generated by valac 0.12.1.1-323029-dirty, the Vala compiler
 * generated from tests-integrity.vala, do not modify */


#include <glib.h>
#include <glib-object.h>
#include <afrodite.h>
#include <stdlib.h>
#include <string.h>
#include <valagee.h>
#include <gobject/gvaluecollector.h>


#define AFRODITE_TESTS_TYPE_INTEGRITY (afrodite_tests_integrity_get_type ())
#define AFRODITE_TESTS_INTEGRITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), AFRODITE_TESTS_TYPE_INTEGRITY, AfroditeTestsIntegrity))
#define AFRODITE_TESTS_INTEGRITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AFRODITE_TESTS_TYPE_INTEGRITY, AfroditeTestsIntegrityClass))
#define AFRODITE_TESTS_IS_INTEGRITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AFRODITE_TESTS_TYPE_INTEGRITY))
#define AFRODITE_TESTS_IS_INTEGRITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), AFRODITE_TESTS_TYPE_INTEGRITY))
#define AFRODITE_TESTS_INTEGRITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), AFRODITE_TESTS_TYPE_INTEGRITY, AfroditeTestsIntegrityClass))

typedef struct _AfroditeTestsIntegrity AfroditeTestsIntegrity;
typedef struct _AfroditeTestsIntegrityClass AfroditeTestsIntegrityClass;
typedef struct _AfroditeTestsIntegrityPrivate AfroditeTestsIntegrityPrivate;

#define AFRODITE_TESTS_TYPE_COMPLETION_MANAGER (afrodite_tests_completion_manager_get_type ())
#define AFRODITE_TESTS_COMPLETION_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), AFRODITE_TESTS_TYPE_COMPLETION_MANAGER, AfroditeTestsCompletionManager))
#define AFRODITE_TESTS_COMPLETION_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AFRODITE_TESTS_TYPE_COMPLETION_MANAGER, AfroditeTestsCompletionManagerClass))
#define AFRODITE_TESTS_IS_COMPLETION_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AFRODITE_TESTS_TYPE_COMPLETION_MANAGER))
#define AFRODITE_TESTS_IS_COMPLETION_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), AFRODITE_TESTS_TYPE_COMPLETION_MANAGER))
#define AFRODITE_TESTS_COMPLETION_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), AFRODITE_TESTS_TYPE_COMPLETION_MANAGER, AfroditeTestsCompletionManagerClass))

typedef struct _AfroditeTestsCompletionManager AfroditeTestsCompletionManager;
typedef struct _AfroditeTestsCompletionManagerClass AfroditeTestsCompletionManagerClass;
#define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))
#define _vala_iterator_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterator_unref (var), NULL)))
#define _afrodite_source_file_unref0(var) ((var == NULL) ? NULL : (var = (afrodite_source_file_unref (var), NULL)))
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
#define _afrodite_source_reference_unref0(var) ((var == NULL) ? NULL : (var = (afrodite_source_reference_unref (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _afrodite_code_dom_unref0(var) ((var == NULL) ? NULL : (var = (afrodite_code_dom_unref (var), NULL)))
#define _afrodite_tests_completion_manager_unref0(var) ((var == NULL) ? NULL : (var = (afrodite_tests_completion_manager_unref (var), NULL)))
typedef struct _AfroditeTestsParamSpecIntegrity AfroditeTestsParamSpecIntegrity;

struct _AfroditeTestsIntegrity {
	GTypeInstance parent_instance;
	volatile int ref_count;
	AfroditeTestsIntegrityPrivate * priv;
};

struct _AfroditeTestsIntegrityClass {
	GTypeClass parent_class;
	void (*finalize) (AfroditeTestsIntegrity *self);
};

struct _AfroditeTestsParamSpecIntegrity {
	GParamSpec parent_instance;
};


static gpointer afrodite_tests_integrity_parent_class = NULL;
static AfroditeTestsCompletionManager* afrodite_tests_integrity__manager;
static AfroditeTestsCompletionManager* afrodite_tests_integrity__manager = NULL;

gpointer afrodite_tests_integrity_ref (gpointer instance);
void afrodite_tests_integrity_unref (gpointer instance);
GParamSpec* afrodite_tests_param_spec_integrity (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void afrodite_tests_value_set_integrity (GValue* value, gpointer v_object);
void afrodite_tests_value_take_integrity (GValue* value, gpointer v_object);
gpointer afrodite_tests_value_get_integrity (const GValue* value);
GType afrodite_tests_integrity_get_type (void) G_GNUC_CONST;
enum  {
	AFRODITE_TESTS_INTEGRITY_DUMMY_PROPERTY
};
gpointer afrodite_tests_completion_manager_ref (gpointer instance);
void afrodite_tests_completion_manager_unref (gpointer instance);
GParamSpec* afrodite_tests_param_spec_completion_manager (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void afrodite_tests_value_set_completion_manager (GValue* value, gpointer v_object);
void afrodite_tests_value_take_completion_manager (GValue* value, gpointer v_object);
gpointer afrodite_tests_value_get_completion_manager (const GValue* value);
GType afrodite_tests_completion_manager_get_type (void) G_GNUC_CONST;
void afrodite_tests_integrity_test_source_remove (void);
AfroditeCompletionEngine* afrodite_tests_completion_manager_get_engine (AfroditeTestsCompletionManager* self);
const gchar* afrodite_tests_completion_manager_get_filename (AfroditeTestsCompletionManager* self);
static void _g_free0_ (gpointer var);
void afrodite_tests_completion_manager_remove_source (AfroditeTestsCompletionManager* self);
gint afrodite_tests_integrity_main (gchar** args, int args_length1);
static void _afrodite_tests_integrity_test_source_remove_gcallback (void);
AfroditeTestsCompletionManager* afrodite_tests_completion_manager_new (const gchar* filename, gboolean absolute);
AfroditeTestsCompletionManager* afrodite_tests_completion_manager_construct (GType object_type, const gchar* filename, gboolean absolute);
void afrodite_tests_completion_manager_parse (AfroditeTestsCompletionManager* self);
AfroditeTestsIntegrity* afrodite_tests_integrity_new (void);
AfroditeTestsIntegrity* afrodite_tests_integrity_construct (GType object_type);
static void afrodite_tests_integrity_finalize (AfroditeTestsIntegrity* obj);


static gpointer _afrodite_code_dom_ref0 (gpointer self) {
	return self ? afrodite_code_dom_ref (self) : NULL;
}


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


static gpointer _vala_iterable_ref0 (gpointer self) {
	return self ? vala_iterable_ref (self) : NULL;
}


static gpointer _afrodite_source_reference_ref0 (gpointer self) {
	return self ? afrodite_source_reference_ref (self) : NULL;
}


void afrodite_tests_integrity_test_source_remove (void) {
	AfroditeCompletionEngine* _tmp0_ = NULL;
	AfroditeCodeDom* _tmp1_ = NULL;
	AfroditeCodeDom* _tmp2_;
	AfroditeCodeDom* codedom;
	const gchar* _tmp3_ = NULL;
	AfroditeSourceFile* _tmp4_ = NULL;
	AfroditeSourceFile* source;
	GHashTable* _tmp5_ = NULL;
	GHashTable* symbol_table;
	GHashTable* _tmp13_ = NULL;
	GHashTable* file_symbol_table;
	const gchar* _tmp19_ = NULL;
	AfroditeSourceFile* _tmp20_ = NULL;
	GList* _tmp21_ = NULL;
	_tmp0_ = afrodite_tests_completion_manager_get_engine (afrodite_tests_integrity__manager);
	_tmp1_ = afrodite_completion_engine_get_codedom (_tmp0_);
	_tmp2_ = _afrodite_code_dom_ref0 (_tmp1_);
	codedom = _tmp2_;
	_tmp3_ = afrodite_tests_completion_manager_get_filename (afrodite_tests_integrity__manager);
	_tmp4_ = afrodite_code_dom_lookup_source_file (codedom, _tmp3_);
	source = _tmp4_;
	g_assert (source != NULL);
	_tmp5_ = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, _g_free0_);
	symbol_table = _tmp5_;
	{
		ValaCollection* _tmp6_ = NULL;
		ValaCollection* _tmp7_;
		ValaIterator* _tmp8_ = NULL;
		ValaIterator* _tmp9_;
		ValaIterator* _symbol_it;
		_tmp6_ = vala_map_get_values ((ValaMap*) codedom->symbols);
		_tmp7_ = _tmp6_;
		_tmp8_ = vala_iterable_iterator ((ValaIterable*) _tmp7_);
		_tmp9_ = _tmp8_;
		_vala_iterable_unref0 (_tmp7_);
		_symbol_it = _tmp9_;
		while (TRUE) {
			gboolean _tmp10_;
			gpointer _tmp11_ = NULL;
			AfroditeSymbol* symbol;
			gchar* _tmp12_ = NULL;
			_tmp10_ = vala_iterator_next (_symbol_it);
			if (!_tmp10_) {
				break;
			}
			_tmp11_ = vala_iterator_get (_symbol_it);
			symbol = (AfroditeSymbol*) _tmp11_;
			_tmp12_ = afrodite_symbol_get_fully_qualified_name (symbol);
			g_hash_table_insert (symbol_table, symbol, _tmp12_);
		}
		_vala_iterator_unref0 (_symbol_it);
	}
	_tmp13_ = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, _g_free0_);
	file_symbol_table = _tmp13_;
	{
		ValaList* _tmp14_ = NULL;
		ValaList* _tmp15_;
		ValaList* _symbol_list;
		gint _tmp16_;
		gint _symbol_size;
		gint _symbol_index;
		_tmp14_ = afrodite_source_file_get_symbols (source);
		_tmp15_ = _vala_iterable_ref0 (_tmp14_);
		_symbol_list = _tmp15_;
		_tmp16_ = vala_collection_get_size ((ValaCollection*) _symbol_list);
		_symbol_size = _tmp16_;
		_symbol_index = -1;
		while (TRUE) {
			gpointer _tmp17_ = NULL;
			AfroditeSymbol* symbol;
			gchar* _tmp18_ = NULL;
			_symbol_index = _symbol_index + 1;
			if (!(_symbol_index < _symbol_size)) {
				break;
			}
			_tmp17_ = vala_list_get (_symbol_list, _symbol_index);
			symbol = (AfroditeSymbol*) _tmp17_;
			_tmp18_ = afrodite_symbol_get_fully_qualified_name (symbol);
			g_hash_table_insert (file_symbol_table, symbol, _tmp18_);
		}
		_vala_iterable_unref0 (_symbol_list);
	}
	afrodite_tests_completion_manager_remove_source (afrodite_tests_integrity__manager);
	_tmp19_ = afrodite_tests_completion_manager_get_filename (afrodite_tests_integrity__manager);
	_tmp20_ = afrodite_code_dom_lookup_source_file (codedom, _tmp19_);
	_afrodite_source_file_unref0 (source);
	source = _tmp20_;
	g_assert (source == NULL);
	_tmp21_ = g_hash_table_get_keys (file_symbol_table);
	{
		GList* key_collection;
		GList* key_it;
		key_collection = _tmp21_;
		for (key_it = key_collection; key_it != NULL; key_it = key_it->next) {
			void* key;
			key = key_it->data;
			{
				AfroditeSymbol* symbol;
				symbol = (AfroditeSymbol*) key;
				if (G_IS_OBJECT (symbol)) {
					gconstpointer _tmp22_ = NULL;
					_tmp22_ = g_hash_table_lookup (file_symbol_table, key);
					g_error ("tests-integrity.vala:39: symbol leaked: %p %s", key, (const gchar*) _tmp22_);
				} else {
					gconstpointer _tmp23_ = NULL;
					_tmp23_ = g_hash_table_lookup (file_symbol_table, key);
					g_message ("tests-integrity.vala:41: symbol checked: %p %s. destroyed --> OK", key, (const gchar*) _tmp23_);
				}
			}
		}
		_g_list_free0 (key_collection);
	}
	{
		ValaCollection* _tmp24_ = NULL;
		ValaCollection* _tmp25_;
		ValaIterator* _tmp26_ = NULL;
		ValaIterator* _tmp27_;
		ValaIterator* _symbol_it;
		_tmp24_ = vala_map_get_values ((ValaMap*) codedom->symbols);
		_tmp25_ = _tmp24_;
		_tmp26_ = vala_iterable_iterator ((ValaIterable*) _tmp25_);
		_tmp27_ = _tmp26_;
		_vala_iterable_unref0 (_tmp25_);
		_symbol_it = _tmp27_;
		while (TRUE) {
			gboolean _tmp28_;
			gpointer _tmp29_ = NULL;
			AfroditeSymbol* symbol;
			gboolean _tmp31_;
			const gchar* _tmp32_ = NULL;
			AfroditeSourceReference* _tmp33_ = NULL;
			AfroditeSourceReference* _tmp34_;
			AfroditeSourceReference* sr;
			_tmp28_ = vala_iterator_next (_symbol_it);
			if (!_tmp28_) {
				break;
			}
			_tmp29_ = vala_iterator_get (_symbol_it);
			symbol = (AfroditeSymbol*) _tmp29_;
			if (!G_IS_OBJECT (symbol)) {
				gconstpointer _tmp30_ = NULL;
				_tmp30_ = g_hash_table_lookup (symbol_table, symbol);
				g_error ("tests-integrity.vala:50: symbol disposed: %p %s", symbol, (const gchar*) _tmp30_);
			}
			_tmp31_ = afrodite_symbol_get_has_source_references (symbol);
			g_assert_cmpint ((gint) _tmp31_, ==, (gint) TRUE);
			_tmp32_ = afrodite_tests_completion_manager_get_filename (afrodite_tests_integrity__manager);
			_tmp33_ = afrodite_symbol_lookup_source_reference_filename (symbol, _tmp32_);
			_tmp34_ = _afrodite_source_reference_ref0 (_tmp33_);
			sr = _tmp34_;
			g_assert (sr == NULL);
			_afrodite_source_reference_unref0 (sr);
		}
		_vala_iterator_unref0 (_symbol_it);
	}
	_g_hash_table_unref0 (file_symbol_table);
	_g_hash_table_unref0 (symbol_table);
	_afrodite_source_file_unref0 (source);
	_afrodite_code_dom_unref0 (codedom);
}


static void _afrodite_tests_integrity_test_source_remove_gcallback (void) {
	afrodite_tests_integrity_test_source_remove ();
}


gint afrodite_tests_integrity_main (gchar** args, int args_length1) {
	gint result = 0;
	AfroditeTestsCompletionManager* _tmp0_ = NULL;
	gint _tmp1_;
	g_test_init (&args_length1, &args, NULL);
	g_test_add_func ("/afrodite/integrity-test-source-remove", _afrodite_tests_integrity_test_source_remove_gcallback);
	_tmp0_ = afrodite_tests_completion_manager_new ("tests-basic-source.vala", FALSE);
	_afrodite_tests_completion_manager_unref0 (afrodite_tests_integrity__manager);
	afrodite_tests_integrity__manager = _tmp0_;
	afrodite_tests_completion_manager_parse (afrodite_tests_integrity__manager);
	_tmp1_ = g_test_run ();
	result = _tmp1_;
	return result;
}


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


AfroditeTestsIntegrity* afrodite_tests_integrity_construct (GType object_type) {
	AfroditeTestsIntegrity* self = NULL;
	self = (AfroditeTestsIntegrity*) g_type_create_instance (object_type);
	return self;
}


AfroditeTestsIntegrity* afrodite_tests_integrity_new (void) {
	return afrodite_tests_integrity_construct (AFRODITE_TESTS_TYPE_INTEGRITY);
}


static void afrodite_tests_value_integrity_init (GValue* value) {
	value->data[0].v_pointer = NULL;
}


static void afrodite_tests_value_integrity_free_value (GValue* value) {
	if (value->data[0].v_pointer) {
		afrodite_tests_integrity_unref (value->data[0].v_pointer);
	}
}


static void afrodite_tests_value_integrity_copy_value (const GValue* src_value, GValue* dest_value) {
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = afrodite_tests_integrity_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}


static gpointer afrodite_tests_value_integrity_peek_pointer (const GValue* value) {
	return value->data[0].v_pointer;
}


static gchar* afrodite_tests_value_integrity_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		AfroditeTestsIntegrity* object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = afrodite_tests_integrity_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* afrodite_tests_value_integrity_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	AfroditeTestsIntegrity** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = afrodite_tests_integrity_ref (value->data[0].v_pointer);
	}
	return NULL;
}


GParamSpec* afrodite_tests_param_spec_integrity (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	AfroditeTestsParamSpecIntegrity* spec;
	g_return_val_if_fail (g_type_is_a (object_type, AFRODITE_TESTS_TYPE_INTEGRITY), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}


gpointer afrodite_tests_value_get_integrity (const GValue* value) {
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, AFRODITE_TESTS_TYPE_INTEGRITY), NULL);
	return value->data[0].v_pointer;
}


void afrodite_tests_value_set_integrity (GValue* value, gpointer v_object) {
	AfroditeTestsIntegrity* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, AFRODITE_TESTS_TYPE_INTEGRITY));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, AFRODITE_TESTS_TYPE_INTEGRITY));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		afrodite_tests_integrity_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		afrodite_tests_integrity_unref (old);
	}
}


void afrodite_tests_value_take_integrity (GValue* value, gpointer v_object) {
	AfroditeTestsIntegrity* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, AFRODITE_TESTS_TYPE_INTEGRITY));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, AFRODITE_TESTS_TYPE_INTEGRITY));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		afrodite_tests_integrity_unref (old);
	}
}


static void afrodite_tests_integrity_class_init (AfroditeTestsIntegrityClass * klass) {
	afrodite_tests_integrity_parent_class = g_type_class_peek_parent (klass);
	AFRODITE_TESTS_INTEGRITY_CLASS (klass)->finalize = afrodite_tests_integrity_finalize;
}


static void afrodite_tests_integrity_instance_init (AfroditeTestsIntegrity * self) {
	self->ref_count = 1;
}


static void afrodite_tests_integrity_finalize (AfroditeTestsIntegrity* obj) {
	AfroditeTestsIntegrity * self;
	self = AFRODITE_TESTS_INTEGRITY (obj);
}


GType afrodite_tests_integrity_get_type (void) {
	static volatile gsize afrodite_tests_integrity_type_id__volatile = 0;
	if (g_once_init_enter (&afrodite_tests_integrity_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { afrodite_tests_value_integrity_init, afrodite_tests_value_integrity_free_value, afrodite_tests_value_integrity_copy_value, afrodite_tests_value_integrity_peek_pointer, "p", afrodite_tests_value_integrity_collect_value, "p", afrodite_tests_value_integrity_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (AfroditeTestsIntegrityClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) afrodite_tests_integrity_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AfroditeTestsIntegrity), 0, (GInstanceInitFunc) afrodite_tests_integrity_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType afrodite_tests_integrity_type_id;
		afrodite_tests_integrity_type_id = g_type_register_fundamental (g_type_fundamental_next (), "AfroditeTestsIntegrity", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&afrodite_tests_integrity_type_id__volatile, afrodite_tests_integrity_type_id);
	}
	return afrodite_tests_integrity_type_id__volatile;
}


gpointer afrodite_tests_integrity_ref (gpointer instance) {
	AfroditeTestsIntegrity* self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}


void afrodite_tests_integrity_unref (gpointer instance) {
	AfroditeTestsIntegrity* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		AFRODITE_TESTS_INTEGRITY_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}



