diff options
author | Harald Musum <musum@verizonmedia.com> | 2020-09-11 12:18:47 +0200 |
---|---|---|
committer | Harald Musum <musum@verizonmedia.com> | 2020-09-11 12:18:47 +0200 |
commit | 379baf8281a30601f83aaa70dfe10f54ae40e5e3 (patch) | |
tree | baca19fb35fd2f11a62e3bda656070eb3885f358 /config/src/test/resources/configdefinitions/function-test.def | |
parent | e2345fd577213a86481f275bc88199c3390c1af0 (diff) |
Move back files used by C++ code
Diffstat (limited to 'config/src/test/resources/configdefinitions/function-test.def')
-rw-r--r-- | config/src/test/resources/configdefinitions/function-test.def | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/config/src/test/resources/configdefinitions/function-test.def b/config/src/test/resources/configdefinitions/function-test.def new file mode 100644 index 00000000000..2e18fb2ee8c --- /dev/null +++ b/config/src/test/resources/configdefinitions/function-test.def @@ -0,0 +1,74 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +# +# This def file should test most aspects of def files that makes a difference +# for the autogenerated config classes. The goal is to trigger all blocks of +# code in the code generators. This includes: +# +# - Use all legal special characters in the def file name, to ensure that those +# that needs to be replaced in type names are actually replaced. +# - Use the same enum type twice to verify that we dont declare or define it +# twice. +# - Use the same struct type twice for the same reason. +# - Include arrays of primitives and structs. +# - Include enum primitives and array of enums. Arrays of enums must be handled +# specially by the C++ code. +# - Include enums both with and without default values. +# - Include primitive string, numbers & doubles both with and without default +# values. +# - Have an array within a struct, to verify that we correctly recurse. +# - Reuse type name further within to ensure that this works. + +namespace=config + +# Some random bool without a default value. These comments exist to check + # that comment parsing works. +bool_val bool + ## A bool with a default value set. +bool_with_def bool default=false +int_val int +int_with_def int default=-545 +long_val long +long_with_def long default=-50000000000 +double_val double +double_with_def double default=-6.43 +# Another comment +string_val string +stringwithdef string default="foobar" +enum_val enum { FOO, BAR, FOOBAR } +enumwithdef enum { FOO2, BAR2, FOOBAR2 } default=BAR2 +onechoice enum { ONLYFOO } default=ONLYFOO +refval reference +refwithdef reference default=":parent:" +fileVal file + +boolarr[] bool +intarr[] int +longarr[] long +doublearr[] double +stringarr[] string +enumarr[] enum { ARRAY, VALUES } +refarr[] reference +fileArr[] file + +# A basic struct +basicStruct.foo string default="basic" +basicStruct.bar int +basicStruct.intArr[] int + +# A struct of struct +rootStruct.inner0.name string default="inner0" +rootStruct.inner0.index int +rootStruct.inner1.name string default="inner1" +rootStruct.inner1.index int +rootStruct.inner2.array[] int +rootStruct.innerArr[].boolVal bool default=false +rootStruct.innerArr[].stringVal string + +myarray[].intval int default=14 +myarray[].stringval[] string +myarray[].enumval enum { INNER, ENUM, TYPE } default=TYPE +myarray[].refval reference # Value in array without default +myarray[].fileVal file +myarray[].anotherarray[].foo int default=-4 +myarray[].myStruct.a int +myarray[].myStruct.b int default=2 |