summaryrefslogtreecommitdiff
path: root/src/login/test-login-shared.c
blob: 08153b0b35b9132f644aed0815bf5d8e501fe0d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* SPDX-License-Identifier: LGPL-2.1+ */
/***
  Copyright © 2013 Zbigniew Jędrzejewski-Szmek
***/

#include "login-util.h"
#include "macro.h"

static void test_session_id_valid(void) {
        assert_se(session_id_valid("c1"));
        assert_se(session_id_valid("1234"));

        assert_se(!session_id_valid("1-2"));
        assert_se(!session_id_valid(""));
        assert_se(!session_id_valid("\tid"));
}

int main(int argc, char* argv[]) {
        log_parse_environment();
        log_open();

        test_session_id_valid();

        return 0;
}