diff --git a/COBOL/mf/test/.cobolProj b/COBOL/mf/test/.cobolProj new file mode 100644 index 00000000..53304fe0 --- /dev/null +++ b/COBOL/mf/test/.cobolProj @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/COBOL/mf/test/.gitignore b/COBOL/mf/test/.gitignore new file mode 100644 index 00000000..21774bfb --- /dev/null +++ b/COBOL/mf/test/.gitignore @@ -0,0 +1,3 @@ +/.cobolBuild +/Coverage/ +/Tests.bin/ diff --git a/COBOL/mf/test/.project b/COBOL/mf/test/.project new file mode 100644 index 00000000..2615ee47 --- /dev/null +++ b/COBOL/mf/test/.project @@ -0,0 +1,23 @@ + + + Tests + + + + + + com.microfocus.eclipse.project.cobolBuilder + + + + + com.microfocus.eclipse.mfunit.core.mfUnitBuilder + + + + + + com.microfocus.eclipse.project.cobolNature + com.microfocus.eclipse.mfunit.core.mfUnitNature + + diff --git a/COBOL/mf/test/TestGildedRose.cbl b/COBOL/mf/test/TestGildedRose.cbl new file mode 100644 index 00000000..d9802330 --- /dev/null +++ b/COBOL/mf/test/TestGildedRose.cbl @@ -0,0 +1,67 @@ + *> Test Fixture for GildedRose, GildedRose + + copy "mfunit_prototypes.cpy". + + program-id. TestGildedRose. + + file-control. + select in-items assign 'in-items'. + select items assign 'items'. + + file section. + fd in-items. + 01 in-item. + 02 sell-in pic 9(4). + 02 quality pic 9(4). + 02 name pic x(50). + fd items. + 01 item. + 02 sell-in pic 9(4). + 02 quality pic 9(4). + 02 name pic x(50). + + working-storage section. + copy "mfunit.cpy". + 78 TEST-TESTGILDEDROSE value "TestGildedRose". + 01 pp procedure-pointer. + + *> Program linkage data + + procedure division. + goback returning 0 + . + + entry MFU-TC-PREFIX & TEST-TESTGILDEDROSE. + open output in-items + move "foo" to name in in-item + move 0 to quality in in-item + move 0 to sell-in in in-item + write in-item + close in-items + call "GildedRose" + open input items + read items + if name in item not equal to "fixme" then + call MFU-ASSERT-FAIL-Z using z"item name was not fixme" + close items + goback + . + + $region TestCase Configuration + + entry MFU-TC-SETUP-PREFIX & TEST-TESTGILDEDROSE. + perform InitializeLinkageData + *> Add any other test setup code here + goback returning 0 + . + + InitializeLinkageData section. + *> Load the library that is being tested + set pp to entry "GildedRose" + + exit section + . + + $end-region + + end program.