/* decoder.c generated by valac 0.26.0.83-ed603, the Vala compiler
 * generated from decoder.vala, do not modify */


#include <glib.h>
#include <glib-object.h>
#include <libkkc-test.h>
#include <libkkc/libkkc-internals.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <locale.h>


#define TYPE_DECODER_TESTS (decoder_tests_get_type ())
#define DECODER_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DECODER_TESTS, DecoderTests))
#define DECODER_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DECODER_TESTS, DecoderTestsClass))
#define IS_DECODER_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DECODER_TESTS))
#define IS_DECODER_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DECODER_TESTS))
#define DECODER_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DECODER_TESTS, DecoderTestsClass))

typedef struct _DecoderTests DecoderTests;
typedef struct _DecoderTestsClass DecoderTestsClass;
typedef struct _DecoderTestsPrivate DecoderTestsPrivate;
#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_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

struct _DecoderTests {
	KkcTestCase parent_instance;
	DecoderTestsPrivate * priv;
};

struct _DecoderTestsClass {
	KkcTestCaseClass parent_class;
};

struct _DecoderTestsPrivate {
	KkcDecoder* text2_decoder;
	KkcDecoder* text3_decoder;
	KkcDecoder* sorted2_decoder;
	KkcDecoder* sorted3_decoder;
};


static gpointer decoder_tests_parent_class = NULL;

GType decoder_tests_get_type (void) G_GNUC_CONST;
#define DECODER_TESTS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_DECODER_TESTS, DecoderTestsPrivate))
enum  {
	DECODER_TESTS_DUMMY_PROPERTY
};
DecoderTests* decoder_tests_new (void);
DecoderTests* decoder_tests_construct (GType object_type);
static void decoder_tests_test_conversion (DecoderTests* self);
static void _decoder_tests_test_conversion_kkc_test_case_test_method (gpointer self);
static void decoder_tests_test_constraints (DecoderTests* self);
static void _decoder_tests_test_constraints_kkc_test_case_test_method (gpointer self);
static void decoder_tests_real_set_up (KkcTestCase* base);
static void decoder_tests_real_tear_down (KkcTestCase* base);
static void decoder_tests_finalize (GObject* obj);
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 _decoder_tests_test_conversion_kkc_test_case_test_method (gpointer self) {
#line 11 "/home/ueno/devel/libkkc/tests/decoder.vala"
	decoder_tests_test_conversion ((DecoderTests*) self);
#line 71 "decoder.c"
}


static void _decoder_tests_test_constraints_kkc_test_case_test_method (gpointer self) {
#line 12 "/home/ueno/devel/libkkc/tests/decoder.vala"
	decoder_tests_test_constraints ((DecoderTests*) self);
#line 78 "decoder.c"
}


DecoderTests* decoder_tests_construct (GType object_type) {
	DecoderTests * self = NULL;
#line 8 "/home/ueno/devel/libkkc/tests/decoder.vala"
	self = (DecoderTests*) kkc_test_case_construct (object_type, "Decoder");
#line 11 "/home/ueno/devel/libkkc/tests/decoder.vala"
	kkc_test_case_add_test ((KkcTestCase*) self, "conversion", _decoder_tests_test_conversion_kkc_test_case_test_method, self);
#line 12 "/home/ueno/devel/libkkc/tests/decoder.vala"
	kkc_test_case_add_test ((KkcTestCase*) self, "constraints", _decoder_tests_test_constraints_kkc_test_case_test_method, self);
#line 7 "/home/ueno/devel/libkkc/tests/decoder.vala"
	return self;
#line 92 "decoder.c"
}


DecoderTests* decoder_tests_new (void) {
#line 7 "/home/ueno/devel/libkkc/tests/decoder.vala"
	return decoder_tests_construct (TYPE_DECODER_TESTS);
#line 99 "decoder.c"
}


