- File:
-
- 1 edited
-
tests/list/dlist-insert-remove.cfa (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/list/dlist-insert-remove.cfa
r6b33e89 r8f448e0 1 #ifdef __TEMP_DLIST_V2__ 2 #include <collections/list2.hfa> 3 #else 1 4 #include <collections/list.hfa> 2 # include <fstream.hfa>5 #endif 3 6 #include <assert.h> 4 5 // Section 1: replaced by above include list.hfa 7 // NO including fstream.hfa (use printf, not sout) 8 // Because fstream depends on threading library, which depends on list. 9 // This test must stay runnable after changing lists, 10 // before fixing any threading library dependencies on the prior list implementation. 11 12 13 // Former Section 1: replaced by above include list.hfa 6 14 7 15 … … 58 66 with( DLINK_VIA( fred, fred.mine ) ) 59 67 do { 60 sout | f.adatum;68 printf( "%g\n", f.adatum ); 61 69 } while (advance( f )); 62 70 } … … 65 73 with( DLINK_VIA( fred, fred.mine ) ) 66 74 do { 67 sout | f.adatum;75 printf( "%g\n", f.adatum ); 68 76 } while (recede( f )); 69 77 } … … 72 80 void printMyFreddies(fred &f1, fred &f2, int isBefore) { 73 81 if (isBefore) { 74 sout | "==== fred by MINE before ";82 printf( "==== fred by MINE before \n" ); 75 83 } else { 76 sout | "==== fred by MINE after ";84 printf( "==== fred by MINE after \n" ); 77 85 } 78 86 if (&f1) { 79 printMyFredsFwd(f1); sout | '-';80 printMyFredsRev(f1); sout | '-';87 printMyFredsFwd(f1); printf( "-\n" ); 88 printMyFredsRev(f1); printf( "-\n" ); 81 89 } else { 82 sout | '-'; sout | '-';90 printf( "-\n" ); printf( "-\n" ); 83 91 } 84 92 if (&f2) { 85 printMyFredsFwd(f2); sout | '-';86 printMyFredsRev(f2); sout | '-';93 printMyFredsFwd(f2); printf( "-\n" ); 94 printMyFredsRev(f2); printf( "-\n" ); 87 95 } else { 88 sout | '-'; sout | '-';96 printf( "-\n" ); printf( "-\n" ); 89 97 } 90 98 } … … 93 101 with( DLINK_VIA( fred, fred.yours ) ) 94 102 do { 95 sout | f.adatum;103 printf( "%g\n", f.adatum ); 96 104 } while (advance( f )); 97 105 } … … 100 108 with( DLINK_VIA( fred, fred.yours ) ) 101 109 do { 102 sout | f.adatum;110 printf( "%g\n", f.adatum ); 103 111 } while (recede( f )); 104 112 } … … 106 114 void printYourFreddies(fred &f1, fred &f2, int isBefore) { 107 115 if (isBefore) { 108 sout | "==== fred by YOURS before ";116 printf( "==== fred by YOURS before \n" ); 109 117 } else { 110 sout | "==== fred by YOURS after ";118 printf( "==== fred by YOURS after \n" ); 111 119 } 112 120 if (&f1) { 113 printYourFredsFwd(f1); sout | '-';114 printYourFredsRev(f1); sout | '-';121 printYourFredsFwd(f1); printf( "-\n" ); 122 printYourFredsRev(f1); printf( "-\n" ); 115 123 } else { 116 sout | '-'; sout | '-';124 printf( "-\n" ); printf( "-\n" ); 117 125 } 118 126 if (&f2) { 119 printYourFredsFwd(f2); sout | '-';120 printYourFredsRev(f2); sout | '-';127 printYourFredsFwd(f2); printf( "-\n" ); 128 printYourFredsRev(f2); printf( "-\n" ); 121 129 } else { 122 sout | '-'; sout | '-';130 printf( "-\n" ); printf( "-\n" ); 123 131 } 124 132 } … … 126 134 void printMariesFwd(mary &m) { 127 135 do { 128 sout | m.anotherdatum;136 printf( "%g\n", m.anotherdatum ); 129 137 } while (advance( m )); 130 138 } … … 132 140 void printMariesRev(mary &m) { 133 141 do { 134 sout | m.anotherdatum;142 printf( "%g\n", m.anotherdatum ); 135 143 } while (recede( m )); 136 144 } … … 138 146 void printMariatheotokos(mary &m1, mary &m2, int isBefore) { 139 147 if (isBefore) { 140 sout | "==== mary before ";148 printf( "==== mary before \n" ); 141 149 } else { 142 sout | "==== mary after ";150 printf( "==== mary after \n" ); 143 151 } 144 152 if (&m1) { 145 printMariesFwd(m1); sout | '-';146 printMariesRev(m1); sout | '-';153 printMariesFwd(m1); printf( "-\n" ); 154 printMariesRev(m1); printf( "-\n" ); 147 155 } else { 148 sout | '-'; sout | '-';156 printf( "-\n" ); printf( "-\n" ); 149 157 } 150 158 if (&m2) { 151 printMariesFwd(m2); sout | '-';152 printMariesRev(m2); sout | '-';159 printMariesFwd(m2); printf( "-\n" ); 160 printMariesRev(m2); printf( "-\n" ); 153 161 } else { 154 sout | '-'; sout | '-';162 printf( "-\n" ); printf( "-\n" ); 155 163 } 156 164 } … … 1636 1644 int main() { 1637 1645 #if 0 1638 sout | "~~~~~~~~~~~~~~~~~ Headless List Tests - insert_after ~~~~~~~~~~~~~~~~";1639 sout | "";1640 1641 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1642 sout | "Test 1-i: Modifying Freds on MINE ";1643 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1646 printf( "~~~~~~~~~~~~~~~~~ Headless List Tests - insert_after ~~~~~~~~~~~~~~~~\n" ); 1647 printf( "\n" ); 1648 1649 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1650 printf( "Test 1-i: Modifying Freds on MINE \n" ); 1651 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1644 1652 test__insertafter_singleton_on_singleton__fred_mine(); 1645 1653 1646 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1647 sout | "Test 2-i. Modifying Freds on YOURS";1648 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1654 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1655 printf( "Test 2-i. Modifying Freds on YOURS\n" ); 1656 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1649 1657 test__insertafter_singleton_on_singleton__fred_yours(); 1650 1658 1651 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~";1652 sout | "Test 3-i. Modifying Maries";1653 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~";1659 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1660 printf( "Test 3-i. Modifying Maries\n" ); 1661 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1654 1662 test__insertafter_singleton_on_singleton__mary(); 1655 1663 1656 sout | "";1657 sout | "~~~~~~~~~~~~~~~~ Headless List Tests - insert_before ~~~~~~~~~~~~~~~~";1658 sout | "";1659 1660 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1661 sout | "Test 1-ii: Modifying Freds on MINE ";1662 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1664 printf( "\n" ); 1665 printf( "~~~~~~~~~~~~~~~~ Headless List Tests - insert_before ~~~~~~~~~~~~~~~~\n" ); 1666 printf( "\n" ); 1667 1668 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1669 printf( "Test 1-ii: Modifying Freds on MINE \n" ); 1670 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1663 1671 test__insertbefore_singleton_on_singleton__fred_mine(); 1664 1672 1665 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1666 sout | "Test 2-ii. Modifying Freds on YOURS";1667 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1673 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1674 printf( "Test 2-ii. Modifying Freds on YOURS\n" ); 1675 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1668 1676 test__insertbefore_singleton_on_singleton__fred_yours(); 1669 1677 1670 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1671 sout | "Test 3-ii. Modifying Maries";1672 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1678 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1679 printf( "Test 3-ii. Modifying Maries\n" ); 1680 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1673 1681 test__insertbefore_singleton_on_singleton__mary(); 1674 1682 #endif 1675 sout | "";1676 sout | "~~~~~~~~~~~~~~~~~ Headed List Tests - insert_first ~~~~~~~~~~~~~~~~~~";1677 sout | "";1678 1679 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1680 sout | "Test 4-i: Modifying Freds on MINE ";1681 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1683 printf( "\n" ); 1684 printf( "~~~~~~~~~~~~~~~~~ Headed List Tests - insert_first ~~~~~~~~~~~~~~~~~~\n" ); 1685 printf( "\n" ); 1686 1687 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1688 printf( "Test 4-i: Modifying Freds on MINE \n" ); 1689 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1682 1690 test__insertfirst_two_on_empty__fred_mine(); 1683 1691 1684 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1685 sout | "Test 5-i: Modifying Freds on YOURS ";1686 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1692 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1693 printf( "Test 5-i: Modifying Freds on YOURS \n" ); 1694 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1687 1695 test__insertfirst_two_on_empty__fred_yours(); 1688 1696 1689 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~";1690 sout | "Test 6-i. Modifying Maries";1691 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~";1697 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1698 printf( "Test 6-i. Modifying Maries\n" ); 1699 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1692 1700 test__insertfirst_two_on_empty__mary(); 1693 1701 1694 sout | "";1695 sout | "~~~~~~~~~~~~~~~~~ Headed List Tests - insert_last ~~~~~~~~~~~~~~~~~~~";1696 sout | "";1697 1698 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1699 sout | "Test 4-ii: Modifying Freds on MINE ";1700 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1702 printf( "\n" ); 1703 printf( "~~~~~~~~~~~~~~~~~ Headed List Tests - insert_last ~~~~~~~~~~~~~~~~~~~\n" ); 1704 printf( "\n" ); 1705 1706 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1707 printf( "Test 4-ii: Modifying Freds on MINE \n" ); 1708 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1701 1709 test__insertlast_two_on_empty__fred_mine(); 1702 1710 1703 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1704 sout | "Test 5-ii: Modifying Freds on YOURS ";1705 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1711 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1712 printf( "Test 5-ii: Modifying Freds on YOURS \n" ); 1713 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1706 1714 test__insertlast_two_on_empty__fred_yours(); 1707 1715 1708 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1709 sout | "Test 6-ii. Modifying Maries";1710 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1716 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1717 printf( "Test 6-ii. Modifying Maries\n" ); 1718 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1711 1719 test__insertlast_two_on_empty__mary(); 1712 1720 1713 sout | "";1714 sout | "~~~~~~~~~~~ Element ops on Headed List Tests: after, last ~~~~~~~~~~~";1715 sout | "";1716 1717 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1718 sout | "Test 7-i. Modifying Freds on MINE";1719 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1721 printf( "\n" ); 1722 printf( "~~~~~~~~~~~ Element ops on Headed List Tests: after, last ~~~~~~~~~~~\n" ); 1723 printf( "\n" ); 1724 1725 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1726 printf( "Test 7-i. Modifying Freds on MINE\n" ); 1727 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1720 1728 test__insertafter_after_last__fred_mine(); 1721 1729 1722 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1723 sout | "Test 8-i. Modifying Freds on YOURS";1724 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1730 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1731 printf( "Test 8-i. Modifying Freds on YOURS\n" ); 1732 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1725 1733 test__insertafter_after_last__fred_yours(); 1726 1734 1727 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~";1728 sout | "Test 9-i. Modifying Maries";1729 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~";1735 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1736 printf( "Test 9-i. Modifying Maries\n" ); 1737 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1730 1738 test__insertafter_after_last__mary(); 1731 1739 1732 sout | "";1733 sout | "~~~~~~~~~~ Element ops on Headed List Tests: before, first ~~~~~~~~~~";1734 sout | "";1735 1736 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1737 sout | "Test 7-ii. Modifying Freds on MINE";1738 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1740 printf( "\n" ); 1741 printf( "~~~~~~~~~~ Element ops on Headed List Tests: before, first ~~~~~~~~~~\n" ); 1742 printf( "\n" ); 1743 1744 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1745 printf( "Test 7-ii. Modifying Freds on MINE\n" ); 1746 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1739 1747 test__insertbefore_before_first__fred_mine(); 1740 1748 1741 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1742 sout | "Test 8-ii. Modifying Freds on YOURS";1743 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1749 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1750 printf( "Test 8-ii. Modifying Freds on YOURS\n" ); 1751 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1744 1752 test__insertbefore_before_first__fred_yours(); 1745 1753 1746 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1747 sout | "Test 9-ii. Modifying Maries";1748 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1754 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1755 printf( "Test 9-ii. Modifying Maries\n" ); 1756 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1749 1757 test__insertbefore_before_first__mary(); 1750 1758 #if 0 1751 1759 1752 sout | "";1753 sout | "~~~~~~~~~~ Element removal tests on Headless List: mid ~~~~~~~~~~";1754 sout | "";1755 1756 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1757 sout | "Test 10-i. Modifying Freds on MINE";1758 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1760 printf( "\n" ); 1761 printf( "~~~~~~~~~~ Element removal tests on Headless List: mid ~~~~~~~~~~\n" ); 1762 printf( "\n" ); 1763 1764 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1765 printf( "Test 10-i. Modifying Freds on MINE\n" ); 1766 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1759 1767 test__remove_mid__fred_mine(); 1760 1768 1761 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1762 sout | "Test 11-i. Modifying Freds on YOURS";1763 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1769 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1770 printf( "Test 11-i. Modifying Freds on YOURS\n" ); 1771 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1764 1772 test__remove_mid__fred_yours(); 1765 1773 1766 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1767 sout | "Test 12-i. Modifying Maries";1768 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1774 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1775 printf( "Test 12-i. Modifying Maries\n" ); 1776 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1769 1777 test__remove_mid__mary(); 1770 1778 1771 sout | "";1772 sout | "~~~~~~~~~~ Element removal tests on Headless List: at first ~~~~~~~~~~";1773 sout | "";1774 1775 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1776 sout | "Test 10-ii. Modifying Freds on MINE";1777 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1779 printf( "\n" ); 1780 printf( "~~~~~~~~~~ Element removal tests on Headless List: at first ~~~~~~~~~~\n" ); 1781 printf( "\n" ); 1782 1783 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1784 printf( "Test 10-ii. Modifying Freds on MINE\n" ); 1785 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1778 1786 test__remove_at_first__fred_mine(); 1779 1787 1780 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1781 sout | "Test 11-ii. Modifying Freds on YOURS";1782 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1788 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1789 printf( "Test 11-ii. Modifying Freds on YOURS\n" ); 1790 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1783 1791 test__remove_at_first__fred_yours(); 1784 1792 1785 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1786 sout | "Test 12-ii. Modifying Maries";1787 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1793 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1794 printf( "Test 12-ii. Modifying Maries\n" ); 1795 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1788 1796 test__remove_at_first__mary(); 1789 1797 1790 sout | "";1791 sout | "~~~~~~~~~~ Element removal tests on Headless List: at last ~~~~~~~~~~";1792 sout | "";1793 1794 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1795 sout | "Test 10-iii. Modifying Freds on MINE";1796 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1798 printf( "\n" ); 1799 printf( "~~~~~~~~~~ Element removal tests on Headless List: at last ~~~~~~~~~~\n" ); 1800 printf( "\n" ); 1801 1802 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1803 printf( "Test 10-iii. Modifying Freds on MINE\n" ); 1804 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1797 1805 test__remove_at_last__fred_mine(); 1798 1806 1799 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1800 sout | "Test 11-iii. Modifying Freds on YOURS";1801 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1807 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1808 printf( "Test 11-iii. Modifying Freds on YOURS\n" ); 1809 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1802 1810 test__remove_at_last__fred_yours(); 1803 1811 1804 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1805 sout | "Test 12-iii. Modifying Maries";1806 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1812 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1813 printf( "Test 12-iii. Modifying Maries\n" ); 1814 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1807 1815 test__remove_at_last__mary(); 1808 1816 #endif 1809 sout | "";1810 sout | "~~~~~~~~~~ Element removal tests on Headed List: at first ~~~~~~~~~~";1811 sout | "";1812 1813 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1814 sout | "Test 13-i. Modifying Freds on MINE";1815 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1817 printf( "\n" ); 1818 printf( "~~~~~~~~~~ Element removal tests on Headed List: at first ~~~~~~~~~~\n" ); 1819 printf( "\n" ); 1820 1821 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1822 printf( "Test 13-i. Modifying Freds on MINE\n" ); 1823 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1816 1824 test__remove_at_head__fred_mine(); 1817 1825 1818 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1819 sout | "Test 14-i. Modifying Freds on YOURS";1820 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1826 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1827 printf( "Test 14-i. Modifying Freds on YOURS\n" ); 1828 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1821 1829 test__remove_at_head__fred_yours(); 1822 1830 1823 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1824 sout | "Test 15-i. Modifying Maries";1825 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1831 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1832 printf( "Test 15-i. Modifying Maries\n" ); 1833 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1826 1834 test__remove_at_head__mary(); 1827 1835 1828 sout | "";1829 sout | "~~~~~~~~~~ Element removal tests on Headed List: at last ~~~~~~~~~~";1830 sout | "";1831 1832 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1833 sout | "Test 13-ii. Modifying Freds on MINE";1834 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1836 printf( "\n" ); 1837 printf( "~~~~~~~~~~ Element removal tests on Headed List: at last ~~~~~~~~~~\n" ); 1838 printf( "\n" ); 1839 1840 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1841 printf( "Test 13-ii. Modifying Freds on MINE\n" ); 1842 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1835 1843 test__remove_at_tail__fred_mine(); 1836 1844 1837 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1838 sout | "Test 14-ii. Modifying Freds on YOURS";1839 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1845 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1846 printf( "Test 14-ii. Modifying Freds on YOURS\n" ); 1847 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1840 1848 test__remove_at_tail__fred_yours(); 1841 1849 1842 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1843 sout | "Test 15-ii. Modifying Maries";1844 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1850 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1851 printf( "Test 15-ii. Modifying Maries\n" ); 1852 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1845 1853 test__remove_at_tail__mary(); 1846 1854 1847 sout | "";1848 sout | "~~~~~~~~~~ Element removal tests on Headed List: of sole ~~~~~~~~~~";1849 sout | "";1850 1851 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1852 sout | "Test 13-iii. Modifying Freds on MINE";1853 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1855 printf( "\n" ); 1856 printf( "~~~~~~~~~~ Element removal tests on Headed List: of sole ~~~~~~~~~~\n" ); 1857 printf( "\n" ); 1858 1859 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1860 printf( "Test 13-iii. Modifying Freds on MINE\n" ); 1861 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1854 1862 test__remove_of_sole__fred_mine(); 1855 1863 1856 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1857 sout | "Test 14-iii. Modifying Freds on YOURS";1858 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1864 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1865 printf( "Test 14-iii. Modifying Freds on YOURS\n" ); 1866 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1859 1867 test__remove_of_sole__fred_yours(); 1860 1868 1861 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1862 sout | "Test 15-iii. Modifying Maries";1863 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1869 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1870 printf( "Test 15-iii. Modifying Maries\n" ); 1871 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1864 1872 test__remove_of_sole__mary(); 1865 1873 1866 sout | "";1867 sout | "~~~~~~~~~~ End removal tests on Headed List: First ~~~~~~~~~~";1868 sout | "";1869 1870 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1871 sout | "Test 16-i. Modifying Freds on MINE";1872 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1874 printf( "\n" ); 1875 printf( "~~~~~~~~~~ End removal tests on Headed List: First ~~~~~~~~~~\n" ); 1876 printf( "\n" ); 1877 1878 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1879 printf( "Test 16-i. Modifying Freds on MINE\n" ); 1880 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1873 1881 test__pop_first__fred_mine(); 1874 1882 1875 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1876 sout | "Test 16-ii. Modifying Freds on YOURS";1877 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1883 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1884 printf( "Test 16-ii. Modifying Freds on YOURS\n" ); 1885 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1878 1886 test__pop_first__fred_yours(); 1879 1887 1880 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1881 sout | "Test 16-iii. Modifying Maries";1882 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1888 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1889 printf( "Test 16-iii. Modifying Maries\n" ); 1890 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1883 1891 test__pop_first__maries(); 1884 1892 1885 sout | "";1886 sout | "~~~~~~~~~~ End removal tests on Headed List: Last ~~~~~~~~~~";1887 sout | "";1888 1889 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1890 sout | "Test 17-i. Modifying Freds on MINE";1891 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1893 printf( "\n" ); 1894 printf( "~~~~~~~~~~ End removal tests on Headed List: Last ~~~~~~~~~~\n" ); 1895 printf( "\n" ); 1896 1897 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1898 printf( "Test 17-i. Modifying Freds on MINE\n" ); 1899 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1892 1900 test__pop_last__fred_mine(); 1893 1901 1894 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1895 sout | "Test 17-ii. Modifying Freds on YOURS";1896 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1902 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1903 printf( "Test 17-ii. Modifying Freds on YOURS\n" ); 1904 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1897 1905 test__pop_last__fred_yours(); 1898 1906 1899 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1900 sout | "Test 17-iii. Modifying Maries";1901 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1907 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1908 printf( "Test 17-iii. Modifying Maries\n" ); 1909 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1902 1910 test__pop_last__maries(); 1903 1911 1904 sout | "";1905 sout | "~~~~~~~~~~~~~~~~~~~ Ease-of-access cases ~~~~~~~~~~~~~~~~~~";1906 sout | "";1907 1908 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1909 sout | "Test 18-i. Modifying Freds on MINE";1910 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1911 sout | "Not implmented";1912 1913 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1914 sout | "Test 18-ii. Modifying Freds on YOURS";1915 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1916 sout | "Not implmented";1917 1918 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1919 sout | "Test 18-iii. Modifying Maries";1920 sout | "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";1912 printf( "\n" ); 1913 printf( "~~~~~~~~~~~~~~~~~~~ Ease-of-access cases ~~~~~~~~~~~~~~~~~~\n" ); 1914 printf( "\n" ); 1915 1916 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1917 printf( "Test 18-i. Modifying Freds on MINE\n" ); 1918 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1919 printf( "Not implmented\n" ); 1920 1921 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1922 printf( "Test 18-ii. Modifying Freds on YOURS\n" ); 1923 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1924 printf( "Not implmented\n" ); 1925 1926 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1927 printf( "Test 18-iii. Modifying Maries\n" ); 1928 printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ); 1921 1929 1922 1930 test__accessor_cases__mary();
Note:
See TracChangeset
for help on using the changeset viewer.