aboutsummaryrefslogtreecommitdiffstats
path: root/config-lib/src/test/resources/configdefinitions/test.function-test.def
blob: cdd4bf012d2b75611debdf81168703939370c138 (plain) (blame)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Copyright Yahoo. 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=test

# Some random bool without a default value. These comments exist to check
 # that comment parsing works.
bool_val bool restart
 ## A bool with a default value set.
bool_with_def bool default=false restart
# An int value
# Also test that multiline comments
# work.
int_val int restart
int_with_def int default=-545 restart
long_val long restart
long_with_def long default=-50000000000 restart
double_val double restart
double_with_def double default=-6.43 restart
# Another comment
string_val string restart
stringwithdef string default="foobar" restart
enum_val enum { FOO, BAR, FOOBAR } restart
enumwithdef enum { FOO2, BAR2, FOOBAR2 } default=BAR2 restart
onechoice enum { ONLYFOO } default=ONLYFOO restart
refval reference restart
refwithdef reference default=":parent:" restart
fileVal file restart
pathVal path restart
urlVal url
modelVal model

boolarr[] bool restart
intarr[] int restart
longarr[] long restart
doublearr[] double restart
stringarr[] string restart
enumarr[] enum { ARRAY, VALUES } restart
refarr[] reference restart
fileArr[] file restart
pathArr[] path restart
urlArr[] url
modelArr[] model

#This is a map of ints.
intMap{} int restart
stringMap{} string restart
filemap{} file restart
pathMap{} path restart
urlMap{} url
modelMap{} model

# A basic struct
basicStruct.foo string default="basic" restart
basicStruct.bar int restart
basicStruct.intArr[] int restart

# A struct of struct
rootStruct.inner0.name string default="inner0" restart
rootStruct.inner0.index int restart
rootStruct.inner1.name string default="inner1" restart
rootStruct.inner1.index int restart
rootStruct.innerArr[].boolVal bool default=false restart
rootStruct.innerArr[].stringVal string restart

# This is my array
myarray[].intval int default=14 restart
myarray[].stringval[] string restart
myarray[].enumval enum { INNER, ENUM, TYPE } default=TYPE restart
myarray[].refval reference # Value in array without default restart
myarray[].fileVal file restart
myarray[].urlVal url
myarray[].anotherarray[].foo int default=-4 restart
myarray[].myStruct.a int restart
myarray[].myStruct.b int default=2 restart

myStructMap{}.myInt int restart
myStructMap{}.myString string restart
myStructMap{}.myIntDef int default=56 restart
myStructMap{}.myStringDef string default="g" restart
myStructMap{}.anotherMap{}.anInt int restart
myStructMap{}.anotherMap{}.anIntDef int default=11 restart