static void decoder_tests_test_conversion (DecoderTests* self) {
	gchar** sentences = NULL;
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	gchar** _tmp5_ = NULL;
	gint sentences_length1 = 0;
	gint _sentences_size_ = 0;
	gchar** _tmp6_ = NULL;
	gint _tmp6__length1 = 0;
#line 15 "/home/ueno/devel/libkkc/tests/decoder.vala"
	g_return_if_fail (self != NULL);
#line 16 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_tmp0_ = g_strdup ("けいざいはきゅうこうか");
#line 16 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_tmp1_ = g_strdup ("しごとのことをかんがえる");
#line 16 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_tmp2_ = g_strdup ("さきにくる");
#line 16 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_tmp3_ = g_strdup ("てつだったが");
#line 16 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_tmp4_ = g_strdup ("わたしのなまえはなかのです");
#line 16 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_tmp5_ = g_new0 (gchar*, 5 + 1);
#line 16 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_tmp5_[0] = _tmp0_;
#line 16 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_tmp5_[1] = _tmp1_;
#line 16 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_tmp5_[2] = _tmp2_;
#line 16 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_tmp5_[3] = _tmp3_;
#line 16 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_tmp5_[4] = _tmp4_;
#line 16 "/home/ueno/devel/libkkc/tests/decoder.vala"
	sentences = _tmp5_;
#line 16 "/home/ueno/devel/libkkc/tests/decoder.vala"
	sentences_length1 = 5;
#line 16 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_sentences_size_ = sentences_length1;
#line 23 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_tmp6_ = sentences;
#line 23 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_tmp6__length1 = sentences_length1;
#line 149 "decoder.c"
	{
		gchar** sentence_collection = NULL;
		gint sentence_collection_length1 = 0;
		gint _sentence_collection_size_ = 0;
		gint sentence_it = 0;
#line 23 "/home/ueno/devel/libkkc/tests/decoder.vala"
		sentence_collection = _tmp6_;
#line 23 "/home/ueno/devel/libkkc/tests/decoder.vala"
		sentence_collection_length1 = _tmp6__length1;
#line 23 "/home/ueno/devel/libkkc/tests/decoder.vala"
		for (sentence_it = 0; sentence_it < _tmp6__length1; sentence_it = sentence_it + 1) {
#line 161 "decoder.c"
			gchar* _tmp7_ = NULL;
			gchar* sentence = NULL;
#line 23 "/home/ueno/devel/libkkc/tests/decoder.vala"
			_tmp7_ = g_strdup (sentence_collection[sentence_it]);
#line 23 "/home/ueno/devel/libkkc/tests/decoder.vala"
			sentence = _tmp7_;
#line 168 "decoder.c"
			{
				KkcDecoder* _tmp8_ = NULL;
				const gchar* _tmp9_ = NULL;
				gint* _tmp10_ = NULL;
				gint* _tmp11_ = NULL;
				gint _tmp11__length1 = 0;
				gint _tmp12_ = 0;
				KkcSegment** _tmp13_ = NULL;
				KkcSegment** _tmp14_ = NULL;
				gint _tmp14__length1 = 0;
				KkcDecoder* _tmp15_ = NULL;
				const gchar* _tmp16_ = NULL;
				gint* _tmp17_ = NULL;
				gint* _tmp18_ = NULL;
				gint _tmp18__length1 = 0;
				gint _tmp19_ = 0;
				KkcSegment** _tmp20_ = NULL;
				KkcSegment** _tmp21_ = NULL;
				gint _tmp21__length1 = 0;
				KkcDecoder* _tmp22_ = NULL;
				const gchar* _tmp23_ = NULL;
				gint* _tmp24_ = NULL;
				gint* _tmp25_ = NULL;
				gint _tmp25__length1 = 0;
				gint _tmp26_ = 0;
				KkcSegment** _tmp27_ = NULL;
				KkcSegment** _tmp28_ = NULL;
				gint _tmp28__length1 = 0;
				KkcDecoder* _tmp29_ = NULL;
				const gchar* _tmp30_ = NULL;
				gint* _tmp31_ = NULL;
				gint* _tmp32_ = NULL;
				gint _tmp32__length1 = 0;
				gint _tmp33_ = 0;
				KkcSegment** _tmp34_ = NULL;
				KkcSegment** _tmp35_ = NULL;
				gint _tmp35__length1 = 0;
#line 24 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp8_ = self->priv->text2_decoder;
#line 24 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp9_ = sentence;
#line 24 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp10_ = g_new0 (gint, 0);
#line 24 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp11_ = _tmp10_;
#line 24 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp11__length1 = 0;
#line 24 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp13_ = kkc_decoder_decode (_tmp8_, _tmp9_, 1, _tmp11_, 0, &_tmp12_);
#line 24 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp14_ = _tmp13_;
#line 24 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp14__length1 = _tmp12_;
#line 24 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp14_ = (_vala_array_free (_tmp14_, _tmp14__length1, (GDestroyNotify) g_object_unref), NULL);
#line 24 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp11_ = (g_free (_tmp11_), NULL);
#line 25 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp15_ = self->priv->text3_decoder;
#line 25 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp16_ = sentence;
#line 25 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp17_ = g_new0 (gint, 0);
#line 25 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp18_ = _tmp17_;
#line 25 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp18__length1 = 0;
#line 25 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp20_ = kkc_decoder_decode (_tmp15_, _tmp16_, 1, _tmp18_, 0, &_tmp19_);
#line 25 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp21_ = _tmp20_;
#line 25 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp21__length1 = _tmp19_;
#line 25 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp21_ = (_vala_array_free (_tmp21_, _tmp21__length1, (GDestroyNotify) g_object_unref), NULL);
#line 25 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp18_ = (g_free (_tmp18_), NULL);
#line 26 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp22_ = self->priv->sorted2_decoder;
#line 26 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp23_ = sentence;
#line 26 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp24_ = g_new0 (gint, 0);
#line 26 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp25_ = _tmp24_;
#line 26 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp25__length1 = 0;
#line 26 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp27_ = kkc_decoder_decode (_tmp22_, _tmp23_, 1, _tmp25_, 0, &_tmp26_);
#line 26 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp28_ = _tmp27_;
#line 26 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp28__length1 = _tmp26_;
#line 26 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp28_ = (_vala_array_free (_tmp28_, _tmp28__length1, (GDestroyNotify) g_object_unref), NULL);
#line 26 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp25_ = (g_free (_tmp25_), NULL);
#line 27 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp29_ = self->priv->sorted3_decoder;
#line 27 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp30_ = sentence;
#line 27 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp31_ = g_new0 (gint, 0);
#line 27 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp32_ = _tmp31_;
#line 27 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp32__length1 = 0;
#line 27 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp34_ = kkc_decoder_decode (_tmp29_, _tmp30_, 1, _tmp32_, 0, &_tmp33_);
#line 27 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp35_ = _tmp34_;
#line 27 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp35__length1 = _tmp33_;
#line 27 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp35_ = (_vala_array_free (_tmp35_, _tmp35__length1, (GDestroyNotify) g_object_unref), NULL);
#line 27 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_tmp32_ = (g_free (_tmp32_), NULL);
#line 23 "/home/ueno/devel/libkkc/tests/decoder.vala"
				_g_free0 (sentence);
#line 288 "decoder.c"
			}
		}
	}
#line 15 "/home/ueno/devel/libkkc/tests/decoder.vala"
	sentences = (_vala_array_free (sentences, sentences_length1, (GDestroyNotify) g_free), NULL);
#line 294 "decoder.c"
}


