summaryrefslogtreecommitdiff
path: root/src/login/test-login-shared.c
blob: 02ff57ab10f29dc6d4683430966b3aa2def0e5bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* SPDX-License-Identifier: LGPL-2.1+ */

#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;
}