2 * Copyright © 2023 Pierre Le Marre <dev@wismill.eu>
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
30 #include "messages-codes.h"
34 test_message_get(void)
36 const struct xkb_message_entry* entry;
38 /* NOTE: 0 must not be a valid message code */
39 entry = xkb_message_get(0);
40 assert(entry == NULL);
41 entry = xkb_message_get(_XKB_LOG_MESSAGE_MIN_CODE - 1);
42 assert(entry == NULL);
43 entry = xkb_message_get(_XKB_LOG_MESSAGE_MAX_CODE + 1);
44 assert(entry == NULL);
47 entry = xkb_message_get(_XKB_LOG_MESSAGE_MIN_CODE);
48 assert(entry != NULL);
49 entry = xkb_message_get(XKB_WARNING_CANNOT_INFER_KEY_TYPE);
50 assert(entry != NULL);
51 entry = xkb_message_get(XKB_ERROR_INVALID_SYNTAX);
52 assert(entry != NULL);
53 entry = xkb_message_get(XKB_WARNING_CONFLICTING_KEY_FIELDS);
54 assert(entry != NULL);
55 entry = xkb_message_get(_XKB_LOG_MESSAGE_MAX_CODE);
56 assert(entry != NULL);