static void decoder_tests_test_constraints (DecoderTests* self) {
	gint* constraints = NULL;
	gint* _tmp0_ = NULL;
	gint constraints_length1 = 0;
	gint _constraints_size_ = 0;
	KkcSegment** text2_segments = NULL;
	KkcDecoder* _tmp1_ = NULL;
	gint _tmp2_ = 0;
	KkcSegment** _tmp3_ = NULL;
	gint text2_segments_length1 = 0;
	gint _text2_segments_size_ = 0;
	KkcSegment** text3_segments = NULL;
	KkcDecoder* _tmp4_ = NULL;
	gint _tmp5_ = 0;
	KkcSegment** _tmp6_ = NULL;
	gint text3_segments_length1 = 0;
	gint _text3_segments_size_ = 0;
	KkcSegment** sorted2_segments = NULL;
	KkcDecoder* _tmp7_ = NULL;
	gint _tmp8_ = 0;
	KkcSegment** _tmp9_ = NULL;
	gint sorted2_segments_length1 = 0;
	gint _sorted2_segments_size_ = 0;
	KkcSegment** sorted3_segments = NULL;
	KkcDecoder* _tmp10_ = NULL;
	gint _tmp11_ = 0;
	KkcSegment** _tmp12_ = NULL;
	gint sorted3_segments_length1 = 0;
	gint _sorted3_segments_size_ = 0;
#line 31 "/home/ueno/devel/libkkc/tests/decoder.vala"
	g_return_if_fail (self != NULL);
#line 32 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_tmp0_ = g_new0 (gint, 2);
#line 32 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_tmp0_[0] = 4;
#line 32 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_tmp0_[1] = 5;
#line 32 "/home/ueno/devel/libkkc/tests/decoder.vala"
	constraints = _tmp0_;
#line 32 "/home/ueno/devel/libkkc/tests/decoder.vala"
	constraints_length1 = 2;
#line 32 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_constraints_size_ = constraints_length1;
#line 33 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_tmp1_ = self->priv->text2_decoder;
#line 33 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_tmp3_ = kkc_decoder_decode (_tmp1_, "けいざいはきゅうこうか", 1, constraints, constraints_length1, &_tmp2_);
#line 33 "/home/ueno/devel/libkkc/tests/decoder.vala"
	text2_segments = _tmp3_;
#line 33 "/home/ueno/devel/libkkc/tests/decoder.vala"
	text2_segments_length1 = _tmp2_;
#line 33 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_text2_segments_size_ = text2_segments_length1;
#line 34 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_tmp4_ = self->priv->text3_decoder;
#line 34 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_tmp6_ = kkc_decoder_decode (_tmp4_, "けいざいはきゅうこうか", 1, constraints, constraints_length1, &_tmp5_);
#line 34 "/home/ueno/devel/libkkc/tests/decoder.vala"
	text3_segments = _tmp6_;
#line 34 "/home/ueno/devel/libkkc/tests/decoder.vala"
	text3_segments_length1 = _tmp5_;
#line 34 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_text3_segments_size_ = text3_segments_length1;
#line 35 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_tmp7_ = self->priv->sorted2_decoder;
#line 35 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_tmp9_ = kkc_decoder_decode (_tmp7_, "けいざいはきゅうこうか", 1, constraints, constraints_length1, &_tmp8_);
#line 35 "/home/ueno/devel/libkkc/tests/decoder.vala"
	sorted2_segments = _tmp9_;
#line 35 "/home/ueno/devel/libkkc/tests/decoder.vala"
	sorted2_segments_length1 = _tmp8_;
#line 35 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_sorted2_segments_size_ = sorted2_segments_length1;
#line 36 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_tmp10_ = self->priv->sorted3_decoder;
#line 36 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_tmp12_ = kkc_decoder_decode (_tmp10_, "けいざいはきゅうこうか", 1, constraints, constraints_length1, &_tmp11_);
#line 36 "/home/ueno/devel/libkkc/tests/decoder.vala"
	sorted3_segments = _tmp12_;
#line 36 "/home/ueno/devel/libkkc/tests/decoder.vala"
	sorted3_segments_length1 = _tmp11_;
#line 36 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_sorted3_segments_size_ = sorted3_segments_length1;
#line 31 "/home/ueno/devel/libkkc/tests/decoder.vala"
	sorted3_segments = (_vala_array_free (sorted3_segments, sorted3_segments_length1, (GDestroyNotify) g_object_unref), NULL);
#line 31 "/home/ueno/devel/libkkc/tests/decoder.vala"
	sorted2_segments = (_vala_array_free (sorted2_segments, sorted2_segments_length1, (GDestroyNotify) g_object_unref), NULL);
#line 31 "/home/ueno/devel/libkkc/tests/decoder.vala"
	text3_segments = (_vala_array_free (text3_segments, text3_segments_length1, (GDestroyNotify) g_object_unref), NULL);
#line 31 "/home/ueno/devel/libkkc/tests/decoder.vala"
	text2_segments = (_vala_array_free (text2_segments, text2_segments_length1, (GDestroyNotify) g_object_unref), NULL);
#line 31 "/home/ueno/devel/libkkc/tests/decoder.vala"
	constraints = (g_free (constraints), NULL);
#line 391 "decoder.c"
}


