Debian Codegraph @

src/test/test-varlink-idl-login.c

raw
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2
3 #include "logind-inhibit.h"
4 #include "logind-session.h"
5 #include "tests.h"
6 #include "test-varlink-idl-util.h"
7 #include "varlink-io.systemd.Login.h"
8
9 TEST(login_enums_idl) {
10 TEST_IDL_ENUM(SessionType, session_type, vl_type_SessionType);
11 /* SessionClass has SESSION_NONE ("none") as an internal sentinel that is intentionally not exposed
12 * via Varlink. Only validate the IDL→C direction. */
13 TEST_IDL_ENUM_FROM_STRING(SessionClass, session_class, vl_type_SessionClass);
14 TEST_IDL_ENUM(InhibitMode, inhibit_mode, vl_type_InhibitMode);
15 /* InhibitWhat is a bit-flag enum: inhibit_what_to_string() accepts a bitmask and
16 * the index does not correspond to a sequential integer, so the TEST_IDL_ENUM
17 * round-trip macro doesn't apply. The flag→string mapping is exercised through
18 * ListInhibitors integration tests in TEST-35-LOGIN.sh. */
19 }
20
21 DEFINE_TEST_MAIN(LOG_DEBUG);