test-vala-unstable.vala 1014 Bytes
Newer Older
Stef Walter's avatar
Stef Walter committed
1 2 3 4 5 6 7 8 9 10 11
/*
 * Copyright 2012 Red Hat Inc.
 *
 * 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 licence or (at
 * your option) any later version.
 *
 * See the included COPYING file for more information.
 */

12 13 14
private void test_read_alias () {
	try {
		var service = Secret.Service.get_sync(Secret.ServiceFlags.NONE);
Stef Walter's avatar
Stef Walter committed
15
		var path = service.read_alias_dbus_path_sync("default", null);
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
		GLib.assert (path != null);
	} catch ( GLib.Error e ) {
		GLib.error (e.message);
	}
}

private static int main (string[] args) {
	GLib.Test.init (ref args);

	try {
		MockService.start ("mock-service-normal.py");
	} catch ( GLib.Error e ) {
		GLib.error ("Unable to start mock service: %s", e.message);
	}

	GLib.Test.add_data_func ("/vala/unstable/read-alias", test_read_alias);

	var res = GLib.Test.run ();
Stef Walter's avatar
Stef Walter committed
34
	Secret.Service.disconnect ();
35 36 37
	MockService.stop ();
	return res;
}