MCPcopy Create free account
hub / github.com/Kitware/VTK / TestEmptyInput

Function TestEmptyInput

Common/Core/Testing/Python/TestEmptyInput.py:374–418  ·  view source on GitHub ↗

Test each class in batch for empty input. :param: batch - the set of classes to be tested. :param: batchNo - if the set of classes is a subgroup then this is the index of the subgroup. :param: batchSize - if the set of classes is a subgroup then this

(batch, batchNo=0, batchSize=0)

Source from the content-addressed store, hash-verified

372 raise
373
374def TestEmptyInput(batch, batchNo=0, batchSize=0):
375 '''
376 Test each class in batch for empty input.
377
378 :param: batch - the set of classes to be tested.
379 :param: batchNo - if the set of classes is a subgroup then this
380 is the index of the subgroup.
381 :param: batchSize - if the set of classes is a subgroup then this
382 is the size of the subgroup.
383 '''
384 baseIdx = batchNo * batchSize
385 idx = baseIdx
386 for a in batch:
387 batchIdx = idx - baseIdx
388 res = " Testing -- {:4d} - {:s}".format(idx,a)
389 if (batchIdx < len(batch) - 1):
390 nextRes = " Next -- {:4d} - {:s}".format(idx + 1,list(batch)[batchIdx +1])
391 else:
392 nextRes = "No next"
393# if verbose:
394# print(res, nextRes)
395 classesTested.add(a)
396 ok = TestOne(a)
397 if ok == 0:
398 if verbose:
399 print(res + ' - Fail')
400 elif ok == 1:
401 if verbose:
402 print(res + ' - Ok')
403 elif ok == 2:
404 if verbose:
405 print(res + ' - no observer could be added.')
406 elif ok == 3:
407 if verbose:
408 print(res + ' - is Abstract')
409 elif ok == 4:
410 if verbose:
411 print(res + ' - No concrete implementation')
412 elif ok == 5:
413 if verbose:
414 print(res + ' - Does not exist')
415 else:
416 if verbose:
417 print(res + ' - Unknown status')
418 idx += 1
419
420def BatchTest(vtkClasses, batchNo, batchSize):
421 ''&#x27;

Callers 2

BatchTestFunction · 0.70
mainFunction · 0.70

Calls 5

TestOneFunction · 0.70
listClass · 0.50
printFunction · 0.50
formatMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected