comparison Resources/CodeGeneration/testWasmIntegrated/testWasmIntegrated.ts @ 687:342f3e04bfa9 am-dev

CodeGen: test cleanup + all working again + using same yaml and stimuli files
author Alain Mazy <alain@mazy.be>
date Thu, 16 May 2019 17:51:17 +0200
parents 17106b29ed6d
children f185cfcb72a0
comparison
equal deleted inserted replaced
686:0d42bda615a8 687:342f3e04bfa9
46 /* 46 /*
47 +--------------------------------------------------+ 47 +--------------------------------------------------+
48 | define stock messages | 48 | define stock messages |
49 +--------------------------------------------------+ 49 +--------------------------------------------------+
50 */ 50 */
51 let schemaText: string = `rootName: testWasmIntegratedCpp 51 let schemaText: string = null;
52 52 fetch("testTestStoneCodeGen.yaml").then(function(res) {return res.text();}).then(function(text) {schemaText = text;});
53 struct B:
54 someAs: vector<A>
55 someInts: vector<int32>
56
57 struct C:
58 someBs: vector<B>
59 ddd: vector<string>
60 definition: vector<json>
61
62 struct A:
63 someStrings: vector<string>
64 someInts2: vector<int32>
65 movies: vector<MovieType>
66
67 struct Message1:
68 a: int32
69 b: string
70 c: EnumMonth0
71 d: bool
72
73 struct Message2:
74 toto: string
75 tata: vector<Message1>
76 tutu: vector<string>
77 titi: map<string, string>
78 lulu: map<string, Message1>
79 movieType: MovieType
80 definition: json
81
82 enum MovieType:
83 - RomCom
84 - Horror
85 - ScienceFiction
86 - Vegetables
87
88 enum CrispType:
89 - SaltAndPepper
90 - CreamAndChives
91 - Paprika
92 - Barbecue
93
94 enum EnumMonth0:
95 - January
96 - February
97 - March
98 `;
99 53
100 let stockSerializedMessages = new Map<string,string>(); 54 let stockSerializedMessages = new Map<string,string>();
101 stockSerializedMessages["Test 1"] = `{ 55 stockSerializedMessages["Test CppHandler message2"] = null;
102 "type" : "testWasmIntegratedCpp.Message2", 56 fetch("cppHandler_test_Message2.json").then(function(res) {return res.text();}).then(function(text) {stockSerializedMessages["Test CppHandler message2"] = text;});
103 "value" : 57
104 {
105 "lulu" :
106 {
107 "54" :
108 {
109 "a" : 43,
110 "b" : "Sandrine",
111 "c" : "March",
112 "d" : true
113 },
114 "55" :
115 {
116 "a" : 42,
117 "b" : "Benjamin",
118 "c" : "January",
119 "d" : false
120 }
121 },
122 "tata" :
123 [
124 {
125 "a" : 42,
126 "b" : "Benjamin",
127 "c" : "March",
128 "d" : false
129 },
130 {
131 "a" : 43,
132 "b" : "Sandrine",
133 "c" : "January",
134 "d" : false
135 }
136 ],
137 "titi" :
138 {
139 "44" : "key 44",
140 "45" : "key 45"
141 },
142 "toto" : "Prout zizi",
143 "tutu" :
144 [
145 "Mercadet",
146 "Poisson"
147 ],
148 "definition":
149 {
150 "val" : [ "berk", 42 ],
151 "zozo" :
152 {
153 "23": "zloutch",
154 "lalala": 42
155 }
156 }
157 }
158 }`;
159 stockSerializedMessages["Test 2"] = ` { 58 stockSerializedMessages["Test 2"] = ` {
160 "type" : "testWasmIntegratedCpp.Message1", 59 "type" : "TestStoneCodeGen.Message1",
161 "value" : { 60 "value" : {
162 "a" : -987, 61 "memberInt32" : -987,
163 "b" : "Salomé", 62 "memberString" : "Salomé",
164 "c" : 2, 63 "memberEnumMonth" : "March",
165 "d" : true 64 "memberBool" : true,
65 "memberFloat32" : 0.1,
66 "memberFloat64" : -0.2,
67 "extraMember" : "don't care"
166 } 68 }
167 }`; 69 }`;
168 stockSerializedMessages["Test 3"] = "Test 3 stock message sdfsfsdfsdf"; 70 stockSerializedMessages["Test 3"] = "Test 3 stock message sdfsfsdfsdf";
169 stockSerializedMessages["Test 4"] = "Test 4 stock message 355345345"; 71 stockSerializedMessages["Test 4"] = "Test 4 stock message 355345345";
170 stockSerializedMessages["Test 5"] = "Test 5 stock message 34535"; 72 stockSerializedMessages["Test 5"] = "Test 5 stock message 34535";