add nanopb (manual)

This commit is contained in:
Philippe G
2022-01-04 11:01:14 -08:00
parent 06b637c55b
commit 39f5a81238
554 changed files with 36793 additions and 3831 deletions

View File

@@ -0,0 +1,8 @@
# Test that different sizes of enum fields are properly encoded and decoded.
Import('env')
env.NanopbProto('enumminmax')
p = env.Program(["enumminmax_unittests.c",])
env.RunTest(p)

View File

@@ -0,0 +1,22 @@
/* Test out-of-order enum values.
*/
syntax = "proto3";
enum Language {
UNKNOWN = 0;
ENGLISH_EN_GB = 12;
ENGLISH_EN_US = 1;
FRENCH_FR_FR = 2;
ITALIAN_IT_IT = 3;
GERMAN_DE_DE = 4;
SPANISH_ES_AR = 13;
SPANISH_ES_ES = 5;
SPANISH_ES_MX = 14;
SWEDISH_SV_SE = 6;
DUTCH_NL_NL = 7;
KOREAN_KO_KR = 8;
JAPANESE_JA_JP = 9;
CHINESE_SIMPLIFIED_ZH_CN = 10;
CHINESE_TRADITIONAL_ZH_TW = 11;
}

View File

@@ -0,0 +1,16 @@
#include "unittests.h"
#include "enumminmax.pb.h"
int main()
{
int status = 0;
COMMENT("Verify min/max on unsorted enum");
{
TEST(_Language_MIN == Language_UNKNOWN);
TEST(_Language_MAX == Language_SPANISH_ES_MX);
TEST(_Language_ARRAYSIZE == (Language_SPANISH_ES_MX+1));
}
return status;
}