mirror of
https://github.com/google/pebble
synced 2026-10-18 01:04:12 +02:00
Import of the watch repository from Pebble
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
# Regression test for #453:
|
||||
# Warning for float conversion with default values.
|
||||
|
||||
Import("env")
|
||||
|
||||
env2 = env.Clone()
|
||||
|
||||
if 'gcc' in env['CC']:
|
||||
env2.Append(CFLAGS = '-Wconversion')
|
||||
|
||||
env2.NanopbProto("test.proto")
|
||||
testprog = env2.Program(["test.c"])
|
||||
env2.RunTest(testprog)
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
#include "test.pb.h"
|
||||
#include "unittests.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
int status = 0;
|
||||
MyMessage msg = MyMessage_init_default;
|
||||
TEST(msg.myfield >= 1.23399f);
|
||||
TEST(msg.myfield <= 1.23401f);
|
||||
return status;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
syntax = 'proto2';
|
||||
|
||||
message MyMessage
|
||||
{
|
||||
optional float myfield = 1 [default = 1.234];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user