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