fixup! atom: add a mock for struct atom

This commit is contained in:
Yuxuan Shui 2024-02-17 02:21:50 +00:00
parent f34949d041
commit aa99bd34b7
2 changed files with 4 additions and 4 deletions

View File

@ -157,12 +157,12 @@ mock_atom_name_getter(xcb_atom_t atom attr_unused, xcb_connection_t *c attr_unus
abort();
}
struct atom *init_mock_atoms(xcb_connection_t *c) {
struct atom *init_mock_atoms(void) {
auto atoms = ccalloc(1, struct atom_impl);
atoms->c = CACHE_INIT;
atoms->getter = mock_atom_getter;
atoms->name_getter = mock_atom_name_getter;
#define ATOM_GET(x) atoms->base.a##x = get_atom(&atoms->base, #x, c)
#define ATOM_GET(x) atoms->base.a##x = get_atom(&atoms->base, #x, NULL)
LIST_APPLY(ATOM_GET, SEP_COLON, ATOM_LIST1);
LIST_APPLY(ATOM_GET, SEP_COLON, ATOM_LIST2);
#undef ATOM_GET
@ -171,7 +171,7 @@ struct atom *init_mock_atoms(xcb_connection_t *c) {
#else
struct atom *init_mock_atoms(xcb_connection_t *c) {
struct atom *init_mock_atoms(void) {
abort();
}

View File

@ -72,4 +72,4 @@ void destroy_atoms(struct atom *a);
/// secutive integers as atoms, starting from 1. Calling get_atom_name with atoms
/// previously seen will result in the string that was used to create the atom; if
/// the atom was never returned by get_atom, it will abort.
struct atom *init_mock_atoms(xcb_connection_t *c);
struct atom *init_mock_atoms(void);