Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test_naming_style_c.c « namingstyle « tests - github.com/nanopb/nanopb.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a3d15fd9f51cff870a82d96b7787ceaa9275ec66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <assert.h>
#include "unittests.h"
#include "naming_style.pb.h"

int main()
{
    main_message_t message = MAIN_MESSAGE_INIT_ZERO;

    message.lucky_number = 13;
    message.my_enum1 = MY_ENUM1_ENUM_THIRD;
    message.my_enum2 = MY_ENUM2_ENUM2_ENTRY;
    message.one_of_name.test_message2.has_test_value = true;
    message.one_of_name.test_message2.test_value = 5;
    message.which_one_of_name = 1;
    message.repeated_fixed32[0] = 1;
    message.test_message5.test_value = 5;

    assert(strcmp("ENTRY_FIRST", my_enum1_name(MY_ENUM1_ENTRY_FIRST)) == 0);

    (void)message.lucky_number;
    return 0;
}