static void decoder_tests_real_set_up (KkcTestCase* base) {
	DecoderTests * self;
	GError * _inner_error_ = NULL;
#line 39 "/home/ueno/devel/libkkc/tests/decoder.vala"
	self = (DecoderTests*) base;
#line 400 "decoder.c"
	{
		KkcLanguageModel* model = NULL;
		KkcLanguageModel* _tmp0_ = NULL;
		KkcLanguageModel* _tmp1_ = NULL;
		KkcDecoder* _tmp2_ = NULL;
#line 41 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_tmp0_ = kkc_language_model_load ("text2", &_inner_error_);
#line 41 "/home/ueno/devel/libkkc/tests/decoder.vala"
		model = _tmp0_;
#line 41 "/home/ueno/devel/libkkc/tests/decoder.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 41 "/home/ueno/devel/libkkc/tests/decoder.vala"
			if (_inner_error_->domain == KKC_LANGUAGE_MODEL_ERROR) {
#line 414 "decoder.c"
				goto __catch0_kkc_language_model_error;
			}
			goto __finally0;
		}
#line 42 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_tmp1_ = model;
#line 42 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_tmp2_ = kkc_decoder_create (_tmp1_);
#line 42 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_g_object_unref0 (self->priv->text2_decoder);
#line 42 "/home/ueno/devel/libkkc/tests/decoder.vala"
		self->priv->text2_decoder = _tmp2_;
#line 40 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_g_object_unref0 (model);
#line 429 "decoder.c"
	}
	goto __finally0;
	__catch0_kkc_language_model_error:
	{
		GError* e = NULL;
		FILE* _tmp3_ = NULL;
		GError* _tmp4_ = NULL;
		const gchar* _tmp5_ = NULL;
#line 40 "/home/ueno/devel/libkkc/tests/decoder.vala"
		e = _inner_error_;
#line 40 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_inner_error_ = NULL;
#line 44 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_tmp3_ = stderr;
#line 44 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_tmp4_ = e;
#line 44 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_tmp5_ = _tmp4_->message;
#line 44 "/home/ueno/devel/libkkc/tests/decoder.vala"
		fprintf (_tmp3_, "%s\n", _tmp5_);
#line 40 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_g_error_free0 (e);
#line 452 "decoder.c"
	}
	__finally0:
