@@ -74,9 +74,15 @@ class NaClBitcodeMunger {
74
74
75
75
// / Creates MungedInput and DumpStream for running tests, based on
76
76
// / given Munges. Returns true if able to set up test.
77
- bool setupTest (
78
- const char *TestName, const uint64_t Munges[], size_t MungesSize,
79
- bool AddHeader);
77
+ bool setupTest (const uint64_t Munges[], size_t MungesSize, bool AddHeader);
78
+
79
+ // TODO(kschimpf): The following function is deprecated and only
80
+ // provided until subzero is updated to use the new API that no
81
+ // longer uses test names.
82
+ bool setupTest (const char *, const uint64_t Munges[], size_t MungesSize,
83
+ bool AddHeader) {
84
+ return setupTest (Munges, MungesSize, AddHeader);
85
+ }
80
86
81
87
// / Cleans up state after a test. Returns true if no errors found.
82
88
bool cleanupTest ();
@@ -170,23 +176,12 @@ class NaClWriteMunger : public NaClBitcodeMunger {
170
176
171
177
// / Writes munged bitcode and puts error messages into DumpResults.
172
178
// / Returns true if successful.
173
- bool runTest (const char * TestName, const uint64_t Munges[],
174
- size_t MungesSize);
175
-
176
- // / Same as above, but without test name.
177
- bool runTest (const uint64_t Munges[], size_t MungesSize) {
178
- return runTest (" Test" , Munges, MungesSize);
179
- }
179
+ bool runTest (const uint64_t Munges[], size_t MungesSize);
180
180
181
181
// / Same as above, but without any edits.
182
- bool runTest (const char * TestName) {
183
- uint64_t NoMunges[] = {0 };
184
- return runTest (TestName, NoMunges, 0 );
185
- }
186
-
187
- // / Same as above, but without test name.
188
182
bool runTest () {
189
- return runTest (" Test" );
183
+ uint64_t NoMunges[] = {0 };
184
+ return runTest (NoMunges, 0 );
190
185
}
191
186
};
192
187
@@ -202,38 +197,36 @@ class NaClObjDumpMunger : public NaClBitcodeMunger {
202
197
// / Runs function NaClObjDump on the sequence of records associated
203
198
// / with the instance. The memory buffer containing the bitsequence
204
199
// / associated with the record is automatically generated, and
205
- // / passed to NaClObjDump. TestName is the name associated with the
206
- // / memory buffer. If AddHeader is true, test assumes that the
200
+ // / passed to NaClObjDump. If AddHeader is true, test assumes that the
207
201
// / sequence of records doesn't contain a header record, and the
208
202
// / test should add one. Arguments NoRecords and NoAssembly are
209
203
// / passed to NaClObjDump. Returns true if test succeeds without
210
204
// / errors.
211
- bool runTestWithFlags (const char *TestName, bool AddHeader,
212
- bool NoRecords, bool NoAssembly) {
205
+ bool runTestWithFlags (bool AddHeader, bool NoRecords, bool NoAssembly) {
213
206
uint64_t NoMunges[] = {0 };
214
- return runTestWithFlags (TestName, NoMunges, 0 , AddHeader, NoRecords,
215
- NoAssembly);
207
+ return runTestWithFlags (NoMunges, 0 , AddHeader, NoRecords, NoAssembly);
216
208
}
217
209
218
210
// / Same as above except it runs function NaClObjDump with flags
219
211
// / NoRecords and NoAssembly set to false, and AddHeader set to true.
220
- bool runTest (const char *TestName ) {
221
- return runTestWithFlags (TestName, true , false , false );
212
+ bool runTest () {
213
+ return runTestWithFlags (true , false , false );
222
214
}
223
215
224
- // / Same as above but without test name.
225
- bool runTest () {
226
- return runTest (" Test" );
216
+ // TODO(kschimpf): The following function is deprecated and only
217
+ // provided until subzero is updated to use the new API that no
218
+ // longer uses test names.
219
+ bool runTest (const char *) {
220
+ return runTest ();
227
221
}
228
222
229
223
// / Same as above, but only print out assembly and errors.
230
- bool runTestForAssembly (const char *TestName ) {
231
- return runTestWithFlags (TestName, true , true , false );
224
+ bool runTestForAssembly () {
225
+ return runTestWithFlags (true , true , false );
232
226
}
233
-
234
227
// / Same as above, but only generate error messages.
235
- bool runTestForErrors (const char *TestName ) {
236
- return runTestWithFlags (TestName, true , true , true );
228
+ bool runTestForErrors () {
229
+ return runTestWithFlags (true , true , true );
237
230
}
238
231
239
232
// / Runs function llvm::NaClObjDump on the sequence of records
@@ -244,30 +237,31 @@ class NaClObjDumpMunger : public NaClBitcodeMunger {
244
237
// / with the memory buffer. Arguments NoRecords and NoAssembly are
245
238
// / passed to NaClObjDump. Returns true if test succeeds without
246
239
// / errors.
247
- bool runTestWithFlags (const char * TestName, const uint64_t Munges[],
248
- size_t MungesSize, bool AddHeader,
249
- bool NoRecords, bool NoAssembly);
240
+ bool runTestWithFlags (const uint64_t Munges[], size_t MungesSize,
241
+ bool AddHeader, bool NoRecords, bool NoAssembly);
250
242
251
243
// / Same as above except it runs function NaClObjDump with flags
252
244
// / NoRecords and NoAssembly set to false, and AddHeader set to
253
245
// / true.
254
- bool runTest (const char * TestName, const uint64_t Munges[],
255
- size_t MungesSize) {
256
- return runTestWithFlags (TestName, Munges, MungesSize, true , false , false );
246
+ bool runTest (const uint64_t Munges[], size_t MungesSize) {
247
+ return runTestWithFlags (Munges, MungesSize, true , false , false );
257
248
}
258
249
259
- bool runTest (const uint64_t Munges[], size_t MungesSize) {
260
- return runTest ( " Test " , Munges, MungesSize);
250
+ bool runTestForAssembly (const uint64_t Munges[], size_t MungesSize) {
251
+ return runTestWithFlags ( Munges, MungesSize, true , true , false );
261
252
}
262
253
263
- bool runTestForAssembly (const char * TestName, const uint64_t Munges[],
254
+ // TODO(kschimpf): The following function is deprecated and only
255
+ // provided until subzero is updated to use the new API that no
256
+ // longer uses test names.
257
+ bool runTestForAssembly (const char *, const uint64_t Munges[],
264
258
size_t MungesSize) {
265
- return runTestWithFlags (TestName, Munges, MungesSize, true , true , false );
259
+ return runTestForAssembly ( Munges, MungesSize);
266
260
}
267
261
268
- bool runTestForErrors ( const char * TestName, const uint64_t Munges[],
269
- size_t MungesSize) {
270
- return runTestWithFlags (TestName, Munges, MungesSize, true , true , true );
262
+
263
+ bool runTestForErrors ( const uint64_t Munges[], size_t MungesSize) {
264
+ return runTestWithFlags (Munges, MungesSize, true , true , true );
271
265
}
272
266
};
273
267
@@ -280,18 +274,12 @@ class NaClParseBitcodeMunger : public NaClBitcodeMunger {
280
274
281
275
// / Runs function llvm::NaClParseBitcodeFile, and puts error messages
282
276
// / into DumpResults. Returns true if parse is successful.
283
- bool runTest (const char * TestName, const uint64_t Munges[],
284
- size_t MungesSize, bool VerboseErrors);
285
-
286
- // / Same as above, but without test name.
287
- bool runTest (const uint64_t Munges[], size_t MungesSize, bool VerboseErrors) {
288
- return runTest (" Test" , Munges, MungesSize, VerboseErrors);
289
- }
277
+ bool runTest (const uint64_t Munges[], size_t MungesSize, bool VerboseErrors);
290
278
291
279
// Same as above, but without any edits.
292
- bool runTest (const char * TestName, bool VerboseErrors) {
280
+ bool runTest (bool VerboseErrors) {
293
281
uint64_t NoMunges[] = {0 };
294
- return runTest (TestName, NoMunges, 0 , VerboseErrors);
282
+ return runTest (NoMunges, 0 , VerboseErrors);
295
283
}
296
284
};
297
285
@@ -302,12 +290,11 @@ class NaClCompressMunger : public NaClBitcodeMunger {
302
290
uint64_t RecordTerminator)
303
291
: NaClBitcodeMunger(Records, RecordsSize, RecordTerminator) {}
304
292
305
- bool runTest (const char * TestName, const uint64_t Munges[],
306
- size_t MungesSize);
293
+ bool runTest (const uint64_t Munges[], size_t MungesSize);
307
294
308
- bool runTest (const char * TestName ) {
295
+ bool runTest () {
309
296
uint64_t NoMunges[] = {0 };
310
- return runTest (TestName, NoMunges, 0 );
297
+ return runTest (NoMunges, 0 );
311
298
}
312
299
};
313
300
0 commit comments