/* testasyncworker.c generated by valac 0.16.1, the Vala compiler
 * generated from testasyncworker.vala, do not modify */


#include <glib.h>
#include <glib-object.h>
#include <fsobasics.h>
#include <stdlib.h>
#include <string.h>

#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))


extern gint called;
gint called = 0;

void queueHandler (gint value);
void test_asyncworker_create (void);
void test_asyncworker_enqueue (void);
void _vala_main (gchar** args, int args_length1);
static void _test_asyncworker_create_gcallback (void);
static void _test_asyncworker_enqueue_gcallback (void);


void queueHandler (gint value) {
	gint _tmp0_;
	gint _tmp1_;
	_tmp0_ = value;
	g_message ("testasyncworker.vala:27: queueHandler got '%d'", _tmp0_);
	_tmp1_ = called;
	called = _tmp1_ + 1;
}


void test_asyncworker_create (void) {
	FsoFrameworkAsyncWorkerQueue* _tmp0_;
	FsoFrameworkAsyncWorkerQueue* q;
	_tmp0_ = fso_framework_async_worker_queue_new (G_TYPE_INT, NULL, NULL);
	q = _tmp0_;
	g_assert (q != NULL);
	_g_object_unref0 (q);
}


void test_asyncworker_enqueue (void) {
	FsoFrameworkAsyncWorkerQueue* _tmp0_;
	FsoFrameworkAsyncWorkerQueue* q;
	_tmp0_ = fso_framework_async_worker_queue_new (G_TYPE_INT, NULL, NULL);
	q = _tmp0_;
	{
		gint i;
		i = 0;
		{
			gboolean _tmp1_;
			_tmp1_ = TRUE;
			while (TRUE) {
				gboolean _tmp2_;
				gint _tmp4_;
				FsoFrameworkAsyncWorkerQueue* _tmp5_;
				gint _tmp6_;
				_tmp2_ = _tmp1_;
				if (!_tmp2_) {
					gint _tmp3_;
					_tmp3_ = i;
					i = _tmp3_ + 1;
				}
				_tmp1_ = FALSE;
				_tmp4_ = i;
				if (!(_tmp4_ < 100)) {
					break;
				}
				_tmp5_ = q;
				_tmp6_ = i;
				fso_framework_abstract_worker_queue_enqueue ((FsoFrameworkAbstractWorkerQueue*) _tmp5_, GINT_TO_POINTER (_tmp6_));
			}
		}
	}
	_g_object_unref0 (q);
}


static void _test_asyncworker_create_gcallback (void) {
	test_asyncworker_create ();
}


static void _test_asyncworker_enqueue_gcallback (void) {
	test_asyncworker_enqueue ();
}


void _vala_main (gchar** args, int args_length1) {
	g_test_init (&args_length1, &args, NULL);
	g_test_add_func ("/AsyncWorker/AsyncWorkerQueue/Create", _test_asyncworker_create_gcallback);
	g_test_add_func ("/AsyncWorker/AsyncWorkerQueue/Enqueue", _test_asyncworker_enqueue_gcallback);
	g_test_run ();
}


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