#line 40 "/home/ueno/devel/libkkc/tests/decoder.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 40 "/home/ueno/devel/libkkc/tests/decoder.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 40 "/home/ueno/devel/libkkc/tests/decoder.vala"
		g_clear_error (&_inner_error_);
#line 40 "/home/ueno/devel/libkkc/tests/decoder.vala"
		return;
#line 463 "decoder.c"
	}
	{
		KkcLanguageModel* model = NULL;
		KkcLanguageModel* _tmp6_ = NULL;
		KkcLanguageModel* _tmp7_ = NULL;
		KkcDecoder* _tmp8_ = NULL;
#line 48 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_tmp6_ = kkc_language_model_load ("text3", &_inner_error_);
#line 48 "/home/ueno/devel/libkkc/tests/decoder.vala"
		model = _tmp6_;
#line 48 "/home/ueno/devel/libkkc/tests/decoder.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 48 "/home/ueno/devel/libkkc/tests/decoder.vala"
			if (_inner_error_->domain == KKC_LANGUAGE_MODEL_ERROR) {
#line 478 "decoder.c"
				goto __catch1_kkc_language_model_error;
			}
			goto __finally1;
		}
#line 49 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_tmp7_ = model;
#line 49 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_tmp8_ = kkc_decoder_create (_tmp7_);
#line 49 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_g_object_unref0 (self->priv->text3_decoder);
#line 49 "/home/ueno/devel/libkkc/tests/decoder.vala"
		self->priv->text3_decoder = _tmp8_;
