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

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

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define TYPE_SETTINGS_STATE_SNAPSHOT (settings_state_snapshot_get_type ())
#define SETTINGS_STATE_SNAPSHOT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SETTINGS_STATE_SNAPSHOT, SettingsStateSnapshot))
#define SETTINGS_STATE_SNAPSHOT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SETTINGS_STATE_SNAPSHOT, SettingsStateSnapshotClass))
#define IS_SETTINGS_STATE_SNAPSHOT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SETTINGS_STATE_SNAPSHOT))
#define IS_SETTINGS_STATE_SNAPSHOT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SETTINGS_STATE_SNAPSHOT))
#define SETTINGS_STATE_SNAPSHOT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SETTINGS_STATE_SNAPSHOT, SettingsStateSnapshotClass))

typedef struct _SettingsStateSnapshot SettingsStateSnapshot;
typedef struct _SettingsStateSnapshotClass SettingsStateSnapshotClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

VALA_EXTERN void test_snapshot_restore (void);
VALA_EXTERN GType settings_state_snapshot_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SettingsStateSnapshot, g_object_unref)
VALA_EXTERN SettingsStateSnapshot* settings_state_snapshot_new (const gchar* layouts_csv,
                                                    const gchar* option);
VALA_EXTERN SettingsStateSnapshot* settings_state_snapshot_construct (GType object_type,
                                                          const gchar* layouts_csv,
                                                          const gchar* option);
VALA_EXTERN void settings_state_snapshot_restore_from (SettingsStateSnapshot* self,
                                           SettingsStateSnapshot* other);
VALA_EXTERN const gchar* settings_state_snapshot_get_layouts_csv (SettingsStateSnapshot* self);
VALA_EXTERN const gchar* settings_state_snapshot_get_option (SettingsStateSnapshot* self);
static gint _vala_main (gchar** args,
                 gint args_length1);
static void _test_snapshot_restore_gtest_func (void);

void
test_snapshot_restore (void)
{
	SettingsStateSnapshot* initial = NULL;
	SettingsStateSnapshot* _tmp0_;
	SettingsStateSnapshot* current = NULL;
	SettingsStateSnapshot* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	_tmp0_ = settings_state_snapshot_new ("us,ru", "grp:alt_shift_toggle");
	initial = _tmp0_;
	_tmp1_ = settings_state_snapshot_new ("de", "grp:ctrl_shift_toggle");
	current = _tmp1_;
	settings_state_snapshot_restore_from (current, initial);
	_tmp2_ = settings_state_snapshot_get_layouts_csv (current);
	_tmp3_ = _tmp2_;
	g_assert_true (g_strcmp0 (_tmp3_, "us,ru") == 0);
	_tmp4_ = settings_state_snapshot_get_option (current);
	_tmp5_ = _tmp4_;
	g_assert_true (g_strcmp0 (_tmp5_, "grp:alt_shift_toggle") == 0);
	_g_object_unref0 (current);
	_g_object_unref0 (initial);
}

static void
_test_snapshot_restore_gtest_func (void)
{
	test_snapshot_restore ();
}

static gint
_vala_main (gchar** args,
            gint args_length1)
{
	gint result;
	g_test_init ((gint*) (&args_length1), &args, NULL);
	g_test_add_func ("/settings/snapshot_restore", _test_snapshot_restore_gtest_func);
	result = g_test_run ();
	return result;
}

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

