mirror of
https://github.com/google/pebble.git
synced 2025-11-24 16:22:25 -05:00
Import of the watch repository from Pebble
This commit is contained in:
28
third_party/nanopb/tests/options/options.c
vendored
Normal file
28
third_party/nanopb/tests/options/options.c
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "options.pb.h"
|
||||
#include "unittests.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
int status = 0;
|
||||
|
||||
{
|
||||
HasFieldMessage msg1 = HasFieldMessage_init_default;
|
||||
HasFieldMessage msg2 = HasFieldMessage_init_zero;
|
||||
|
||||
COMMENT("Test default_has option");
|
||||
|
||||
/* Default initializer should obey has_default setting */
|
||||
TEST(msg1.has_present == true);
|
||||
TEST(msg1.has_missing == false);
|
||||
TEST(msg1.has_normal == false);
|
||||
|
||||
/* Zero initializer should always have false */
|
||||
TEST(msg2.has_present == false);
|
||||
TEST(msg2.has_missing == false);
|
||||
TEST(msg2.has_normal == false);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
Reference in New Issue
Block a user