aboutsummaryrefslogtreecommitdiff
path: root/tests/typename_mangling/test_flatten.c
blob: dbc126e8814aa25e0af4e63223e7acfd2846e7d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
 * Tests if expected names are generated when M_FLATTEN is used.
 */

#include <stdio.h>
#include "unittests.h"
#include "flatten.pb.h"

int main()
{
    TopLevelMessage msg = {0};
    NestedMessage nmsg = msg.nested;
    NestedLevel2 nmsg2 = nmsg.nested;
    NestedLevel3 nmsg3 = nmsg2.nested;
    nmsg3.nothing = 42;

    msg.short_if_none = ShortIfNone_IfNone_A;
    msg.short_if_strip_package = ShortIfStripPackage_IfPackage_A;
    msg.short_if_flatten = IfFlatten_A;

    return nmsg3.nothing; /* this sets `nmsg3` as used, to prevent warning */
}