diff options
Diffstat (limited to 'libmisc/tests/test_private.c')
-rw-r--r-- | libmisc/tests/test_private.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/libmisc/tests/test_private.c b/libmisc/tests/test_private.c new file mode 100644 index 0000000..7aaf1ee --- /dev/null +++ b/libmisc/tests/test_private.c @@ -0,0 +1,29 @@ +/* libmisc/tests/test_private.c - Tests for <libmisc/private.h> + * + * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +#include <libmisc/private.h> + +struct a { + int foo; + BEGIN_PRIVATE(A) + int bar; + END_PRIVATE(A) +}; + +#define IMPLEMENTATION_FOR_B YES + +struct b { + int foo; + BEGIN_PRIVATE(B) + int bar; + END_PRIVATE(B) +}; + +int main() { + struct b obj; + obj.bar = 0; + return obj.bar; +} |