/
ut_cclut_execute_test_case_file.inc
1615 lines (1402 loc) · 102 KB
/
ut_cclut_execute_test_case_file.inc
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
Unit Tests for cclut_execute_test_case_file.
*/
%i cclsource:cclut_xml_functions.inc
%i cclsource:cclut_code_coverage.inc
declare setup(null) = null with protect
declare validateEnvironmentXml(xml = vc) = null with protect
declare validateListingXml(xml = vc) = null with protect
declare validateResultsXml(xml = vc, legacyFormat = i2) = null with protect
declare validateCoverageXml(coverage = vc) = null with protect
declare validateNoIssuesResponse(response = vc(ref)) = null with protect
declare testNoIssues(null) = null with protect
declare testNoIssuesLegacy(null) = null with protect
declare testNoIssuesCBO(null) = null with protect
declare testNoIssuesRBO(null) = null with protect
declare testNoIssuesInvalidOM(null) = null with protect
declare testErrorsEverywhere(null) = null with protect
declare testFailsAndErrorsEverywhere(null) = null with protect
declare testFailsEverywhere(null) = null with protect
declare testFailsTestsOnly(null) = null with protect
declare testSetupErrors(null) = null with protect
declare testLoadingErrors(null) = null with protect
declare testTestCaseFileDoesNotExist(null) = null with protect
declare testCclMinimumNotMet(null) = null with protect
declare cclut::getOutdatedCclVersion(null) = vc with protect
declare testCompileProgramFailure(null) = null with protect
declare cclut::compileProgramFailure(fileDir = vc, fileName = vc, listingDir = vc, listingName = vc, errMsg = vc(ref)) = i2
declare testGenerateTestCaseProgramFailure(null) = null with protect
declare cclut::generateTestCaseProgramFailure(fileDir = vc, fileName = vc, listingDir = vc, listingName = vc,
objName = vc, errorMessage = vc(ref)) = i2
declare testCheckPrgFailure(null) = null with protect
declare checkPrgFailure(prgName = vc) = i4 with protect
declare testPostExecutionFailure(null) = null with protect
declare mockRemove(fileLocation = vc) = i4 with protect
declare testErrorThenExitScript(null) = null with protect
declare testCoverageExcludes(null) = null with protect
record ucets_request (
1 testCaseDirectory = vc
1 testCaseFileName = vc
1 testNamePattern = vc
1 programs[*]
2 programName = vc
2 compile = i2
1 optimizerMode = vc
1 enforcePredeclare = i2
1 deprecatedFlag = vc
1 legacyResultsFormat = i2
) with protect
record ucets_reply (
1 environmentXml = vc
1 listingXml = vc
1 coverageXml = vc
1 resultsXml = vc
1 programs[*]
2 programName = vc
2 listingXml = vc
2 coverageXml = vc
%i cclsource:status_block.inc
) with protect
record ucets_testCaseResults (
1 resultInd = i2
1 tests[*]
2 name = vc
2 asserts[*]
3 lineNumber = i4
3 context = vc
3 resultInd = i2 ;TRUE = PASS, FALSE = FAIL
3 condition = vc
2 errors[*]
3 lineNumber = i4
3 errorText = vc
%i cclsource:status_block.inc
) with protect
declare testing::errorSetupOnce = i2 with protect, noconstant(FALSE)
declare testing::errorSetup = i2 with protect, noconstant(FALSE)
declare testing::errorTeardown = i2 with protect, noconstant(FALSE)
declare testing::errorTest = i2 with protect, noconstant(FALSE)
declare testing::errorTeardownOnce = i2 with protect, noconstant(FALSE)
declare testing::failSetupOnce = i2 with protect, noconstant(FALSE)
declare testing::failSetup = i2 with protect, noconstant(FALSE)
declare testing::failTeardown = i2 with protect, noconstant(FALSE)
declare testing::failTest = i2 with protect, noconstant(FALSE)
declare testing::failTeardownOnce = i2 with protect, noconstant(FALSE)
/**
per-test initialization
*/
subroutine setup(null)
declare stat = i4 with protect, noconstant(0)
set stat = initRec(ucets_request)
set stat = initRec(ucets_reply)
set stat = initRec(ucets_testCaseResults)
set ucets_request->testCaseDirectory = "cclsource"
set ucets_request->testCaseFileName = "ut_cclut_suo_su_td_tdo"
set testing::errorSetupOnce = FALSE
set testing::errorSetup = FALSE
set testing::errorTeardown = FALSE
set testing::errorTest = FALSE
set testing::errorTeardownOnce = FALSE
set testing::failSetupOnce = FALSE
set testing::failSetup = FALSE
set testing::failTeardown = FALSE
set testing::failTest = FALSE
set testing::failTeardownOnce = FALSE
end ;;;setup
/**
Validates that an environmentXml matches the expected enviromentXml.
*/
subroutine validateEnvironmentXml(xml)
declare xmlItem = vc with protect, noconstant("")
declare itemFound = i2 with protect, noconstant(FALSE)
set xmlItem = cclut::retrieveXmlContent(xml, "CURRDB", 1, itemFound)
call cclutAssertI4Equal(CURREF, "extact currdb", itemFound, TRUE)
call cclutAssertVCNotEqual(CURREF, "validate currdb", xmlItem, "")
set xmlItem = cclut::retrieveXmlContent(xml, "CURRDBNAME", 1, itemFound)
call cclutAssertI4Equal(CURREF, "extact currdbname", itemFound, TRUE)
call cclutAssertVCNotEqual(CURREF, "validate currdbname", xmlItem, "")
set xmlItem = cclut::retrieveXmlContent(xml, "CURRDBUSER", 1, itemFound)
call cclutAssertI4Equal(CURREF, "extact currdbuser", itemFound, TRUE)
call cclutAssertVCNotEqual(CURREF, "validate currdbuser", xmlItem, "")
set xmlItem = cclut::retrieveXmlContent(xml, "CURRDBSYS", 1, itemFound)
call cclutAssertI4Equal(CURREF, "extact currdbsys", itemFound, TRUE)
call cclutAssertVCNotEqual(CURREF, "validate currdbsys", xmlItem, "")
set xmlItem = cclut::retrieveXmlContent(xml, "CCLVER", 1, itemFound)
call cclutAssertI4Equal(CURREF, "extact cclver", itemFound, TRUE)
call cclutAssertVCNotEqual(CURREF, "validate cclver", xmlItem, "")
set xmlItem = cclut::retrieveXmlContent(xml, "CURSYS", 1, itemFound)
call cclutAssertI4Equal(CURREF, "extact cursys", itemFound, TRUE)
call cclutAssertVCNotEqual(CURREF, "validate cursys", xmlItem, "")
set xmlItem = cclut::retrieveXmlContent(xml, "CURLOCALE", 1, itemFound)
call cclutAssertI4Equal(CURREF, "extact curlocale", itemFound, TRUE)
call cclutAssertVCNotEqual(CURREF, "validate curlocale", xmlItem, "")
set xmlItem = cclut::retrieveXmlContent(xml, "CURUSER", 1, itemFound)
call cclutAssertI4Equal(CURREF, "extact curuser", itemFound, TRUE)
call cclutAssertVCNotEqual(CURREF, "validate curuser", xmlItem, "")
set xmlItem = cclut::retrieveXmlContent(xml, "CURUTC", 1, itemFound)
call cclutAssertI4Equal(CURREF, "extact curutc", itemFound, TRUE)
call cclutAssertVCNotEqual(CURREF, "validate curutc", xmlItem, "")
set xmlItem = cclut::retrieveXmlContent(xml, "CURUTCDIFF", 1, itemFound)
call cclutAssertI4Equal(CURREF, "extact curutcdiff", itemFound, TRUE)
call cclutAssertVCNotEqual(CURREF, "validate curutcdiff", xmlItem, "")
set xmlItem = cclut::retrieveXmlContent(xml, "CURTIMEZONE", 1, itemFound)
call cclutAssertI4Equal(CURREF, "extact curtimezone", itemFound, TRUE)
call cclutAssertVCNotEqual(CURREF, "validate curtimezone", xmlItem, "")
set xmlItem = cclut::retrieveXmlContent(xml, "CURTIMEZONEAPP", 1, itemFound)
call cclutAssertI4Equal(CURREF, "extact curtimezoneapp", itemFound, TRUE)
call cclutAssertVCNotEqual(CURREF, "validate curtimezoneapp", xmlItem, "")
set xmlItem = cclut::retrieveXmlContent(xml, "CURTIMEZONESYS", 1, itemFound)
call cclutAssertI4Equal(CURREF, "extact curtimezonesys", itemFound, TRUE)
call cclutAssertVCNotEqual(CURREF, "validate curtimezonesys", xmlItem, "")
set xmlItem = cclut::retrieveXmlContent(xml, "CURREVAFD", 1, itemFound)
call cclutAssertI4Equal(CURREF, "extact currevafd", itemFound, TRUE)
call cclutAssertVCNotEqual(CURREF, "validate currevafd", xmlItem, "")
set xmlItem = cclut::retrieveXmlContent(xml, "CURGROUP", 1, itemFound)
call cclutAssertI4Equal(CURREF, "extact curgroup", itemFound, TRUE)
call cclutAssertVCNotEqual(CURREF, "validate curgroup", xmlItem, "")
set xmlItem = cclut::retrieveXmlContent(xml, "DBVERSION", 1, itemFound)
call cclutAssertI4Equal(CURREF, "extact dbversion", itemFound, TRUE)
call cclutAssertVCNotEqual(CURREF, "validate dbversion", xmlItem, "")
set xmlItem = cclut::retrieveXmlContent(xml, "DBOPTMODE", 1, itemFound)
call cclutAssertI4Equal(CURREF, "extact dboptmode", itemFound, TRUE)
call cclutAssertVCNotEqual(CURREF, "validate dboptmode", xmlItem, "")
end ;;;validateEnvironmentXml
/**
Validates that a listingXml matches the expected listing.
Note: The behavior of this function depends on the specific contents of various framework files
so this function must be updated whenever those files are modified.
*/
subroutine validateListingXml(xml)
declare matches = i2 with protect, noconstant(FALSE)
call cclutAssertStartsWith(CURREF, "validate listingXml",
~<LISTING><LISTING_NAME>UT_CCLUT_SUO_SU_TD_TDO</LISTING_NAME><COMPILE_DATE>~, xml)
;21-NOV-2017 11:06:09.00
set matches = operator(substring(75, 23, xml), "regexplike",
"[0-9]{2}-(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)-[0-9]{4} [0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{2}")
call cclutAssertI4Equal(CURREF, "validate listingXml", matches, TRUE)
; call echo(build2("listingXml = ", xml))
call cclutAssertEndsWith(CURREF, "validate listingXml",
~</COMPILE_DATE><LINES><LINE><NBR>1879</NBR><TEXT><![CDATA[/**]]></TEXT></LINE><LINE><NBR>1880</NBR><TEXT><![CDATA[ A test c\
ase file for testing the CCL Unit framework.]]></TEXT></LINE><LINE><NBR>1881</NBR><TEXT><![CDATA[ This test case file contai\
ns all of the testing support subroutines, setupOnce, setup, teardown and teardownOnce and three test]]></TEXT></LINE><LINE><\
NBR>1882</NBR><TEXT><![CDATA[ subroutines. Each subroutine fires a successful assert to indicate it executed and based on co\
nfiguration will then fire]]></TEXT></LINE><LINE><NBR>1883</NBR><TEXT><![CDATA[ a failed assert and/or cause an error based \
on the value of the boolean variable]]></TEXT></LINE><LINE><NBR>1884</NBR><TEXT><![CDATA[ testing::{fail|error}{SetupOnce|Se\
tup|Test|Teardown|TeardownOnce} which needs to be provided by the invoking test.]]></TEXT></LINE><LINE><NBR>1885</NBR><TEXT><\
![CDATA[*/]]></TEXT></LINE><LINE><NBR>1886</NBR><TEXT><![CDATA[declare setupOnce(null) = null]]></TEXT></LINE><LINE><NBR>1887\
</NBR><TEXT><![CDATA[declare teardownOnce(null) = null]]></TEXT></LINE><LINE><NBR>1888</NBR><TEXT><![CDATA[declare setup(null\
) = null]]></TEXT></LINE><LINE><NBR>1889</NBR><TEXT><![CDATA[declare testOne(null) = null]]></TEXT></LINE><LINE><NBR>1890</NB\
R><TEXT><![CDATA[declare testTwo(null) = null]]></TEXT></LINE><LINE><NBR>1891</NBR><TEXT><![CDATA[declare testThree(null) = n\
ull]]></TEXT></LINE><LINE><NBR>1892</NBR><TEXT><![CDATA[declare teardown(null) = null]]></TEXT></LINE><LINE><NBR>1893</NBR><T\
EXT><![CDATA[]]></TEXT></LINE><LINE><NBR>1894</NBR><TEXT><![CDATA[declare guaranteedError = i4 with protect, noconstant(0)]]>\
</TEXT></LINE><LINE><NBR>1895</NBR><TEXT><![CDATA[]]></TEXT></LINE><LINE><NBR>1896</NBR><TEXT><![CDATA[if (validate(testing::\
errorLoading, FALSE) = TRUE)]]></TEXT></LINE><LINE><NBR>1897</NBR><TEXT><![CDATA[ set guaranteedError = "loading error"]]>\
</TEXT></LINE><LINE><NBR>1898</NBR><TEXT><![CDATA[endif]]></TEXT></LINE><LINE><NBR>1899</NBR><TEXT><![CDATA[]]></TEXT></LINE>\
<LINE><NBR>1900</NBR><TEXT><![CDATA[subroutine setupOnce(null)]]></TEXT></LINE><LINE><NBR>1901</NBR><TEXT><![CDATA[ call ccl\
utAssertVCEqual(CURREF, "setupOnce executed", "SO", "SO")]]></TEXT></LINE><LINE><NBR>1902</NBR><TEXT><![CDATA[ if (testing::\
failSetupOnce)]]></TEXT></LINE><LINE><NBR>1903</NBR><TEXT><![CDATA[ call cclutAssertI4Equal(CURREF, "setupOnce failure", 0\
, 1)]]></TEXT></LINE><LINE><NBR>1904</NBR><TEXT><![CDATA[ endif]]></TEXT></LINE><LINE><NBR>1905</NBR><TEXT><![CDATA[ if (te\
sting::errorSetupOnce)]]></TEXT></LINE><LINE><NBR>1906</NBR><TEXT><![CDATA[ set guaranteedError = "setupOnce error"]]></TE\
XT></LINE><LINE><NBR>1907</NBR><TEXT><![CDATA[ endif]]></TEXT></LINE><LINE><NBR>1908</NBR><TEXT><![CDATA[end ;setupOnce]]></\
TEXT></LINE><LINE><NBR>1909</NBR><TEXT><![CDATA[]]></TEXT></LINE><LINE><NBR>1910</NBR><TEXT><![CDATA[subroutine teardownOnce(\
null)]]></TEXT></LINE><LINE><NBR>1911</NBR><TEXT><![CDATA[ call cclutAssertVCEqual(CURREF, "teardownOnce executed", "TO", "T\
O")]]></TEXT></LINE><LINE><NBR>1912</NBR><TEXT><![CDATA[ if (testing::failTeardownOnce)]]></TEXT></LINE><LINE><NBR>1913</NBR\
><TEXT><![CDATA[ call cclutAssertI4Equal(CURREF, "teardownOnce failure", 0, 1)]]></TEXT></LINE><LINE><NBR>1914</NBR><TEXT>\
<![CDATA[ endif]]></TEXT></LINE><LINE><NBR>1915</NBR><TEXT><![CDATA[ if (testing::errorTeardownOnce)]]></TEXT></LINE><LINE>\
<NBR>1916</NBR><TEXT><![CDATA[ set guaranteedError = "teardownOnce error"]]></TEXT></LINE><LINE><NBR>1917</NBR><TEXT><![CD\
ATA[ endif]]></TEXT></LINE><LINE><NBR>1918</NBR><TEXT><![CDATA[end ;teardownOnce]]></TEXT></LINE><LINE><NBR>1919</NBR><TEXT>\
<![CDATA[]]></TEXT></LINE><LINE><NBR>1920</NBR><TEXT><![CDATA[subroutine setup(null)]]></TEXT></LINE><LINE><NBR>1921</NBR><TE\
XT><![CDATA[ call cclutAssertI4Equal(CURREF, "setup executed", 0, 0)]]></TEXT></LINE><LINE><NBR>1922</NBR><TEXT><![CDATA[ i\
f (testing::failSetup)]]></TEXT></LINE><LINE><NBR>1923</NBR><TEXT><![CDATA[ call cclutAssertI4Equal(CURREF, "setup failure\
", 0, 1)]]></TEXT></LINE><LINE><NBR>1924</NBR><TEXT><![CDATA[ endif]]></TEXT></LINE><LINE><NBR>1925</NBR><TEXT><![CDATA[ if\
(testing::errorSetup)]]></TEXT></LINE><LINE><NBR>1926</NBR><TEXT><![CDATA[ set guaranteedError = "setup error"]]></TEXT><\
/LINE><LINE><NBR>1927</NBR><TEXT><![CDATA[ endif]]></TEXT></LINE><LINE><NBR>1928</NBR><TEXT><![CDATA[end ;;;setup]]></TEXT><\
/LINE><LINE><NBR>1929</NBR><TEXT><![CDATA[]]></TEXT></LINE><LINE><NBR>1930</NBR><TEXT><![CDATA[subroutine teardown (null)]]><\
/TEXT></LINE><LINE><NBR>1931</NBR><TEXT><![CDATA[ call cclutAssertI4Equal(CURREF, "teardown executed", 0, 0)]]></TEXT></LINE\
><LINE><NBR>1932</NBR><TEXT><![CDATA[ if (testing::failTeardown)]]></TEXT></LINE><LINE><NBR>1933</NBR><TEXT><![CDATA[ cal\
l cclutAssertI4Equal(CURREF, "teardown failure", 0, 1)]]></TEXT></LINE><LINE><NBR>1934</NBR><TEXT><![CDATA[ endif]]></TEXT><\
/LINE><LINE><NBR>1935</NBR><TEXT><![CDATA[ if (testing::errorTeardown)]]></TEXT></LINE><LINE><NBR>1936</NBR><TEXT><![CDATA[ \
set guaranteedError = "teardown error"]]></TEXT></LINE><LINE><NBR>1937</NBR><TEXT><![CDATA[ endif]]></TEXT></LINE><LINE><\
NBR>1938</NBR><TEXT><![CDATA[end ;;;setup]]></TEXT></LINE><LINE><NBR>1939</NBR><TEXT><![CDATA[]]></TEXT></LINE><LINE><NBR>194\
0</NBR><TEXT><![CDATA[subroutine testOne(null)]]></TEXT></LINE><LINE><NBR>1941</NBR><TEXT><![CDATA[ call cclutAssertI4Equal(\
CURREF, "testOne executed", 0, 0)]]></TEXT></LINE><LINE><NBR>1942</NBR><TEXT><![CDATA[ if (testing::failTest)]]></TEXT></LIN\
E><LINE><NBR>1943</NBR><TEXT><![CDATA[ call cclutAssertI4Equal(CURREF, "testOne failure", 0, 1)]]></TEXT></LINE><LINE><NBR\
>1944</NBR><TEXT><![CDATA[ endif]]></TEXT></LINE><LINE><NBR>1945</NBR><TEXT><![CDATA[ if (testing::errorTest)]]></TEXT></LI\
NE><LINE><NBR>1946</NBR><TEXT><![CDATA[ set guaranteedError = "testOne error"]]></TEXT></LINE><LINE><NBR>1947</NBR><TEXT><\
![CDATA[ endif]]></TEXT></LINE><LINE><NBR>1948</NBR><TEXT><![CDATA[end ;;;testOne]]></TEXT></LINE><LINE><NBR>1949</NBR><TEXT\
><![CDATA[]]></TEXT></LINE><LINE><NBR>1950</NBR><TEXT><![CDATA[subroutine testTwo(null)]]></TEXT></LINE><LINE><NBR>1951</NBR>\
<TEXT><![CDATA[ call cclutAssertI4Equal(CURREF, "testTwo executed", 0, 0)]]></TEXT></LINE><LINE><NBR>1952</NBR><TEXT><![CDAT\
A[ call cclutAssertVCEqual(CURREF, "testTwo executed", "A", "A")]]></TEXT></LINE><LINE><NBR>1953</NBR><TEXT><![CDATA[end ;;;\
testTwo]]></TEXT></LINE><LINE><NBR>1954</NBR><TEXT><![CDATA[]]></TEXT></LINE><LINE><NBR>1955</NBR><TEXT><![CDATA[;; like test\
One, but two failures and two errors and errors come before failures when both are specified.]]></TEXT></LINE><LINE><NBR>1956\
</NBR><TEXT><![CDATA[subroutine testThree(null)]]></TEXT></LINE><LINE><NBR>1957</NBR><TEXT><![CDATA[ call cclutAssertI4Equal\
(CURREF, "testThree executed", 0, 0)]]></TEXT></LINE><LINE><NBR>1958</NBR><TEXT><![CDATA[ if (testing::errorTest)]]></TEXT><\
/LINE><LINE><NBR>1959</NBR><TEXT><![CDATA[ set guaranteedError = "testThree error"]]></TEXT></LINE><LINE><NBR>1960</NBR><T\
EXT><![CDATA[ set guaranteedError = "testThree error 2"]]></TEXT></LINE><LINE><NBR>1961</NBR><TEXT><![CDATA[ endif]]></TE\
XT></LINE><LINE><NBR>1962</NBR><TEXT><![CDATA[ if (testing::failTest)]]></TEXT></LINE><LINE><NBR>1963</NBR><TEXT><![CDATA[ \
call cclutAssertI4Equal(CURREF, "testThree failure A", 0, 1)]]></TEXT></LINE><LINE><NBR>1964</NBR><TEXT><![CDATA[ call c\
clutAssertI4Equal(CURREF, "testThree failure B", 0, 1)]]></TEXT></LINE><LINE><NBR>1965</NBR><TEXT><![CDATA[ endif]]></TEXT><\
/LINE><LINE><NBR>1966</NBR><TEXT><![CDATA[end ;;;testThree]]></TEXT></LINE></LINES></LISTING>~, xml)
end ;;;validateListingXml
/**
Validates that a resultsXml matches the expected results. The behavior of this function depends on the contents
of the ut_cclut_suo_su_td_tdo.inc file so this function must be updated whenever that test case file is modified.
*/
subroutine validateResultsXml(xml, legacyFormat)
declare foundInd = i2 with protect, noconstant(FALSE)
declare testCaseName = vc with protect, noconstant("")
declare xmlTests = vc with protect, noconstant("")
declare xmlTest = vc with protect, noconstant("")
declare testName = vc with protect, noconstant("")
declare xmlAsserts = vc with protect, noconstant("")
declare xmlAssert = vc with protect, noconstant("")
declare lineNbr = vc with protect, noconstant("")
declare assertContext = vc with protect, noconstant("")
declare condition = vc with protect, noconstant("")
declare result = vc with protect, noconstant("")
declare xmlErrors = vc with protect, noconstant("")
declare nextTestStart = i4 with protect, noconstant(0)
declare nextAssertStart = i4 with protect, noconstant(0)
call cclutAssertStartsWith(CURREF, "validate resultsXml", "<TESTCASE>", xml)
call cclutAssertEndsWith(CURREF, "validate resultsXml", "</TESTCASE>", xml)
set testCaseName = cclut::retrieveXmlContent(xml, "name", 1, foundInd)
call cclutAssertI4Equal(CURREF, "validate test case name found", foundInd, TRUE)
call cclutAssertVCEqual(CURREF, "validate test case", testCaseName, "ut_cclut_suo_su_td_tdo")
set xmlTests = cclut::retrieveXmlContent(xml, "tests", 1, foundInd)
call cclutAssertI4Equal(CURREF, "validate xmlTests found", foundInd, TRUE)
set xmlTest = cclut::retrieveXmlContent(xmlTests, "test", 1, foundInd)
call cclutAssertI4Equal(CURREF, "validate xmlTest found 1", foundInd, TRUE)
set testName = cclut::retrieveXmlContent(xmlTest, "name", 1, foundInd)
call cclutAssertI4Equal(CURREF, "validate test name found 1", foundInd, TRUE)
call cclutAssertVCEqual(CURREF, "validate test name 1", testName, "SETUPONCE")
set xmlAsserts = cclut::retrieveXmlContent(xmlTest, "asserts", 1, foundInd)
set xmlAssert = cclut::retrieveXmlContent(xmlAsserts, "assert", 1, foundInd)
call cclutAssertI4Equal(CURREF, "validate assert found 1.1", foundInd, TRUE)
set lineNbr = cclut::retrieveXmlContent(xmlAssert, "lineNumber", 1, foundInd)
call cclutAssertI4Equal(CURREF, "validate line number found 1.1", foundInd, TRUE)
call cclutAssertVCEqual(CURREF, "validate line number 1.1", lineNbr, "1901")
set assertContext = cclut::retrieveXmlContent(xmlAssert, "context", 1, foundInd)
call cclutAssertI4Equal(CURREF, "validate assert context found 1.1", foundInd, TRUE)
call cclutAssertVCEqual(CURREF, "validate assert context 1.1", assertContext, "setupOnce executed")
if (legacyFormat = TRUE)
set condition = cclut::retrieveXmlContent(xmlAssert, "test", 1, foundInd)
else
set condition = cclut::retrieveXmlContent(xmlAssert, "condition", 1, foundInd)
endif
call cclutAssertI4Equal(CURREF, "validate condition found 1.1", foundInd, TRUE)
call cclutAssertVCEqual(CURREF, "validate condition 1.1", condition, ~"SO"="SO"~)
set result = cclut::retrieveXmlContent(xmlAssert, "result", 1, foundInd)
call cclutAssertI4Equal(CURREF, "validate result found 1.1", foundInd, TRUE)
call cclutAssertVCEqual(CURREF, "validate result 1.1", result, "PASSED")
set xmlAssert = cclut::retrieveXmlContent(xmlAsserts, "assert", 17+textlen(xmlAssert) , foundInd) ;textlen(<ASSERT></ASSERT>) = 17
call cclutAssertI4Equal(CURREF, "validate no more asserts 1", foundInd, FALSE)
set xmlErrors = cclut::retrieveXmlContent(xmlTest, "errors", 1, foundInd)
call cclutAssertI4Equal(CURREF, "validate error list found 1", foundInd, TRUE)
call cclutAssertVCEqual(CURREF, "validate no errors 1", xmlErrors, "")
set nextTestStart = 13 + textlen(xmlTest) ;textlen(<TEST></TEST>) = 13
set xmlTest = cclut::retrieveXmlContent(xmlTests, "test", nextTestStart, foundInd)
call cclutAssertI4Equal(CURREF, "validate xmlTest found 2", foundInd, TRUE)
set testName = cclut::retrieveXmlContent(xmlTest, "name", 1, foundInd)
call cclutAssertI4Equal(CURREF, "validate test name found 2", foundInd, TRUE)
call cclutAssertVCEqual(CURREF, "validate test name 2", testName, "TESTONE")
set xmlAsserts = cclut::retrieveXmlContent(xmlTest, "asserts", 1, foundInd)
set xmlAssert = cclut::retrieveXmlContent(xmlAsserts, "assert", 1, foundInd)
call cclutAssertI4Equal(CURREF, "validate assert found 2.1", foundInd, TRUE)
set lineNbr = cclut::retrieveXmlContent(xmlAssert, "lineNumber", 1, foundInd)
call cclutAssertI4Equal(CURREF, "validate line number found 2.1", foundInd, TRUE)
call cclutAssertVCEqual(CURREF, "validate line number 2.1", lineNbr, "1921")
set assertContext = cclut::retrieveXmlContent(xmlAssert, "context", 1, foundInd)
call cclutAssertI4Equal(CURREF, "validate assert context found 2.1", foundInd, TRUE)
call cclutAssertVCEqual(CURREF, "validate assert context 2.1", assertContext, "setup executed")
if (legacyFormat = TRUE)
set condition = cclut::retrieveXmlContent(xmlAssert, "test", 1, foundInd)
else
set condition = cclut::retrieveXmlContent(xmlAssert, "condition", 1, foundInd)
endif
call cclutAssertI4Equal(CURREF, "validate condition found 2.1", foundInd, TRUE)
call cclutAssertVCEqual(CURREF, "validate condition 2.1", condition, ~0=0~)
set result = cclut::retrieveXmlContent(xmlAssert, "result", 1, foundInd)
call cclutAssertI4Equal(CURREF, "validate result found 2.1", foundInd, TRUE)
call cclutAssertVCEqual(CURREF, "validate result 2.1", result, "PASSED")
set nextAssertStart = 17 + textlen(xmlAssert) ;textlen(<ASSERT></ASSERT>) = 17
set xmlAssert = cclut::retrieveXmlContent(xmlAsserts, "assert", nextAssertStart, foundInd)
call cclutAssertI4Equal(CURREF, "validate assert found 2.2", foundInd, TRUE)
set lineNbr = cclut::retrieveXmlContent(xmlAssert, "lineNumber", 1, foundInd)
call cclutAssertI4Equal(CURREF, "validate line number found 2.2", foundInd, TRUE)
call cclutAssertVCEqual(CURREF, "validate line number 2.2", lineNbr, "1941")
set assertContext = cclut::retrieveXmlContent(xmlAssert, "context", 1, foundInd)
call cclutAssertI4Equal(CURREF, "validate assert context found 2.2", foundInd, TRUE)
call cclutAssertVCEqual(CURREF, "validate assert context 2.2", assertContext, "testOne executed")
if (legacyFormat = TRUE)
set condition = cclut::retrieveXmlContent(xmlAssert, "test", 1, foundInd)
else
set condition = cclut::retrieveXmlContent(xmlAssert, "condition", 1, foundInd)
endif
call cclutAssertI4Equal(CURREF, "validate condition found 2.2", foundInd, TRUE)
call cclutAssertVCEqual(CURREF, "validate condition 2.2", condition, ~0=0~)
set result = cclut::retrieveXmlContent(xmlAssert, "result", 1, foundInd)
call cclutAssertI4Equal(CURREF, "validate result found 2.2", foundInd, TRUE)
call cclutAssertVCEqual(CURREF, "validate result 2.2", result, "PASSED")
set nextAssertStart = nextAssertStart + 17 + textlen(xmlAssert)
set xmlAssert = cclut::retrieveXmlContent(xmlAsserts, "assert", nextAssertStart, foundInd)
call cclutAssertI4Equal(CURREF, "validate assert found 2.3", foundInd, TRUE)
set lineNbr = cclut::retrieveXmlContent(xmlAssert, "lineNumber", 1, foundInd)
call cclutAssertI4Equal(CURREF, "validate line number found 2.3", foundInd, TRUE)
call cclutAssertVCEqual(CURREF, "validate line number 2.3", lineNbr, "1931")
set assertContext = cclut::retrieveXmlContent(xmlAssert, "context", 1, foundInd)
call cclutAssertI4Equal(CURREF, "validate assert context found 2.3", foundInd, TRUE)
call cclutAssertVCEqual(CURREF, "validate assert context 2.3", assertContext, "teardown executed")
if (legacyFormat = TRUE)
set condition = cclut::retrieveXmlContent(xmlAssert, "test", 1, foundInd)
else
set condition = cclut::retrieveXmlContent(xmlAssert, "condition", 1, foundInd)
endif
call cclutAssertI4Equal(CURREF, "validate condition found 2.3", foundInd, TRUE)
call cclutAssertVCEqual(CURREF, "validate condition 2.3", condition, ~0=0~)
set result = cclut::retrieveXmlContent(xmlAssert, "result", 1, foundInd)
call cclutAssertI4Equal(CURREF, "validate result found 2.3", foundInd, TRUE)
call cclutAssertVCEqual(CURREF, "validate result 2.3", result, "PASSED")
set nextAssertStart = nextAssertStart + 17 + textlen(xmlAssert)
set xmlAssert = cclut::retrieveXmlContent(xmlAsserts, "assert", nextAssertStart, foundInd)
call cclutAssertI4Equal(CURREF, "validate no more asserts 2", foundInd, FALSE)
set xmlErrors = cclut::retrieveXmlContent(xmlTest, "errors", 2, foundInd)
call cclutAssertI4Equal(CURREF, "validate error list found 2", foundInd, TRUE)
call cclutAssertVCEqual(CURREF, "validate no errors 2", xmlErrors, "")
;testTwo and testThree are similar
set nextTestStart = nextTestStart + 13 + textlen(xmlTest)
set xmlTest = cclut::retrieveXmlContent(xmlTests, "test", nextTestStart, foundInd)
call cclutAssertI4Equal(CURREF, "validate xmlTest found 3", foundInd, TRUE)
set testName = cclut::retrieveXmlContent(xmlTest, "name", 1, foundInd)
call cclutAssertI4Equal(CURREF, "validate test name found 3", foundInd, TRUE)
call cclutAssertVCEqual(CURREF, "validate test name 3", testName, "TESTTWO")
set nextTestStart = nextTestStart + 13 + textlen(xmlTest)
set xmlTest = cclut::retrieveXmlContent(xmlTests, "test", nextTestStart, foundInd)
call cclutAssertI4Equal(CURREF, "validate xmlTest found 4", foundInd, TRUE)
set testName = cclut::retrieveXmlContent(xmlTest, "name", 1, foundInd)
call cclutAssertI4Equal(CURREF, "validate test name found 4", foundInd, TRUE)
call cclutAssertVCEqual(CURREF, "validate test name 4", testName, "TESTTHREE")
set nextTestStart = nextTestStart + 13 + textlen(xmlTest)
set xmlTest = cclut::retrieveXmlContent(xmlTests, "test", nextTestStart, foundInd)
call cclutAssertI4Equal(CURREF, "validate xmlTest found 5", foundInd, TRUE)
set testName = cclut::retrieveXmlContent(xmlTest, "name", 1, foundInd)
call cclutAssertI4Equal(CURREF, "validate test name found 5", foundInd, TRUE)
call cclutAssertVCEqual(CURREF, "validate test name 5", testName, "TEARDOWNONCE")
set xmlAsserts = cclut::retrieveXmlContent(xmlTest, "asserts", 1, foundInd)
set xmlAssert = cclut::retrieveXmlContent(xmlAsserts, "assert", 1, foundInd)
call cclutAssertI4Equal(CURREF, "validate assert found 5.1", foundInd, TRUE)
set lineNbr = cclut::retrieveXmlContent(xmlAssert, "lineNumber", 1, foundInd)
call cclutAssertI4Equal(CURREF, "validate line number found 5.1", foundInd, TRUE)
call cclutAssertVCEqual(CURREF, "validate line number 5.1", lineNbr, "1911")
set assertContext = cclut::retrieveXmlContent(xmlAssert, "context", 1, foundInd)
call cclutAssertI4Equal(CURREF, "validate assert context found 5.1", foundInd, TRUE)
call cclutAssertVCEqual(CURREF, "validate assert context 5.1", assertContext, "teardownOnce executed")
if (legacyFormat = TRUE)
set condition = cclut::retrieveXmlContent(xmlAssert, "test", 1, foundInd)
else
set condition = cclut::retrieveXmlContent(xmlAssert, "condition", 1, foundInd)
endif
call cclutAssertI4Equal(CURREF, "validate condition found 5.1", foundInd, TRUE)
call cclutAssertVCEqual(CURREF, "validate condition 5.1", condition, ~"TO"="TO"~)
set result = cclut::retrieveXmlContent(xmlAssert, "result", 1, foundInd)
call cclutAssertI4Equal(CURREF, "validate result found 5.1", foundInd, TRUE)
call cclutAssertVCEqual(CURREF, "validate result 5.1", result, "PASSED")
set xmlAssert = cclut::retrieveXmlContent(xmlAsserts, "assert", 17+textlen(xmlAssert) , foundInd)
call cclutAssertI4Equal(CURREF, "validate no more asserts 5", foundInd, FALSE)
set xmlErrors = cclut::retrieveXmlContent(xmlTest, "errors", 1, foundInd)
call cclutAssertI4Equal(CURREF, "validate error list found 5", foundInd, TRUE)
call cclutAssertVCEqual(CURREF, "validate no errors 5", xmlErrors, "")
set nextTestStart = nextTestStart + 13 + textlen(xmlTest)
set xmlTest = cclut::retrieveXmlContent(xmlTests, "test", nextTestStart, foundInd)
call cclutAssertI4Equal(CURREF, "validate no more tests", foundInd, FALSE)
end ;;;validateResultsXml
/**
Validates that a coverageXml matches the expected coverage. Note that the behavior of this function depends on the content
of this file so this function must be updated whenever this test case file is modified.
*/
subroutine validateCoverageXml(coverage)
return(null)
call cclutAssertVCEqual(CURREF, "validate coverageXml", coverage,
~<COVERAGE><COVERAGE_NAME>UT_CCLUT_SUO_SU_TD_TDO</COVERAGE_NAME><LINES><LINE><NBR>787</NBR><TYPE>N</TYPE></LINE><LINE><NBR>78\
8</NBR><TYPE>N</TYPE></LINE><LINE><NBR>789</NBR><TYPE>N</TYPE></LINE><LINE><NBR>790</NBR><TYPE>N</TYPE></LINE><LINE><NBR>791<\
/NBR><TYPE>N</TYPE></LINE><LINE><NBR>792</NBR><TYPE>N</TYPE></LINE><LINE><NBR>793</NBR><TYPE>N</TYPE></LINE><LINE><NBR>794</N\
BR><TYPE>C</TYPE></LINE><LINE><NBR>795</NBR><TYPE>N</TYPE></LINE><LINE><NBR>796</NBR><TYPE>C</TYPE></LINE><LINE><NBR>797</NBR\
><TYPE>U</TYPE></LINE><LINE><NBR>798</NBR><TYPE>N</TYPE></LINE><LINE><NBR>799</NBR><TYPE>N</TYPE></LINE><LINE><NBR>800</NBR><\
TYPE>N</TYPE></LINE><LINE><NBR>801</NBR><TYPE>C</TYPE></LINE><LINE><NBR>802</NBR><TYPE>C</TYPE></LINE><LINE><NBR>803</NBR><TY\
PE>U</TYPE></LINE><LINE><NBR>804</NBR><TYPE>N</TYPE></LINE><LINE><NBR>805</NBR><TYPE>C</TYPE></LINE><LINE><NBR>806</NBR><TYPE\
>U</TYPE></LINE><LINE><NBR>807</NBR><TYPE>N</TYPE></LINE><LINE><NBR>808</NBR><TYPE>N</TYPE></LINE><LINE><NBR>809</NBR><TYPE>N\
</TYPE></LINE><LINE><NBR>810</NBR><TYPE>N</TYPE></LINE><LINE><NBR>811</NBR><TYPE>C</TYPE></LINE><LINE><NBR>812</NBR><TYPE>C</\
TYPE></LINE><LINE><NBR>813</NBR><TYPE>U</TYPE></LINE><LINE><NBR>814</NBR><TYPE>N</TYPE></LINE><LINE><NBR>815</NBR><TYPE>C</TY\
PE></LINE><LINE><NBR>816</NBR><TYPE>U</TYPE></LINE><LINE><NBR>817</NBR><TYPE>N</TYPE></LINE><LINE><NBR>818</NBR><TYPE>N</TYPE\
></LINE><LINE><NBR>819</NBR><TYPE>N</TYPE></LINE><LINE><NBR>820</NBR><TYPE>N</TYPE></LINE><LINE><NBR>821</NBR><TYPE>C</TYPE><\
/LINE><LINE><NBR>822</NBR><TYPE>C</TYPE></LINE><LINE><NBR>823</NBR><TYPE>U</TYPE></LINE><LINE><NBR>824</NBR><TYPE>N</TYPE></L\
INE><LINE><NBR>825</NBR><TYPE>C</TYPE></LINE><LINE><NBR>826</NBR><TYPE>U</TYPE></LINE><LINE><NBR>827</NBR><TYPE>N</TYPE></LIN\
E><LINE><NBR>828</NBR><TYPE>N</TYPE></LINE><LINE><NBR>829</NBR><TYPE>N</TYPE></LINE><LINE><NBR>830</NBR><TYPE>N</TYPE></LINE>\
<LINE><NBR>831</NBR><TYPE>C</TYPE></LINE><LINE><NBR>832</NBR><TYPE>C</TYPE></LINE><LINE><NBR>833</NBR><TYPE>U</TYPE></LINE><L\
INE><NBR>834</NBR><TYPE>N</TYPE></LINE><LINE><NBR>835</NBR><TYPE>C</TYPE></LINE><LINE><NBR>836</NBR><TYPE>U</TYPE></LINE><LIN\
E><NBR>837</NBR><TYPE>N</TYPE></LINE><LINE><NBR>838</NBR><TYPE>N</TYPE></LINE><LINE><NBR>839</NBR><TYPE>N</TYPE></LINE><LINE>\
<NBR>840</NBR><TYPE>N</TYPE></LINE><LINE><NBR>841</NBR><TYPE>C</TYPE></LINE><LINE><NBR>842</NBR><TYPE>C</TYPE></LINE><LINE><N\
BR>843</NBR><TYPE>U</TYPE></LINE><LINE><NBR>844</NBR><TYPE>N</TYPE></LINE><LINE><NBR>845</NBR><TYPE>C</TYPE></LINE><LINE><NBR\
>846</NBR><TYPE>U</TYPE></LINE><LINE><NBR>847</NBR><TYPE>N</TYPE></LINE><LINE><NBR>848</NBR><TYPE>N</TYPE></LINE><LINE><NBR>8\
49</NBR><TYPE>N</TYPE></LINE><LINE><NBR>850</NBR><TYPE>N</TYPE></LINE><LINE><NBR>851</NBR><TYPE>C</TYPE></LINE><LINE><NBR>852\
</NBR><TYPE>C</TYPE></LINE><LINE><NBR>853</NBR><TYPE>N</TYPE></LINE><LINE><NBR>854</NBR><TYPE>N</TYPE></LINE><LINE><NBR>855</\
NBR><TYPE>N</TYPE></LINE><LINE><NBR>856</NBR><TYPE>C</TYPE></LINE><LINE><NBR>857</NBR><TYPE>C</TYPE></LINE><LINE><NBR>858</NB\
R><TYPE>U</TYPE></LINE><LINE><NBR>859</NBR><TYPE>U</TYPE></LINE><LINE><NBR>860</NBR><TYPE>N</TYPE></LINE><LINE><NBR>861</NBR>\
<TYPE>C</TYPE></LINE><LINE><NBR>862</NBR><TYPE>U</TYPE></LINE><LINE><NBR>863</NBR><TYPE>U</TYPE></LINE><LINE><NBR>864</NBR><T\
YPE>N</TYPE></LINE><LINE><NBR>865</NBR><TYPE>N</TYPE></LINE></LINES></COVERAGE>~)
end ;;;validateCoverageXml
/**
Helper function for validating the common response values of the multiple "no issues" tests
*/
subroutine validateNoIssuesResponse(response)
declare testCount = i4 with protect, noconstant(0)
call cclutAssertI2Equal(CURREF, "test case success", response->resultInd, TRUE)
set testCount = size(response->tests, 5)
call cclutAssertI4Equal(CURREF, "test count", testCount, 5)
call cclutAssertI4Equal(CURREF, "assert count", size(response->tests[1].asserts, 5), 1)
call cclutAssertI4Equal(CURREF, "error count", size(response->tests[1].errors, 5), 0)
call cclutAssertVCEqual(CURREF, "assert context",
response->tests[1].asserts[1].context, "setupOnce executed")
call cclutAssertVCEqual(CURREF, "assert condition", response->tests[1].asserts[1].condition, '"SO"="SO"')
call cclutAssertI4Equal(CURREF, "assert value",
response->tests[1].asserts[1].resultInd, TRUE)
call cclutAssertI4Equal(CURREF, "assert count", size(response->tests[2].asserts, 5), 3)
call cclutAssertI4Equal(CURREF, "error count", size(response->tests[2].errors, 5), 0)
call cclutAssertVCEqual(CURREF, "assert context", response->tests[2].asserts[1].context, "setup executed")
call cclutAssertVCEqual(CURREF, "assert condition", response->tests[2].asserts[1].condition, "0=0")
call cclutAssertI4Equal(CURREF, "assert status", response->tests[2].asserts[1].resultInd, TRUE)
call cclutAssertVCEqual(CURREF, "assert context", response->tests[2].asserts[2].context, "testOne executed")
call cclutAssertVCEqual(CURREF, "assert condition", response->tests[2].asserts[2].condition, "0=0")
call cclutAssertI4Equal(CURREF, "assert status", response->tests[2].asserts[2].resultInd, TRUE)
call cclutAssertVCEqual(CURREF, "assert context", response->tests[2].asserts[3].context, "teardown executed")
call cclutAssertVCEqual(CURREF, "assert condition", response->tests[2].asserts[3].condition, "0=0")
call cclutAssertI4Equal(CURREF, "assert status", response->tests[2].asserts[3].resultInd, TRUE)
call cclutAssertI4Equal(CURREF, "assert count", size(response->tests[3].asserts, 5), 4)
call cclutAssertI4Equal(CURREF, "error count", size(response->tests[3].errors, 5), 0)
call cclutAssertVCEqual(CURREF, "assert context", response->tests[3].asserts[1].context, "setup executed")
call cclutAssertVCEqual(CURREF, "assert condition", response->tests[3].asserts[1].condition, "0=0")
call cclutAssertI4Equal(CURREF, "assert status", response->tests[3].asserts[1].resultInd, TRUE)
call cclutAssertVCEqual(CURREF, "assert context", response->tests[3].asserts[2].context, "testTwo executed")
call cclutAssertVCEqual(CURREF, "assert condition", response->tests[3].asserts[2].condition, "0=0")
call cclutAssertI4Equal(CURREF, "assert status", response->tests[3].asserts[2].resultInd, TRUE)
call cclutAssertVCEqual(CURREF, "assert context", response->tests[3].asserts[3].context, "testTwo executed")
call cclutAssertVCEqual(CURREF, "assert condition", response->tests[3].asserts[3].condition, '"A"="A"')
call cclutAssertI4Equal(CURREF, "assert status", response->tests[3].asserts[3].resultInd, TRUE)
call cclutAssertVCEqual(CURREF, "assert context", response->tests[3].asserts[4].context, "teardown executed")
call cclutAssertVCEqual(CURREF, "assert condition", response->tests[3].asserts[4].condition, "0=0")
call cclutAssertI4Equal(CURREF, "assert status", response->tests[3].asserts[4].resultInd, TRUE)
call cclutAssertI4Equal(CURREF, "assert count", size(response->tests[4].asserts, 5), 3)
call cclutAssertI4Equal(CURREF, "error count", size(response->tests[4].errors, 5), 0)
call cclutAssertVCEqual(CURREF, "assert context", response->tests[4].asserts[1].context, "setup executed")
call cclutAssertVCEqual(CURREF, "assert condition", response->tests[4].asserts[1].condition, "0=0")
call cclutAssertI4Equal(CURREF, "assert status", response->tests[4].asserts[1].resultInd, TRUE)
call cclutAssertVCEqual(CURREF, "assert context", response->tests[4].asserts[2].context, "testThree executed")
call cclutAssertVCEqual(CURREF, "assert condition", response->tests[4].asserts[2].condition, "0=0")
call cclutAssertI4Equal(CURREF, "assert status", response->tests[4].asserts[2].resultInd, TRUE)
call cclutAssertVCEqual(CURREF, "assert context", response->tests[4].asserts[3].context, "teardown executed")
call cclutAssertVCEqual(CURREF, "assert condition", response->tests[4].asserts[3].condition, "0=0")
call cclutAssertI4Equal(CURREF, "assert status", response->tests[4].asserts[3].resultInd, TRUE)
call cclutAssertI4Equal(CURREF, "assert count", size(response->tests[5].asserts, 5), 1)
call cclutAssertI4Equal(CURREF, "error count", size(response->tests[5].errors, 5), 0)
call cclutAssertVCEqual(CURREF, "assert context",
response->tests[5].asserts[1].context, "teardownOnce executed")
call cclutAssertVCEqual(CURREF, "assert condition", response->tests[5].asserts[1].condition, '"TO"="TO"')
call cclutAssertI4Equal(CURREF, "assert value",
response->tests[5].asserts[1].resultInd, TRUE)
end ;;;validateNoIssuesResponse
/**
Run ut_cclut_suo_su_td_tdo and validate the results when no issues occur.
*/
subroutine testNoIssues(null)
declare stat = i4 with protect, noconstant(0)
set stat = copyRec(ucets_request, ucets_request1, 1)
call cclutAssertI4Equal(CURREF, "validate copyRec", stat, TRUE)
if (validate(cclut_request) = TRUE)
;to capture code coverage if running from maven
set stat = moverec(cclut_request->programs, ucets_request1->programs)
if (size(cclut_request->programs, 5) > 0)
set cclut_request->programs[1].compile = TRUE
endif
endif
set ucets_request1->enforcePredeclare = TRUE
execute cclut_execute_test_case_file with
replace("CCLUTREQUEST", ucets_request1),
replace("CCLUTREPLY", ucets_reply),
replace("CCLUTTESTCASERESULTS", ucets_testCaseResults)
call cclutAssertVCEqual(CURREF, "execute success 1", ucets_reply->status_data.status, "S")
call validateNoIssuesResponse(ucets_testCaseResults)
call validateEnvironmentXml(ucets_reply->environmentXml)
call validateListingXml(ucets_reply->listingXml)
call validateResultsXml(ucets_reply->resultsXml, FALSE)
call validateCoverageXml(ucets_reply->coverageXml)
end ;;;testNoIssues
/**
Run ut_cclut_suo_su_td_tdo and validate the results when no issues occur with legacy format requested.
*/
subroutine testNoIssuesLegacy(null)
declare stat = i4 with protect, noconstant(0)
set stat = copyRec(ucets_request, ucets_request1, 1)
call cclutAssertI4Equal(CURREF, "validate copyRec", stat, TRUE)
if (validate(cclut_request) = TRUE)
;to capture code coverage if running from maven
set stat = moverec(cclut_request->programs, ucets_request1->programs)
endif
set ucets_request1->legacyResultsFormat = TRUE
execute cclut_execute_test_case_file with
replace("CCLUTREQUEST", ucets_request1),
replace("CCLUTREPLY", ucets_reply),
replace("CCLUTTESTCASERESULTS", ucets_testCaseResults)
call cclutAssertVCEqual(CURREF, "execute success 1", ucets_reply->status_data.status, "S")
call validateNoIssuesResponse(ucets_testCaseResults)
call validateEnvironmentXml(ucets_reply->environmentXml)
call validateListingXml(ucets_reply->listingXml)
call validateResultsXml(ucets_reply->resultsXml, TRUE)
call validateCoverageXml(ucets_reply->coverageXml)
end ;;;testNoIssuesLegacy
/**
Run ut_cclut_suo_su_td_tdo and validate the results with optimizer mode CBO when no issues occur.
*/
subroutine testNoIssuesCBO(null)
declare stat = i4 with protect, noconstant(0)
set stat = copyRec(ucets_request, ucets_request1, 1)
call cclutAssertI4Equal(CURREF, "validate copyRec", stat, TRUE)
set ucets_request1->optimizerMode = "CBO"
execute cclut_execute_test_case_file with
replace("CCLUTREQUEST", ucets_request1),
replace("CCLUTREPLY", ucets_reply),
replace("CCLUTTESTCASERESULTS", ucets_testCaseResults)
call cclutAssertVCEqual(CURREF, "execute success 1", ucets_reply->status_data.status, "S")
call validateNoIssuesResponse(ucets_testCaseResults)
end ;;;testNoIssuesCBO
/**
Run ut_cclut_suo_su_td_tdo and validate the results with optimizer mode RBO when no issues occur.
*/
subroutine testNoIssuesRBO(null)
declare stat = i4 with protect, noconstant(0)
set stat = copyRec(ucets_request, ucets_request1, 1)
call cclutAssertI4Equal(CURREF, "validate copyRec", stat, TRUE)
set ucets_request1->optimizerMode = "RBO"
execute cclut_execute_test_case_file with
replace("CCLUTREQUEST", ucets_request1),
replace("CCLUTREPLY", ucets_reply),
replace("CCLUTTESTCASERESULTS", ucets_testCaseResults)
call cclutAssertVCEqual(CURREF, "execute success 1", ucets_reply->status_data.status, "S")
call validateNoIssuesResponse(ucets_testCaseResults)
end ;;;testNoIssuesRBO
/**
Run ut_cclut_suo_su_td_tdo and validate the results with an invalid optimizer mode when no issues occur.
*/
subroutine testNoIssuesInvalidOM(null)
declare stat = i4 with protect, noconstant(0)
set stat = copyRec(ucets_request, ucets_request1, 1)
call cclutAssertI4Equal(CURREF, "validate copyRec", stat, TRUE)
set ucets_request1->optimizerMode = "invalid"
execute cclut_execute_test_case_file with
replace("CCLUTREQUEST", ucets_request1),
replace("CCLUTREPLY", ucets_reply),
replace("CCLUTTESTCASERESULTS", ucets_testCaseResults)
call cclutAssertVCEqual(CURREF, "execute success 1", ucets_reply->status_data.status, "F")
call cclutAssertVCEqual(CURREF, "execute success 5",
ucets_reply->status_data.subeventstatus[1].targetObjectValue, "Invalid optimizer mode specified.")
end ;;;testNoIssuesInvalidOM
/**
Run ut_cclut_suo_su_td_tdo and validate the results when all subroutines produce an error.
*/
subroutine testErrorsEverywhere(null)
declare testCount = i4 with protect, noconstant(0)
declare errorIdx = i4 with protect, noconstant(0)
set testing::errorSetupOnce = TRUE
set testing::errorSetup = TRUE
set testing::errorTest = TRUE
set testing::errorTeardown = TRUE
set testing::errorTeardownOnce = TRUE
execute cclut_execute_test_case_file with
replace("CCLUTREQUEST", ucets_request),
replace("CCLUTREPLY", ucets_reply),
replace("CCLUTTESTCASERESULTS", ucets_testCaseResults)
call cclutAssertVCEqual(CURREF, "execute success 1", ucets_reply->status_data.status, "S")
call cclutAssertI2Equal(CURREF, "test case failure", ucets_testCaseResults->resultInd, FALSE)
set testCount = size(ucets_testCaseResults->tests, 5)
call cclutAssertI4Equal(CURREF, "test count", testCount, 5)
call cclutAssertI4Equal(CURREF, "assert count", size(ucets_testCaseResults->tests[1].asserts, 5), 1)
call cclutAssertI4Equal(CURREF, "error count", size(ucets_testCaseResults->tests[1].errors, 5), 1)
call cclutAssertVCEqual(CURREF, "assert context",
ucets_testCaseResults->tests[1].asserts[1].context, "setupOnce executed")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[1].asserts[1].condition, '"SO"="SO"')
call cclutAssertI4Equal(CURREF, "assert value",
ucets_testCaseResults->tests[1].asserts[1].resultInd, TRUE)
call cclutAssertStartsWith(CURREF, "errorText", "%CCL-E-94-PRG_", ucets_testCaseResults->tests[1].errors[1].errorText)
call cclutAssertContains(CURREF, "errorText",
"{GUARANTEEDERROR}Assignment of Report expression (GUARANTEEDERROR) to incompatible type.",
ucets_testCaseResults->tests[1].errors[1].errorText)
call cclutAssertI4Equal(CURREF, "assert count", size(ucets_testCaseResults->tests[2].asserts, 5), 3)
call cclutAssertI4Equal(CURREF, "error count", size(ucets_testCaseResults->tests[2].errors, 5), 3)
call cclutAssertVCEqual(CURREF, "assert context", ucets_testCaseResults->tests[2].asserts[1].context, "setup executed")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[2].asserts[1].condition, "0=0")
call cclutAssertI4Equal(CURREF, "assert status", ucets_testCaseResults->tests[2].asserts[1].resultInd, TRUE)
call cclutAssertVCEqual(CURREF, "assert context", ucets_testCaseResults->tests[2].asserts[2].context, "testOne executed")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[2].asserts[2].condition, "0=0")
call cclutAssertI4Equal(CURREF, "assert status", ucets_testCaseResults->tests[2].asserts[2].resultInd, TRUE)
call cclutAssertVCEqual(CURREF, "assert context", ucets_testCaseResults->tests[2].asserts[3].context, "teardown executed")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[2].asserts[3].condition, "0=0")
call cclutAssertI4Equal(CURREF, "assert status", ucets_testCaseResults->tests[2].asserts[3].resultInd, TRUE)
for (errorIdx = 1 to 3)
call cclutAssertStartsWith(CURREF, "errorText",
"%CCL-E-94-PRG_", ucets_testCaseResults->tests[2].errors[errorIdx].errorText)
call cclutAssertContains(CURREF, "errorText",
"{GUARANTEEDERROR}Assignment of Report expression (GUARANTEEDERROR) to incompatible type.",
ucets_testCaseResults->tests[2].errors[errorIdx].errorText)
endfor
call cclutAssertI4Equal(CURREF, "assert count", size(ucets_testCaseResults->tests[3].asserts, 5), 4)
call cclutAssertI4Equal(CURREF, "error count", size(ucets_testCaseResults->tests[3].errors, 5), 2)
call cclutAssertVCEqual(CURREF, "assert context", ucets_testCaseResults->tests[3].asserts[1].context, "setup executed")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[3].asserts[1].condition, "0=0")
call cclutAssertI4Equal(CURREF, "assert status", ucets_testCaseResults->tests[3].asserts[1].resultInd, TRUE)
call cclutAssertVCEqual(CURREF, "assert context", ucets_testCaseResults->tests[3].asserts[2].context, "testTwo executed")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[3].asserts[2].condition, "0=0")
call cclutAssertI4Equal(CURREF, "assert status", ucets_testCaseResults->tests[3].asserts[2].resultInd, TRUE)
call cclutAssertVCEqual(CURREF, "assert context", ucets_testCaseResults->tests[3].asserts[3].context, "testTwo executed")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[3].asserts[3].condition, '"A"="A"')
call cclutAssertI4Equal(CURREF, "assert status", ucets_testCaseResults->tests[3].asserts[3].resultInd, TRUE)
call cclutAssertVCEqual(CURREF, "assert context", ucets_testCaseResults->tests[3].asserts[4].context, "teardown executed")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[3].asserts[4].condition, "0=0")
call cclutAssertI4Equal(CURREF, "assert status", ucets_testCaseResults->tests[3].asserts[4].resultInd, TRUE)
for (errorIdx = 1 to 2)
call cclutAssertStartsWith(CURREF, "errorText",
"%CCL-E-94-PRG_", ucets_testCaseResults->tests[3].errors[errorIdx].errorText)
call cclutAssertContains(CURREF, "errorText",
"{GUARANTEEDERROR}Assignment of Report expression (GUARANTEEDERROR) to incompatible type.",
ucets_testCaseResults->tests[3].errors[errorIdx].errorText)
endfor
call cclutAssertI4Equal(CURREF, "assert count", size(ucets_testCaseResults->tests[4].asserts, 5), 3)
call cclutAssertI4Equal(CURREF, "error count", size(ucets_testCaseResults->tests[4].errors, 5), 4)
call cclutAssertVCEqual(CURREF, "assert context", ucets_testCaseResults->tests[4].asserts[1].context, "setup executed")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[4].asserts[1].condition, "0=0")
call cclutAssertI4Equal(CURREF, "assert status", ucets_testCaseResults->tests[4].asserts[1].resultInd, TRUE)
call cclutAssertVCEqual(CURREF, "assert context", ucets_testCaseResults->tests[4].asserts[2].context, "testThree executed")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[4].asserts[2].condition, "0=0")
call cclutAssertI4Equal(CURREF, "assert status", ucets_testCaseResults->tests[4].asserts[2].resultInd, TRUE)
call cclutAssertVCEqual(CURREF, "assert context", ucets_testCaseResults->tests[4].asserts[3].context, "teardown executed")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[4].asserts[3].condition, "0=0")
call cclutAssertI4Equal(CURREF, "assert status", ucets_testCaseResults->tests[4].asserts[3].resultInd, TRUE)
for (errorIdx = 1 to 4)
call cclutAssertStartsWith(CURREF, "errorText",
"%CCL-E-94-PRG_", ucets_testCaseResults->tests[4].errors[errorIdx].errorText)
call cclutAssertContains(CURREF, "errorText",
"{GUARANTEEDERROR}Assignment of Report expression (GUARANTEEDERROR) to incompatible type.",
ucets_testCaseResults->tests[4].errors[errorIdx].errorText)
endfor
call cclutAssertI4Equal(CURREF, "assert count", size(ucets_testCaseResults->tests[5].asserts, 5), 1)
call cclutAssertI4Equal(CURREF, "error count", size(ucets_testCaseResults->tests[5].errors, 5), 1)
call cclutAssertVCEqual(CURREF, "assert context",
ucets_testCaseResults->tests[5].asserts[1].context, "teardownOnce executed")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[5].asserts[1].condition, '"TO"="TO"')
call cclutAssertI4Equal(CURREF, "assert value",
ucets_testCaseResults->tests[5].asserts[1].resultInd, TRUE)
call cclutAssertStartsWith(CURREF, "errorText", "%CCL-E-94-PRG_", ucets_testCaseResults->tests[4].errors[1].errorText)
call cclutAssertContains(CURREF, "errorText",
"{GUARANTEEDERROR}Assignment of Report expression (GUARANTEEDERROR) to incompatible type.",
ucets_testCaseResults->tests[4].errors[1].errorText)
end ;;;testErrorsEverywhere
/**
Run ut_cclut_suo_su_td_tdo and validate the results when all subroutines produce a failed assert and an error.
*/
subroutine testFailsAndErrorsEverywhere(null)
declare testCount = i4 with protect, noconstant(0)
declare errorIdx = i4 with protect, noconstant(0)
set testing::errorSetupOnce = TRUE
set testing::errorSetup = TRUE
set testing::errorTest = TRUE
set testing::errorTeardown = TRUE
set testing::errorTeardownOnce = TRUE
set testing::failSetupOnce = TRUE
set testing::failSetup = TRUE
set testing::failTest = TRUE
set testing::failTeardown = TRUE
set testing::failTeardownOnce = TRUE
execute cclut_execute_test_case_file with
replace("CCLUTREQUEST", ucets_request),
replace("CCLUTREPLY", ucets_reply),
replace("CCLUTTESTCASERESULTS", ucets_testCaseResults)
call cclutAssertVCEqual(CURREF, "execute success 1", ucets_reply->status_data.status, "S")
call cclutAssertI2Equal(CURREF, "test case failure", ucets_testCaseResults->resultInd, FALSE)
set testCount = size(ucets_testCaseResults->tests, 5)
call cclutAssertI4Equal(CURREF, "test count", testCount, 5)
call cclutAssertI4Equal(CURREF, "assert count", size(ucets_testCaseResults->tests[1].asserts, 5), 2)
call cclutAssertI4Equal(CURREF, "error count", size(ucets_testCaseResults->tests[1].errors, 5), 1)
call cclutAssertVCEqual(CURREF, "assert context",
ucets_testCaseResults->tests[1].asserts[1].context, "setupOnce executed")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[1].asserts[1].condition, '"SO"="SO"')
call cclutAssertI4Equal(CURREF, "assert value",
ucets_testCaseResults->tests[1].asserts[1].resultInd, TRUE)
call cclutAssertVCEqual(CURREF, "assert context",
ucets_testCaseResults->tests[1].asserts[2].context, "setupOnce failure")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[1].asserts[2].condition, "0=1")
call cclutAssertI4Equal(CURREF, "assert value",
ucets_testCaseResults->tests[1].asserts[2].resultInd, FALSE)
call cclutAssertStartsWith(CURREF, "errorText", "%CCL-E-94-PRG_", ucets_testCaseResults->tests[1].errors[1].errorText)
call cclutAssertContains(CURREF, "errorText",
"{GUARANTEEDERROR}Assignment of Report expression (GUARANTEEDERROR) to incompatible type.",
ucets_testCaseResults->tests[1].errors[1].errorText)
call cclutAssertI4Equal(CURREF, "assert count", size(ucets_testCaseResults->tests[2].asserts, 5), 6)
call cclutAssertI4Equal(CURREF, "error count", size(ucets_testCaseResults->tests[2].errors, 5), 3)
call cclutAssertVCEqual(CURREF, "assert context", ucets_testCaseResults->tests[2].asserts[1].context, "setup executed")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[2].asserts[1].condition, "0=0")
call cclutAssertI4Equal(CURREF, "assert status", ucets_testCaseResults->tests[2].asserts[1].resultInd, TRUE)
call cclutAssertVCEqual(CURREF, "assert context", ucets_testCaseResults->tests[2].asserts[2].context, "setup failure")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[2].asserts[2].condition, "0=1")
call cclutAssertI4Equal(CURREF, "assert status", ucets_testCaseResults->tests[2].asserts[2].resultInd, FALSE)
call cclutAssertVCEqual(CURREF, "assert context", ucets_testCaseResults->tests[2].asserts[3].context, "testOne executed")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[2].asserts[3].condition, "0=0")
call cclutAssertI4Equal(CURREF, "assert status", ucets_testCaseResults->tests[2].asserts[3].resultInd, TRUE)
call cclutAssertVCEqual(CURREF, "assert context", ucets_testCaseResults->tests[2].asserts[4].context, "testOne failure")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[2].asserts[4].condition, "0=1")
call cclutAssertI4Equal(CURREF, "assert status", ucets_testCaseResults->tests[2].asserts[4].resultInd, FALSE)
call cclutAssertVCEqual(CURREF, "assert context", ucets_testCaseResults->tests[2].asserts[5].context, "teardown executed")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[2].asserts[5].condition, "0=0")
call cclutAssertI4Equal(CURREF, "assert status", ucets_testCaseResults->tests[2].asserts[5].resultInd, TRUE)
call cclutAssertVCEqual(CURREF, "assert context", ucets_testCaseResults->tests[2].asserts[6].context, "teardown failure")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[2].asserts[6].condition, "0=1")
call cclutAssertI4Equal(CURREF, "assert status", ucets_testCaseResults->tests[2].asserts[6].resultInd, FALSE)
for (errorIdx = 1 to 3)
call cclutAssertStartsWith(CURREF, "errorText",
"%CCL-E-94-PRG_", ucets_testCaseResults->tests[2].errors[errorIdx].errorText)
call cclutAssertContains(CURREF, "errorText",
"{GUARANTEEDERROR}Assignment of Report expression (GUARANTEEDERROR) to incompatible type.",
ucets_testCaseResults->tests[2].errors[errorIdx].errorText)
endfor
call cclutAssertI4Equal(CURREF, "assert count", size(ucets_testCaseResults->tests[3].asserts, 5), 6)
call cclutAssertI4Equal(CURREF, "error count", size(ucets_testCaseResults->tests[3].errors, 5), 2)
call cclutAssertVCEqual(CURREF, "assert context", ucets_testCaseResults->tests[3].asserts[1].context, "setup executed")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[3].asserts[1].condition, "0=0")
call cclutAssertI4Equal(CURREF, "assert status", ucets_testCaseResults->tests[3].asserts[1].resultInd, TRUE)
call cclutAssertVCEqual(CURREF, "assert context", ucets_testCaseResults->tests[3].asserts[2].context, "setup failure")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[3].asserts[2].condition, "0=1")
call cclutAssertI4Equal(CURREF, "assert status", ucets_testCaseResults->tests[3].asserts[2].resultInd, FALSE)
call cclutAssertVCEqual(CURREF, "assert context", ucets_testCaseResults->tests[3].asserts[3].context, "testTwo executed")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[3].asserts[3].condition, "0=0")
call cclutAssertI4Equal(CURREF, "assert status", ucets_testCaseResults->tests[3].asserts[3].resultInd, TRUE)
call cclutAssertVCEqual(CURREF, "assert context", ucets_testCaseResults->tests[3].asserts[4].context, "testTwo executed")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[3].asserts[4].condition, '"A"="A"')
call cclutAssertI4Equal(CURREF, "assert status", ucets_testCaseResults->tests[3].asserts[4].resultInd, TRUE)
call cclutAssertVCEqual(CURREF, "assert context", ucets_testCaseResults->tests[3].asserts[5].context, "teardown executed")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[3].asserts[5].condition, "0=0")
call cclutAssertI4Equal(CURREF, "assert status", ucets_testCaseResults->tests[3].asserts[5].resultInd, TRUE)
call cclutAssertVCEqual(CURREF, "assert context", ucets_testCaseResults->tests[3].asserts[6].context, "teardown failure")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[3].asserts[6].condition, "0=1")
call cclutAssertI4Equal(CURREF, "assert status", ucets_testCaseResults->tests[3].asserts[6].resultInd, FALSE)
for (errorIdx = 1 to 2)
call cclutAssertStartsWith(CURREF, "errorText",
"%CCL-E-94-PRG_", ucets_testCaseResults->tests[3].errors[errorIdx].errorText)
call cclutAssertContains(CURREF, "errorText",
"{GUARANTEEDERROR}Assignment of Report expression (GUARANTEEDERROR) to incompatible type.",
ucets_testCaseResults->tests[3].errors[errorIdx].errorText)
endfor
call cclutAssertI4Equal(CURREF, "assert count", size(ucets_testCaseResults->tests[4].asserts, 5), 7)
call cclutAssertI4Equal(CURREF, "error count", size(ucets_testCaseResults->tests[4].errors, 5), 3)
call cclutAssertVCEqual(CURREF, "assert context", ucets_testCaseResults->tests[4].asserts[1].context, "setup executed")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[4].asserts[1].condition, "0=0")
call cclutAssertI4Equal(CURREF, "assert status", ucets_testCaseResults->tests[4].asserts[1].resultInd, TRUE)
call cclutAssertVCEqual(CURREF, "assert context", ucets_testCaseResults->tests[4].asserts[2].context, "setup failure")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[4].asserts[2].condition, "0=1")
call cclutAssertI4Equal(CURREF, "assert status", ucets_testCaseResults->tests[4].asserts[2].resultInd, FALSE)
call cclutAssertVCEqual(CURREF, "assert context", ucets_testCaseResults->tests[4].asserts[3].context, "testThree executed")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[4].asserts[3].condition, "0=0")
call cclutAssertI4Equal(CURREF, "assert status", ucets_testCaseResults->tests[4].asserts[3].resultInd, TRUE)
call cclutAssertVCEqual(CURREF, "assert context", ucets_testCaseResults->tests[4].asserts[4].context, "testThree failure A")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[4].asserts[4].condition, "0=1")
call cclutAssertI4Equal(CURREF, "assert status", ucets_testCaseResults->tests[4].asserts[4].resultInd, FALSE)
call cclutAssertVCEqual(CURREF, "assert context", ucets_testCaseResults->tests[4].asserts[5].context, "testThree failure B")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[4].asserts[5].condition, "0=1")
call cclutAssertI4Equal(CURREF, "assert status", ucets_testCaseResults->tests[4].asserts[5].resultInd, FALSE)
call cclutAssertVCEqual(CURREF, "assert context", ucets_testCaseResults->tests[4].asserts[6].context, "teardown executed")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[4].asserts[6].condition, "0=0")
call cclutAssertI4Equal(CURREF, "assert status", ucets_testCaseResults->tests[4].asserts[6].resultInd, TRUE)
call cclutAssertVCEqual(CURREF, "assert context", ucets_testCaseResults->tests[4].asserts[7].context, "teardown failure")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[4].asserts[7].condition, "0=1")
call cclutAssertI4Equal(CURREF, "assert status", ucets_testCaseResults->tests[4].asserts[7].resultInd, FALSE)
for (errorIdx = 1 to 3)
call cclutAssertStartsWith(CURREF, "errorText",
"%CCL-E-94-PRG_", ucets_testCaseResults->tests[4].errors[errorIdx].errorText)
call cclutAssertContains(CURREF, "errorText",
"{GUARANTEEDERROR}Assignment of Report expression (GUARANTEEDERROR) to incompatible type.",
ucets_testCaseResults->tests[4].errors[errorIdx].errorText)
endfor
call cclutAssertI4Equal(CURREF, "assert count", size(ucets_testCaseResults->tests[5].asserts, 5), 2)
call cclutAssertI4Equal(CURREF, "error count", size(ucets_testCaseResults->tests[5].errors, 5), 1)
call cclutAssertVCEqual(CURREF, "assert context",
ucets_testCaseResults->tests[5].asserts[1].context, "teardownOnce executed")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[5].asserts[1].condition, '"TO"="TO"')
call cclutAssertI4Equal(CURREF, "assert value",
ucets_testCaseResults->tests[5].asserts[1].resultInd, TRUE)
call cclutAssertVCEqual(CURREF, "assert context",
ucets_testCaseResults->tests[5].asserts[2].context, "teardownOnce failure")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[5].asserts[2].condition, "0=1")
call cclutAssertI4Equal(CURREF, "assert value",
ucets_testCaseResults->tests[5].asserts[2].resultInd, FALSE)
call cclutAssertStartsWith(CURREF, "errorText", "%CCL-E-94-PRG_", ucets_testCaseResults->tests[5].errors[1].errorText)
call cclutAssertContains(CURREF, "errorText",
"{GUARANTEEDERROR}Assignment of Report expression (GUARANTEEDERROR) to incompatible type.",
ucets_testCaseResults->tests[5].errors[1].errorText)
end ;;;testFailsAndErrorsEverywhere
/**
Run ut_cclut_suo_su_td_tdo and validate the results when all subroutines produce a failed assert but no errors.
*/
subroutine testFailsEverywhere(null)
declare testCount = i4 with protect, noconstant(0)
set testing::failSetupOnce = TRUE
set testing::failSetup = TRUE
set testing::failTest = TRUE
set testing::failTeardown = TRUE
set testing::failTeardownOnce = TRUE
execute cclut_execute_test_case_file with
replace("CCLUTREQUEST", ucets_request),
replace("CCLUTREPLY", ucets_reply),
replace("CCLUTTESTCASERESULTS", ucets_testCaseResults)
call cclutAssertVCEqual(CURREF, "execute success 1", ucets_reply->status_data.status, "S")
call cclutAssertI2Equal(CURREF, "test case failure", ucets_testCaseResults->resultInd, FALSE)
set testCount = size(ucets_testCaseResults->tests, 5)
call cclutAssertI4Equal(CURREF, "test count", testCount, 5)
call cclutAssertI4Equal(CURREF, "assert count", size(ucets_testCaseResults->tests[1].asserts, 5), 2)
call cclutAssertI4Equal(CURREF, "error count", size(ucets_testCaseResults->tests[1].errors, 5), 0)
call cclutAssertVCEqual(CURREF, "assert context",
ucets_testCaseResults->tests[1].asserts[1].context, "setupOnce executed")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[1].asserts[1].condition, '"SO"="SO"')
call cclutAssertI4Equal(CURREF, "assert value",
ucets_testCaseResults->tests[1].asserts[1].resultInd, TRUE)
call cclutAssertVCEqual(CURREF, "assert context",
ucets_testCaseResults->tests[1].asserts[2].context, "setupOnce failure")
call cclutAssertVCEqual(CURREF, "assert condition", ucets_testCaseResults->tests[1].asserts[2].condition, "0=1")
call cclutAssertI4Equal(CURREF, "assert value",
ucets_testCaseResults->tests[1].asserts[2].resultInd, FALSE)
call cclutAssertI4Equal(CURREF, "assert count", size(ucets_testCaseResults->tests[2].asserts, 5), 6)
call cclutAssertI4Equal(CURREF, "error count", size(ucets_testCaseResults->tests[2].errors, 5), 0)
call cclutAssertVCEqual(CURREF, "assert context", ucets_testCaseResults->tests[2].asserts[1].context, "setup executed")