Use upstream tag
[platform/upstream/libsecret.git] / libsecret / test-vala-unstable.vala
1 /*
2  * Copyright 2012 Red Hat Inc.
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published
6  * by the Free Software Foundation; either version 2.1 of the licence or (at
7  * your option) any later version.
8  *
9  * See the included COPYING file for more information.
10  */
11
12 private void test_read_alias () {
13         try {
14                 var service = Secret.Service.get_sync(Secret.ServiceFlags.NONE);
15                 var path = service.read_alias_dbus_path_sync("default", null);
16                 GLib.assert (path != null);
17         } catch ( GLib.Error e ) {
18                 GLib.error (e.message);
19         }
20 }
21
22 private static int main (string[] args) {
23         GLib.Test.init (ref args);
24
25         try {
26                 MockService.start ("mock-service-normal.py");
27         } catch ( GLib.Error e ) {
28                 GLib.error ("Unable to start mock service: %s", e.message);
29         }
30
31         GLib.Test.add_data_func ("/vala/unstable/read-alias", test_read_alias);
32
33         var res = GLib.Test.run ();
34         Secret.Service.disconnect ();
35         MockService.stop ();
36         return res;
37 }