14
14
from config import config
15
from logging import LogWriter, TimeStamp
15
from logging import ResultsLogger, TimeStamp, debugLogger
16
16
from errors import DependencyNotFoundError
21
The Test Case Superclass
25
self.encoding = config.encoding
26
# ascii + unicode. 8 bit extended char has been ripped out
27
self.supportedtypes = ("ascii", "utf-8", "utf-16", "utf-16-be", "utf-16-le", "unicode-escape", "raw-unicode-escape",
28
"big5", "gb18030", "eucJP", "eucKR", "shiftJIS")
30
# String comparison function
31
def compare(self, label, baseline, undertest, encoding=config.encoding):
33
Compares 2 strings to see if they are the same. The user may specify
34
the encoding to which the two strings are to be normalized for the
35
comparison. Default encoding is the default system encoding.
36
Normalization to extended 8 bit charactersets is not supported.
38
When the origin of either baseline or undertest is a text file whose
39
encoding is something other than ASCII, it is necessary to use
40
codecs.open() instead of open(), so the file's encoding may be
43
self.label = label.strip()
44
self.baseline = baseline
45
self.undertest = undertest
46
for string in [self.baseline, self.undertest]:
47
try: string = unicode(string, 'utf-8')
48
except TypeError: pass
49
self.encoding = encoding
51
# Normalize the encoding type for the comparaison based on self.encoding
52
if self.encoding in self.supportedtypes:
53
self.baseline = (self.baseline).encode(self.encoding)
54
self.undertest = (self.undertest).encode(self.encoding)
56
if self.baseline == self.undertest:
57
self.result = {self.label: "Passed"}
59
self.result = {self.label: "Failed - " + self.encoding + " strings do not match. " + self.baseline + " expected: Got " + self.undertest}
60
# Pass the test result to the LogWriter for writing
61
TC.writer.writeResult(self.result)
65
# We should probably raise an exception here
66
self.result = {self.label: "ERROR - " + self.encoding + " is not a supported encoding type"}
67
TC.writer.writeResult(self.result)
21
The Test Case Superclass
23
logger = ResultsLogger()
25
self.encoding = config.encoding
26
# ascii + unicode. 8 bit extended char has been ripped out
27
self.supportedtypes = ("ascii", "utf-8", "utf-16", "utf-16-be", "utf-16-le", "unicode-escape", "raw-unicode-escape",
28
"big5", "gb18030", "eucJP", "eucKR", "shiftJIS")
30
# String comparison function
31
def compare(self, label, baseline, undertest, encoding=config.encoding):
33
Compares 2 strings to see if they are the same. The user may specify
34
the encoding to which the two strings are to be normalized for the
35
comparison. Default encoding is the default system encoding.
36
Normalization to extended 8 bit charactersets is not supported.
38
When the origin of either baseline or undertest is a text file whose
39
encoding is something other than ASCII, it is necessary to use
40
codecs.open() instead of open(), so the file's encoding may be
43
self.label = label.strip()
44
self.baseline = baseline
45
self.undertest = undertest
46
for string in [self.baseline, self.undertest]:
47
try: string = unicode(string, 'utf-8')
48
except TypeError: pass
49
self.encoding = encoding
51
# Normalize the encoding type for the comparaison based on self.encoding
52
if self.encoding in self.supportedtypes:
53
self.baseline = (self.baseline).encode(self.encoding)
54
self.undertest = (self.undertest).encode(self.encoding)
56
if self.baseline == self.undertest:
57
self.result = {self.label: "Passed"}
59
self.result = {self.label: "Failed - " + self.encoding + " strings do not match. " + self.baseline + " expected: Got " + self.undertest}
60
# Pass the test result to the ResultsLogger for writing
61
TC.logger.log(self.result)
65
# We should probably raise an exception here
66
self.result = {self.label: "ERROR - " + self.encoding + " is not a supported encoding type"}
67
TC.logger.log(self.result)
71
71
# String Test Case subclass
72
72
class TCString(TC):
74
String Test Case Class
74
String Test Case Class
79
79
# Image test case subclass
82
Image Test Case Class.
88
self.supportedmetrics = ("MAE", "MSE", "PSE", "PSNR","RMSE", "none")
89
self.scratchDir = config.scratchDir
92
# Get the ImageMagick version by parsing its '-version' output.
93
IMVer = os.popen('compare -version').readline()
94
IMVer = re.match('Version: ImageMagick ([0-9\.]+) .*', IMVer)
96
IMVer = IMVer.groups()[0]
97
TCImage.IMVersion = IMVer
99
raise DependencyNotFoundError, "ImageMagick"
101
# Use ImageMagick to compare 2 files
102
def compare(self, label, baseline, undertest, dfile='default', metric='none', threshold=0.0):
104
Calls ImageMagick's "compare" program. Default compares are based on
105
size but metric based comparisons are also supported with a threshold
106
determining pass/fail criteria.
108
self.label = label.strip()
109
self.baseline = baseline.strip()
110
self.undertest = undertest.strip()
111
self.difference = 0.0
112
self.metric = metric.strip()
113
self.threshold = threshold
115
# Create a default filename and flag it for deletion
116
if dfile == "default":
118
# Remove all whitespace from the label since IM chokes on it
119
splabel = label.split(" ")
120
label = "".join(splabel)
121
self.dfile = self.scratchDir + x.fileStamp(label)
123
else: # or use the supplied one with no deletion
127
# Check to see if the metric type is supported
128
if self.metric in self.supportedmetrics:
129
# This is a bit convoluted and will be until IM completes
130
# implementation of command line chaining. This should be put into
131
# a try also munge together our IM call chain, if we're not doing
133
if self.metric == "none":
134
# Build the comparison string. Redirect STDERR to STDOUT;
135
# IM writes to STDERR and cmd reads STDOUT
136
cmd = ("compare " + self.baseline + " " + self.undertest + " " + self.dfile + " " + "2>&1")
137
# os.popen returns a list; if it is empty then we have passed
138
answer = os.popen(cmd).readlines()
140
self.result = {self.label: "Passed - Images are the same size"}
142
fanswer = answer[0].strip()
143
self.result = {self.label: "Failed - " + fanswer}
144
TC.writer.writeResult(self.result)
146
else: # otherwise run the metric code
148
cmd = ("compare -metric " + self.metric + " " + self.baseline + " " + self.undertest + " " + self.dfile + " " + "2>&1")
149
answer = os.popen(cmd).readlines()
151
# We need to check if the metric comparison failed. Unfortunately we
152
# can only tell this by checking the length of the output of the
153
# command. More unfortunately, ImageMagic changed the length of the
154
# output at version 6.2.4, so we have to work around that.
156
IMVersion = TCImage.IMVersion
157
if IMVersion <= '6.2.3' and len(answer) == 1: metricFailed = False
158
if IMVersion >= '6.2.4' and len(answer) != 1: metricFailed = False
161
self.result = {self.label: "Failed - " + fanswer}
162
else: # grab the metric from answer and convert it to a number
163
fanswer = answer[0].strip()
164
fanswer = fanswer.split(" ")
166
fanswer = float(fanswer)
168
if fanswer == float("inf"): #same under PSNR returns inf dB:
169
self.result = {self.label: "Passed - " + "compare results: " + str(fanswer) + " dB"}
170
elif fanswer > self.threshold:
171
excess = fanswer - self.threshold
172
self.result = {self.label: "Failed - " + "compare result exceeds threshold by: " + str(excess) + " dB"}
174
under = self.threshold - fanswer
175
self.result = {self.label: "Passed - " + "compare results under threshold by: " + str(under) + " dB"}
176
TC.writer.writeResult(self.result)
179
# delete the composite image file if self.dfile is default
180
if self.deldfile == 1:
182
os.remove(self.dfile)
184
print "Could not delete tempfile " + self.dfile
186
else: # unsupported metric given
187
self.result = {self.label: "Failed - " + self.metric + " is not in the list of supported metrics"}
188
TC.writer.writeResult(self.result)
82
Image Test Case Class.
88
self.supportedmetrics = ("MAE", "MSE", "PSE", "PSNR","RMSE", "none")
89
self.scratchDir = config.scratchDir
92
# Get the ImageMagick version by parsing its '-version' output.
93
IMVer = os.popen('compare -version').readline()
94
IMVer = re.match('Version: ImageMagick ([0-9\.]+) .*', IMVer)
96
IMVer = IMVer.groups()[0]
97
TCImage.IMVersion = IMVer
99
raise DependencyNotFoundError, "ImageMagick"
101
# Use ImageMagick to compare 2 files
102
def compare(self, label, baseline, undertest, dfile='default', metric='none', threshold=0.0):
104
Calls ImageMagick's "compare" program. Default compares are based on
105
size but metric based comparisons are also supported with a threshold
106
determining pass/fail criteria.
108
self.label = label.strip()
109
self.baseline = baseline.strip()
110
self.undertest = undertest.strip()
111
self.difference = 0.0
112
self.metric = metric.strip()
113
self.threshold = threshold
115
# Create a default filename and flag it for deletion
116
if dfile == "default":
118
# Remove all whitespace from the label since IM chokes on it
119
splabel = label.split(" ")
120
label = "".join(splabel)
121
self.dfile = self.scratchDir + x.fileStamp(label)
123
else: # or use the supplied one with no deletion
127
# Check to see if the metric type is supported
128
if self.metric in self.supportedmetrics:
129
# This is a bit convoluted and will be until IM completes
130
# implementation of command line chaining. This should be put into
131
# a try also munge together our IM call chain, if we're not doing
133
if self.metric == "none":
134
# Build the comparison string. Redirect STDERR to STDOUT;
135
# IM writes to STDERR and cmd reads STDOUT
136
cmd = ("compare " + self.baseline + " " + self.undertest + " " + self.dfile + " " + "2>&1")
137
# os.popen returns a list; if it is empty then we have passed
138
answer = os.popen(cmd).readlines()
140
self.result = {self.label: "Passed - Images are the same size"}
142
fanswer = answer[0].strip()
143
self.result = {self.label: "Failed - " + fanswer}
144
TC.logger.log(self.result)
146
else: # otherwise run the metric code
148
cmd = ("compare -metric " + self.metric + " " + self.baseline + " " + self.undertest + " " + self.dfile + " " + "2>&1")
149
answer = os.popen(cmd).readlines()
151
# We need to check if the metric comparison failed. Unfortunately we
152
# can only tell this by checking the length of the output of the
153
# command. More unfortunately, ImageMagic changed the length of the
154
# output at version 6.2.4, so we have to work around that.
156
IMVersion = TCImage.IMVersion
157
if IMVersion <= '6.2.3' and len(answer) == 1: metricFailed = False
158
if IMVersion >= '6.2.4' and len(answer) != 1: metricFailed = False
161
self.result = {self.label: "Failed - " + fanswer}
162
else: # grab the metric from answer and convert it to a number
163
fanswer = answer[0].strip()
164
fanswer = fanswer.split(" ")
166
fanswer = float(fanswer)
168
if fanswer == float("inf"): #same under PSNR returns inf dB:
169
self.result = {self.label: "Passed - " + "compare results: " + str(fanswer) + " dB"}
170
elif fanswer > self.threshold:
171
excess = fanswer - self.threshold
172
self.result = {self.label: "Failed - " + "compare result exceeds threshold by: " + str(excess) + " dB"}
174
under = self.threshold - fanswer
175
self.result = {self.label: "Passed - " + "compare results under threshold by: " + str(under) + " dB"}
176
TC.logger.log(self.result)
179
# delete the composite image file if self.dfile is default
180
if self.deldfile == 1:
182
os.remove(self.dfile)
184
debugLogger.log("Could not delete tempfile " + self.dfile)
186
else: # unsupported metric given
187
self.result = {self.label: "Failed - " + self.metric + " is not in the list of supported metrics"}
188
TC.logger.log(self.result)
193
193
class TCNumber(TC):
195
Number Comparaison Test Case Class
199
self.supportedtypes = ("int", "long", "float", "complex", "oct", "hex")
201
# Compare 2 numbers by the type provided in the type arg
202
def compare(self, label, baseline, undertest, type):
204
Compares 2 numbers to see if they are the same. The user may specify
205
how to normalize mixed type comparisons via the type argument.
207
self.label = label.strip()
208
self.baseline = baseline
209
self.undertest = undertest
210
self.type = type.strip()
212
# If we get a valid type, convert to that type and compare
213
if self.type in self.supportedtypes:
214
# Normalize for comparison
215
if self.type == "int":
216
self.baseline = int(self.baseline)
217
self.undertest = int(self.undertest)
218
elif self.type == "long":
219
self.baseline = long(self.baseline)
220
self.undertest = long(self.undertest)
221
elif self.type == "float":
222
self.baseline = float(self.baseline)
223
self.undertest = float(self.undertest)
225
self.baseline = complex(self.baseline)
226
self.undertest = complex(self.undertest)
229
if self.baseline == self.undertest:
230
self.result = {self.label: "Passed - numbers are the same"}
232
self.result = {self.label: "Failed - " + str(self.baseline) + " expected: Got " + str(self.undertest)}
233
TC.writer.writeResult(self.result)
236
self.result = {self.label: "Failed - " + self.type + " is not in list of supported types"}
237
TC.writer.writeResult(self.result)
195
Number Comparaison Test Case Class
199
self.supportedtypes = ("int", "long", "float", "complex", "oct", "hex")
201
# Compare 2 numbers by the type provided in the type arg
202
def compare(self, label, baseline, undertest, type):
204
Compares 2 numbers to see if they are the same. The user may specify
205
how to normalize mixed type comparisons via the type argument.
207
self.label = label.strip()
208
self.baseline = baseline
209
self.undertest = undertest
210
self.type = type.strip()
212
# If we get a valid type, convert to that type and compare
213
if self.type in self.supportedtypes:
214
# Normalize for comparison
215
if self.type == "int":
216
self.baseline = int(self.baseline)
217
self.undertest = int(self.undertest)
218
elif self.type == "long":
219
self.baseline = long(self.baseline)
220
self.undertest = long(self.undertest)
221
elif self.type == "float":
222
self.baseline = float(self.baseline)
223
self.undertest = float(self.undertest)
225
self.baseline = complex(self.baseline)
226
self.undertest = complex(self.undertest)
229
if self.baseline == self.undertest:
230
self.result = {self.label: "Passed - numbers are the same"}
232
self.result = {self.label: "Failed - " + str(self.baseline) + " expected: Got " + str(self.undertest)}
233
TC.logger.log(self.result)
236
self.result = {self.label: "Failed - " + self.type + " is not in list of supported types"}
237
TC.logger.log(self.result)
241
241
if __name__ == '__main__':
242
# import the test modules
246
# Set up vars to use to test TC class
249
label = "unit test case 1.0"
253
# Create the TC instance
256
# Fire off the compaison
257
result = case1.compare(label, baseline, undertest, encoding)
259
# Print the result - should be label - passed
262
# Reset variables for failure path
266
label = "unit test case 1.1"
269
result = case1.compare(label, baseline, undertest, encoding)
271
# Print the result - should be label - failure
274
# Create a TCString instance
277
# Load our variables for this test
278
label = " unit test case 2.0"
281
undertest = u"gro\xc3\xa1"
284
# Fire off a UTF-8 compare
285
result = case2.compare(label, baseline, undertest, encoding)
287
# Print the result - should be label - passed
290
# Fire the test for ASCII converted to UTF-8 testing
291
label = " unit test case 2.1"
293
baseline = "please work"
294
undertest = "please work"
297
result = case2.compare(label, baseline, undertest, encoding)
299
# Print the result - should be label - passed
302
# Reset variables for an out of range encoding type
303
label = " unit test case 2.2"
304
encoding = "swahilli"
305
baseline = "please work"
306
undertest = "please work"
309
result = case2.compare(label, baseline, undertest, encoding)
311
# Print the result - should be label - Error - not supported
314
# Reset variables for unmatched utf-8 strings
315
label = " unit test case 2.3"
318
undertest = "nomatch"
321
# result = case2.compare(label, baseline, undertest, encoding)
323
# Print the result - should be label - failure
326
# Reset variables for inherited TC base compare
327
label = " unit test case 2.4"
328
baseline = "This is inhereited"
329
undertest = "This is inhereited"
333
result = case2.compare(label, baseline, undertest, encoding)
335
# Print the result - should be label - Passed
339
# Include real CJKI (UTF-8) charcters for string compare
340
# For this first test case, we are comparing same JA characters
341
label = " unit test case 2.5"
347
result = case2.compare(label, baseline, undertest, encoding)
349
# Print the result - should be label - Passed
353
# Testing different JA characters
354
label = " unit test case 2.6"
360
result = case2.compare(label, baseline, undertest, encoding)
362
# Print the result - should be label - Failed
367
# Test the timestamper class
368
# Create a new timestamp instance
369
# Print the file format time
371
presently = stamp1.fileStamp("filestamp")
373
# Print - should be filenameYYYYMMDD with local systems date
377
entry = stamp1.entryStamp()
379
# Print the entrystamp - should be YYYY-MM-DD_HH:MM:SS with local system time
382
# Test to see that image compares work - this a simple compare with defaults
384
label = "unit test case 3.0"
385
baseline = "../examples/data/GNOME-Street.png"
386
undertest = "../examples/data/GNOME-Street1.png"
389
# Create a TCImage instance
392
# Fire off the compare
393
result = case3.compare(label, baseline, undertest)
395
# Print the result Should be label - Passed - Images are same size
398
# Default compare with different images (the sizes differ)
399
label = "unit test case 3.1"
400
baseline = "../examples/data/GNOME-Street.png"
401
undertest = "../examples/data/g-star.png"
404
# Fire off the compare
405
result = case3.compare(label, baseline, undertest)
407
# Print the result Should be label - Failied compare:Images differ in size
410
# Image compare pass with the metrics option
411
label = "unit test case 3.2"
412
baseline = "../examples/data/GNOME-Street.png"
413
undertest = "../examples/data/GNOME-Street1.png"
415
metrics = ("MAE", "MSE", "PSE", "PSNR"," RMSE")
417
for i in range(len(metrics)):
418
result = case3.compare(label, baseline, undertest, metric=metrics[i])
422
# Image compare fail metrics
423
label = "unit test case 3.3"
424
baseline = "../examples/data/g-star.png"
425
undertest = "../examples/data/g-star1.png"
427
metrics = ("MAE", "MSE", "PSE", "PSNR"," RMSE")
429
for i in range(len(metrics)):
430
result = case3.compare(label, baseline, undertest, metric=metrics[i])
434
# Image comapre threshold metrics - only PNSR should pass
435
label = "unit test case 3.4"
436
baseline = "../examples/data/g-star.png"
437
undertest = "../examples/data/g-star1.png"
439
metrics = ("MAE", "MSE", "PSE", "PSNR"," RMSE")
442
for i in range(len(metrics)):
443
result = case3.compare(label, baseline, undertest, metric=metrics[i], threshold=bound)
448
label = "unit test case 3.5"
449
baseline = "../examples/data/g-star.png"
450
undertest = "../examples/data/g-star1.png"
454
result = case3.compare(label, baseline, undertest, metric=metrics)
456
# Should be failed - metric unsupported
459
# Number comparison tests
460
label = "unit test case 4.0"
466
# Make a TCNumber instance
469
# Make a simple int compare
470
result = case4.compare(label, baseline, undertest, type)
475
# Now make the int fail
476
label = "unit test case 4.1"
480
result = case4.compare(label, baseline, undertest, type)
486
label = "unit test case 4.2"
487
baseline = 1112223334445556667778889990L
488
undertest = 1112223334445556667778889990L
492
result = case4.compare(label, baseline, undertest, type)
498
label = "unit test case 4.3"
500
undertest = 99.432670
504
result = case4.compare(label, baseline, undertest, type)
510
label = "unit test case 4.4"
516
result = case4.compare(label, baseline, undertest, type)
522
label = "unit test case 4.5"
528
result = case4.compare(label, baseline, undertest, type)
534
label = "unit test case 4.6"
540
result = case4.compare(label, baseline, undertest, type)
545
# Conversion pass - pass in equivalent hex and octal but compare as int
546
label = "unit test case 4.7"
552
result = case4.compare(label, baseline, undertest, type)
558
label = "unit test case 4.8"
562
result = case4.compare(label, baseline, undertest, type)
564
# Should fail - unsupported type
242
# import the test modules
246
# Set up vars to use to test TC class
249
label = "unit test case 1.0"
253
# Create the TC instance
256
# Fire off the compaison
257
result = case1.compare(label, baseline, undertest, encoding)
259
# Print the result - should be label - passed
262
# Reset variables for failure path
266
label = "unit test case 1.1"
269
result = case1.compare(label, baseline, undertest, encoding)
271
# Print the result - should be label - failure
274
# Create a TCString instance
277
# Load our variables for this test
278
label = " unit test case 2.0"
281
undertest = u"gro\xc3\xa1"
284
# Fire off a UTF-8 compare
285
result = case2.compare(label, baseline, undertest, encoding)
287
# Print the result - should be label - passed
290
# Fire the test for ASCII converted to UTF-8 testing
291
label = " unit test case 2.1"
293
baseline = "please work"
294
undertest = "please work"
297
result = case2.compare(label, baseline, undertest, encoding)
299
# Print the result - should be label - passed
302
# Reset variables for an out of range encoding type
303
label = " unit test case 2.2"
304
encoding = "swahilli"
305
baseline = "please work"
306
undertest = "please work"
309
result = case2.compare(label, baseline, undertest, encoding)
311
# Print the result - should be label - Error - not supported
314
# Reset variables for unmatched utf-8 strings
315
label = " unit test case 2.3"
318
undertest = "nomatch"
321
# result = case2.compare(label, baseline, undertest, encoding)
323
# Print the result - should be label - failure
326
# Reset variables for inherited TC base compare
327
label = " unit test case 2.4"
328
baseline = "This is inhereited"
329
undertest = "This is inhereited"
333
result = case2.compare(label, baseline, undertest, encoding)
335
# Print the result - should be label - Passed
339
# Include real CJKI (UTF-8) charcters for string compare
340
# For this first test case, we are comparing same JA characters
341
label = " unit test case 2.5"
347
result = case2.compare(label, baseline, undertest, encoding)
349
# Print the result - should be label - Passed
353
# Testing different JA characters
354
label = " unit test case 2.6"
360
result = case2.compare(label, baseline, undertest, encoding)
362
# Print the result - should be label - Failed
367
# Test the timestamper class
368
# Create a new timestamp instance
369
# Print the file format time
371
presently = stamp1.fileStamp("filestamp")
373
# Print - should be filenameYYYYMMDD with local systems date
377
entry = stamp1.entryStamp()
379
# Print the entrystamp - should be YYYY-MM-DD_HH:MM:SS with local system time
382
# Test to see that image compares work - this a simple compare with defaults
384
label = "unit test case 3.0"
385
baseline = "../examples/data/20w.png"
386
undertest = "../examples/data/20b.png"
389
# Create a TCImage instance
392
# Fire off the compare
393
result = case3.compare(label, baseline, undertest)
395
# Print the result Should be label - Passed - Images are same size
398
# Default compare with different images (the sizes differ)
399
label = "unit test case 3.1"
400
baseline = "../examples/data/20w.png"
401
undertest = "../examples/data/10w.png"
404
# Fire off the compare
405
result = case3.compare(label, baseline, undertest)
407
# Print the result Should be label - Failied compare:Images differ in size
410
# Image compare pass with the metrics option
411
label = "unit test case 3.2"
412
baseline = "../examples/data/20w.png"
413
undertest = "../examples/data/20b.png"
415
metrics = ("MAE", "MSE", "PSE", "PSNR"," RMSE")
417
for i in range(len(metrics)):
418
result = case3.compare(label, baseline, undertest, metric=metrics[i])
422
# Image compare fail metrics
423
label = "unit test case 3.3"
424
baseline = "../examples/data/10w.png"
425
undertest = "../examples/data/10b.png"
427
metrics = ("MAE", "MSE", "PSE", "PSNR"," RMSE")
429
for i in range(len(metrics)):
430
result = case3.compare(label, baseline, undertest, metric=metrics[i])
434
# Image comapre threshold metrics - only PNSR should pass
435
label = "unit test case 3.4"
436
baseline = "../examples/data/10w.png"
437
undertest = "../examples/data/10b.png"
439
metrics = ("MAE", "MSE", "PSE", "PSNR"," RMSE")
442
for i in range(len(metrics)):
443
result = case3.compare(label, baseline, undertest, metric=metrics[i], threshold=bound)
448
label = "unit test case 3.5"
449
baseline = "../examples/data/10w.png"
450
undertest = "../examples/data/10b.png"
454
result = case3.compare(label, baseline, undertest, metric=metrics)
456
# Should be failed - metric unsupported
459
# Number comparison tests
460
label = "unit test case 4.0"
466
# Make a TCNumber instance
469
# Make a simple int compare
470
result = case4.compare(label, baseline, undertest, type)
475
# Now make the int fail
476
label = "unit test case 4.1"
480
result = case4.compare(label, baseline, undertest, type)
486
label = "unit test case 4.2"
487
baseline = 1112223334445556667778889990L
488
undertest = 1112223334445556667778889990L
492
result = case4.compare(label, baseline, undertest, type)
498
label = "unit test case 4.3"
500
undertest = 99.432670
504
result = case4.compare(label, baseline, undertest, type)
510
label = "unit test case 4.4"
516
result = case4.compare(label, baseline, undertest, type)
522
label = "unit test case 4.5"
528
result = case4.compare(label, baseline, undertest, type)
534
label = "unit test case 4.6"
540
result = case4.compare(label, baseline, undertest, type)
545
# Conversion pass - pass in equivalent hex and octal but compare as int
546
label = "unit test case 4.7"
552
result = case4.compare(label, baseline, undertest, type)
558
label = "unit test case 4.8"
562
result = case4.compare(label, baseline, undertest, type)
564
# Should fail - unsupported type