#line 47 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_g_object_unref0 (model);
#line 493 "decoder.c"
	}
	goto __finally1;
	__catch1_kkc_language_model_error:
	{
		GError* e = NULL;
		FILE* _tmp9_ = NULL;
		GError* _tmp10_ = NULL;
		const gchar* _tmp11_ = NULL;
#line 47 "/home/ueno/devel/libkkc/tests/decoder.vala"
		e = _inner_error_;
#line 47 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_inner_error_ = NULL;
#line 51 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_tmp9_ = stderr;
#line 51 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_tmp10_ = e;
#line 51 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_tmp11_ = _tmp10_->message;
#line 51 "/home/ueno/devel/libkkc/tests/decoder.vala"
		fprintf (_tmp9_, "%s\n", _tmp11_);
#line 47 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_g_error_free0 (e);
#line 516 "decoder.c"
	}
	__finally1:
#line 47 "/home/ueno/devel/libkkc/tests/decoder.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 47 "/home/ueno/devel/libkkc/tests/decoder.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 47 "/home/ueno/devel/libkkc/tests/decoder.vala"
		g_clear_error (&_inner_error_);
#line 47 "/home/ueno/devel/libkkc/tests/decoder.vala"
		return;
#line 527 "decoder.c"
	}
	{
		KkcLanguageModel* model = NULL;
		KkcLanguageModel* _tmp12_ = NULL;
		KkcLanguageModel* _tmp13_ = NULL;
		KkcDecoder* _tmp14_ = NULL;
#line 55 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_tmp12_ = kkc_language_model_load ("sorted2", &_inner_error_);
#line 55 "/home/ueno/devel/libkkc/tests/decoder.vala"
		model = _tmp12_;
#line 55 "/home/ueno/devel/libkkc/tests/decoder.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 55 "/home/ueno/devel/libkkc/tests/decoder.vala"
			if (_inner_error_->domain == KKC_LANGUAGE_MODEL_ERROR) {
#line 542 "decoder.c"
				goto __catch2_kkc_language_model_error;
			}
			goto __finally2;
		}
#line 56 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_tmp13_ = model;
#line 56 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_tmp14_ = kkc_decoder_create (_tmp13_);
#line 56 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_g_object_unref0 (self->priv->sorted2_decoder);
#line 56 "/home/ueno/devel/libkkc/tests/decoder.vala"
		self->priv->sorted2_decoder = _tmp14_;
#line 54 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_g_object_unref0 (model);
#line 557 "decoder.c"
	}
	goto __finally2;
	__catch2_kkc_language_model_error:
	{
		GError* e = NULL;
		FILE* _tmp15_ = NULL;
		GError* _tmp16_ = NULL;
		const gchar* _tmp17_ = NULL;
#line 54 "/home/ueno/devel/libkkc/tests/decoder.vala"
		e = _inner_error_;
#line 54 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_inner_error_ = NULL;
#line 58 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_tmp15_ = stderr;
#line 58 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_tmp16_ = e;
#line 58 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_tmp17_ = _tmp16_->message;
#line 58 "/home/ueno/devel/libkkc/tests/decoder.vala"
		fprintf (_tmp15_, "%s\n", _tmp17_);
#line 54 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_g_error_free0 (e);
#line 580 "decoder.c"
	}
	__finally2:
#line 54 "/home/ueno/devel/libkkc/tests/decoder.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 54 "/home/ueno/devel/libkkc/tests/decoder.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 54 "/home/ueno/devel/libkkc/tests/decoder.vala"
		g_clear_error (&_inner_error_);
#line 54 "/home/ueno/devel/libkkc/tests/decoder.vala"
		return;
#line 591 "decoder.c"
	}
	{
		KkcLanguageModel* model = NULL;
		KkcLanguageModel* _tmp18_ = NULL;
		KkcLanguageModel* _tmp19_ = NULL;
		KkcDecoder* _tmp20_ = NULL;
#line 62 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_tmp18_ = kkc_language_model_load ("sorted3", &_inner_error_);
#line 62 "/home/ueno/devel/libkkc/tests/decoder.vala"
		model = _tmp18_;
#line 62 "/home/ueno/devel/libkkc/tests/decoder.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 62 "/home/ueno/devel/libkkc/tests/decoder.vala"
			if (_inner_error_->domain == KKC_LANGUAGE_MODEL_ERROR) {
#line 606 "decoder.c"
				goto __catch3_kkc_language_model_error;
			}
			goto __finally3;
		}
#line 63 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_tmp19_ = model;
#line 63 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_tmp20_ = kkc_decoder_create (_tmp19_);
#line 63 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_g_object_unref0 (self->priv->sorted3_decoder);
#line 63 "/home/ueno/devel/libkkc/tests/decoder.vala"
		self->priv->sorted3_decoder = _tmp20_;
#line 61 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_g_object_unref0 (model);
#line 621 "decoder.c"
	}
	goto __finally3;
	__catch3_kkc_language_model_error:
	{
		GError* e = NULL;
		FILE* _tmp21_ = NULL;
		GError* _tmp22_ = NULL;
		const gchar* _tmp23_ = NULL;
#line 61 "/home/ueno/devel/libkkc/tests/decoder.vala"
		e = _inner_error_;
#line 61 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_inner_error_ = NULL;
#line 65 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_tmp21_ = stderr;
#line 65 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_tmp22_ = e;
#line 65 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_tmp23_ = _tmp22_->message;
#line 65 "/home/ueno/devel/libkkc/tests/decoder.vala"
		fprintf (_tmp21_, "%s\n", _tmp23_);
#line 61 "/home/ueno/devel/libkkc/tests/decoder.vala"
		_g_error_free0 (e);
#line 644 "decoder.c"
	}
	__finally3:
#line 61 "/home/ueno/devel/libkkc/tests/decoder.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 61 "/home/ueno/devel/libkkc/tests/decoder.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 61 "/home/ueno/devel/libkkc/tests/decoder.vala"
		g_clear_error (&_inner_error_);
#line 61 "/home/ueno/devel/libkkc/tests/decoder.vala"
		return;
#line 655 "decoder.c"
	}
}


static void decoder_tests_real_tear_down (KkcTestCase* base) {
	DecoderTests * self;
#line 69 "/home/ueno/devel/libkkc/tests/decoder.vala"
	self = (DecoderTests*) base;
#line 70 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_g_object_unref0 (self->priv->text2_decoder);
#line 70 "/home/ueno/devel/libkkc/tests/decoder.vala"
	self->priv->text2_decoder = NULL;
#line 71 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_g_object_unref0 (self->priv->text3_decoder);
#line 71 "/home/ueno/devel/libkkc/tests/decoder.vala"
	self->priv->text3_decoder = NULL;
#line 72 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_g_object_unref0 (self->priv->sorted2_decoder);
#line 72 "/home/ueno/devel/libkkc/tests/decoder.vala"
	self->priv->sorted2_decoder = NULL;
#line 73 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_g_object_unref0 (self->priv->sorted3_decoder);
#line 73 "/home/ueno/devel/libkkc/tests/decoder.vala"
	self->priv->sorted3_decoder = NULL;
#line 680 "decoder.c"
}


static void decoder_tests_class_init (DecoderTestsClass * klass) {
#line 1 "/home/ueno/devel/libkkc/tests/decoder.vala"
	decoder_tests_parent_class = g_type_class_peek_parent (klass);
#line 1 "/home/ueno/devel/libkkc/tests/decoder.vala"
	g_type_class_add_private (klass, sizeof (DecoderTestsPrivate));
#line 1 "/home/ueno/devel/libkkc/tests/decoder.vala"
	((KkcTestCaseClass *) klass)->set_up = decoder_tests_real_set_up;
#line 1 "/home/ueno/devel/libkkc/tests/decoder.vala"
	((KkcTestCaseClass *) klass)->tear_down = decoder_tests_real_tear_down;
#line 1 "/home/ueno/devel/libkkc/tests/decoder.vala"
	G_OBJECT_CLASS (klass)->finalize = decoder_tests_finalize;
#line 695 "decoder.c"
}


