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