summaryrefslogtreecommitdiff
path: root/src/login/test-login.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-02-14 21:54:00 +0100
committerLennart Poettering <lennart@poettering.net>2012-02-14 21:54:00 +0100
commit51f58f083a9454599080dc01d7740cf097f48920 (patch)
tree69cc8b34ee3e74280e7e90bc773d2a48c2b056a2 /src/login/test-login.c
parent55efac6cbcea0d8edda9c6820620ceb390009e7a (diff)
login: add new sd_session_get_type() and sd_session_get_class API calls
Diffstat (limited to 'src/login/test-login.c')
-rw-r--r--src/login/test-login.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/login/test-login.c b/src/login/test-login.c
index 4596721060..2aaa31f22f 100644
--- a/src/login/test-login.c
+++ b/src/login/test-login.c
@@ -30,7 +30,7 @@
int main(int argc, char* argv[]) {
int r, k;
uid_t u, u2;
- char *seat;
+ char *seat, *type, *class;
char *session;
char *state;
char *session2;
@@ -75,6 +75,14 @@ int main(int argc, char* argv[]) {
printf("uid = %lu\n", (unsigned long) u);
assert_se(u == u2);
+ assert_se(sd_session_get_type(session, &type) >= 0);
+ printf("type = %s\n", type);
+ free(type);
+
+ assert_se(sd_session_get_class(session, &class) >= 0);
+ printf("class = %s\n", class);
+ free(class);
+
assert_se(sd_session_get_seat(session, &seat) >= 0);
printf("seat = %s\n", seat);
@@ -125,13 +133,13 @@ int main(int argc, char* argv[]) {
printf("seats = %s\n", t);
free(t);
+ assert_se(sd_get_seats(NULL) == r);
+
r = sd_seat_get_active(NULL, &t, NULL);
assert_se(r >= 0);
printf("active session on current seat = %s\n", t);
free(t);
- assert_se(sd_get_seats(NULL) == r);
-
r = sd_get_sessions(&sessions);
assert_se(r >= 0);
assert_se(r == (int) strv_length(sessions));