/* monitor-test.c generated by valac 0.48.11, the Vala compiler
 * generated from monitor-test.vala, do not modify */

/* monitor-test.vala
 *
 * Copyright © 2012 Christian Dywan <christian@twotoasts.de>
 *
 * This program 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 program 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 General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "zeitgeist-datamodel.h"
#include "zeitgeist.h"

#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_ptr_array_unref0(var) ((var == NULL) ? NULL : (var = (g_ptr_array_unref (var), NULL)))
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

gint _vala_main (gchar** argv,
                 gint argv_length1);
void monitor_create_test (void);
static void _monitor_create_test_gtest_func (void);
static void _g_object_unref0_ (gpointer var);

static void
_monitor_create_test_gtest_func (void)
{
#line 27 "monitor-test.vala"
	monitor_create_test ();
#line 48 "monitor-test.c"
}

gint
_vala_main (gchar** argv,
            gint argv_length1)
{
	gint result = 0;
#line 25 "monitor-test.vala"
	g_test_init ((gint*) (&argv_length1), &argv, NULL);
#line 27 "monitor-test.vala"
	g_test_add_func ("/Monitor/Create", _monitor_create_test_gtest_func);
#line 29 "monitor-test.vala"
	result = g_test_run ();
#line 29 "monitor-test.vala"
	return result;
#line 64 "monitor-test.c"
}

int
main (int argc,
      char ** argv)
{
#line 23 "monitor-test.vala"
	return _vala_main (argv, argc);
#line 73 "monitor-test.c"
}

static void
_g_object_unref0_ (gpointer var)
{
#line 34 "monitor-test.vala"
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
#line 81 "monitor-test.c"
}

static gpointer
_g_ptr_array_ref0 (gpointer self)
{
#line 35 "monitor-test.vala"
	return self ? g_ptr_array_ref (self) : NULL;
#line 89 "monitor-test.c"
}

void
monitor_create_test (void)
{
	GPtrArray* event_templates = NULL;
	GPtrArray* _tmp0_;
	ZeitgeistMonitor* mon = NULL;
	ZeitgeistTimeRange* _tmp1_;
	ZeitgeistTimeRange* _tmp2_;
	GPtrArray* _tmp3_;
	ZeitgeistMonitor* _tmp4_;
	ZeitgeistMonitor* _tmp5_;
	ZeitgeistTimeRange* _tmp6_;
	ZeitgeistTimeRange* _tmp7_;
	gint64 _tmp8_;
	gint64 _tmp9_;
	ZeitgeistTimeRange* _tmp10_;
	ZeitgeistTimeRange* _tmp11_;
	gint64 _tmp12_;
	gint64 _tmp13_;
	GPtrArray* _tmp14_;
	GPtrArray* _tmp15_;
#line 34 "monitor-test.vala"
	_tmp0_ = g_ptr_array_new_full ((guint) 0, _g_object_unref0_);
#line 34 "monitor-test.vala"
	event_templates = _tmp0_;
#line 35 "monitor-test.vala"
	_tmp1_ = zeitgeist_time_range_new ((gint64) 27, (gint64) 68);
#line 35 "monitor-test.vala"
	_tmp2_ = _tmp1_;
#line 35 "monitor-test.vala"
	_tmp3_ = _g_ptr_array_ref0 (event_templates);
#line 35 "monitor-test.vala"
	_tmp4_ = zeitgeist_monitor_new (_tmp2_, _tmp3_);
#line 35 "monitor-test.vala"
	_tmp5_ = _tmp4_;
#line 35 "monitor-test.vala"
	_g_object_unref0 (_tmp2_);
#line 35 "monitor-test.vala"
	mon = _tmp5_;
#line 36 "monitor-test.vala"
	_tmp6_ = zeitgeist_monitor_get_time_range (mon);
#line 36 "monitor-test.vala"
	_tmp7_ = _tmp6_;
#line 36 "monitor-test.vala"
	_tmp8_ = zeitgeist_time_range_get_start (_tmp7_);
#line 36 "monitor-test.vala"
	_tmp9_ = _tmp8_;
#line 36 "monitor-test.vala"
	_vala_assert (((gint64) 27) == _tmp9_, "27 == mon.time_range.start");
#line 37 "monitor-test.vala"
	_tmp10_ = zeitgeist_monitor_get_time_range (mon);
#line 37 "monitor-test.vala"
	_tmp11_ = _tmp10_;
#line 37 "monitor-test.vala"
	_tmp12_ = zeitgeist_time_range_get_end (_tmp11_);
#line 37 "monitor-test.vala"
	_tmp13_ = _tmp12_;
#line 37 "monitor-test.vala"
	_vala_assert (((gint64) 68) == _tmp13_, "68 == mon.time_range.end");
#line 39 "monitor-test.vala"
	_tmp14_ = zeitgeist_monitor_get_templates (mon);
#line 39 "monitor-test.vala"
	_tmp15_ = _tmp14_;
#line 39 "monitor-test.vala"
	_vala_assert (event_templates == _tmp15_, "event_templates == mon.get_templates()");
#line 39 "monitor-test.vala"
	_g_ptr_array_unref0 (_tmp15_);
#line 32 "monitor-test.vala"
	_g_object_unref0 (mon);
#line 32 "monitor-test.vala"
	_g_ptr_array_unref0 (event_templates);
#line 163 "monitor-test.c"
}