static void decoder_tests_instance_init (DecoderTests * self) {
#line 1 "/home/ueno/devel/libkkc/tests/decoder.vala"
	self->priv = DECODER_TESTS_GET_PRIVATE (self);
#line 702 "decoder.c"
}


static void decoder_tests_finalize (GObject* obj) {
	DecoderTests * self;
#line 1 "/home/ueno/devel/libkkc/tests/decoder.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_DECODER_TESTS, DecoderTests);
#line 2 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_g_object_unref0 (self->priv->text2_decoder);
#line 3 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_g_object_unref0 (self->priv->text3_decoder);
#line 4 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_g_object_unref0 (self->priv->sorted2_decoder);
#line 5 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_g_object_unref0 (self->priv->sorted3_decoder);
#line 1 "/home/ueno/devel/libkkc/tests/decoder.vala"
	G_OBJECT_CLASS (decoder_tests_parent_class)->finalize (obj);
#line 720 "decoder.c"
}


GType decoder_tests_get_type (void) {
	static volatile gsize decoder_tests_type_id__volatile = 0;
	if (g_once_init_enter (&decoder_tests_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (DecoderTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) decoder_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DecoderTests), 0, (GInstanceInitFunc) decoder_tests_instance_init, NULL };
		GType decoder_tests_type_id;
		decoder_tests_type_id = g_type_register_static (KKC_TYPE_TEST_CASE, "DecoderTests", &g_define_type_info, 0);
		g_once_init_leave (&decoder_tests_type_id__volatile, decoder_tests_type_id);
	}
	return decoder_tests_type_id__volatile;
}


gint _vala_main (gchar** args, int args_length1) {
	gint result = 0;
	GTestSuite* root = NULL;
	GTestSuite* _tmp0_ = NULL;
	DecoderTests* _tmp1_ = NULL;
	DecoderTests* _tmp2_ = NULL;
	GTestSuite* _tmp3_ = NULL;
#line 78 "/home/ueno/devel/libkkc/tests/decoder.vala"
	setlocale (LC_ALL, "");
#line 80 "/home/ueno/devel/libkkc/tests/decoder.vala"
	g_test_init (&args_length1, &args, NULL);
#line 81 "/home/ueno/devel/libkkc/tests/decoder.vala"
	kkc_init ();
#line 83 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_tmp0_ = g_test_get_root ();
#line 83 "/home/ueno/devel/libkkc/tests/decoder.vala"
	root = _tmp0_;
#line 84 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_tmp1_ = decoder_tests_new ();
#line 84 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_tmp2_ = _tmp1_;
#line 84 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_tmp3_ = kkc_test_case_get_suite ((KkcTestCase*) _tmp2_);
#line 84 "/home/ueno/devel/libkkc/tests/decoder.vala"
	g_test_suite_add_suite (root, _tmp3_);
#line 84 "/home/ueno/devel/libkkc/tests/decoder.vala"
	_g_object_unref0 (_tmp2_);
#line 86 "/home/ueno/devel/libkkc/tests/decoder.vala"
	g_test_run ();
#line 88 "/home/ueno/devel/libkkc/tests/decoder.vala"
	result = 0;
#line 88 "/home/ueno/devel/libkkc/tests/decoder.vala"
	return result;
#line 769 "decoder.c"
}


int main (int argc, char ** argv) {
#if !GLIB_CHECK_VERSION (2,35,0)
	g_type_init ();
#endif
#line 77 "/home/ueno/devel/libkkc/tests/decoder.vala"
	return _vala_main (argv, argc);
#line 779 "decoder.c"
}


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



