1 /*******************************************************
2 * Unit test for the SuperString class
4 * test contrustor and assignment of SuperSting objects
5 ******************************************************
14 // Default contructor: empty string
17 std::cout << "The default contructor makes an empty superstring.\n";
23 std::cout << "Contructor from a String makes a superstring with 1 element.\n";
28 std::cout << "Contructor with an integer argument makes a superstring with n elements.\n";
31 // The copy contructor
35 std::cout << "The copy contructor makes a bitwise copy.\n";
38 // Assignment to a SuperSting with n elements should remove the old elements.
42 // A string from a literal string
45 std::cout << "A string from a literal string \"abc\": \"" << s2 << "\"\n";
48 // The copy constructor
51 std::cout << "A string copied from the previous string \"abc\": \"" << s3 << "\"\n";
54 // Assign a single character
57 std::cout << "A string assigned a single charater 'q': \"" << s4 << "\"\n";
60 // Initialized with a single character
63 std::cout << "A string initialized with a single charater 'r': \"" << s5 << "\"\n";
66 // Assign a literal string
69 std::cout << "A string assigned a literal string \"ijk\": \"" << s6 << "\"\n";
72 // Initialized a literal string
75 std::cout << "A string initialized with a literal string \"lmn\": \"" << s7 << "\"\n";
78 // Assign a String object
81 std::cout << "A string assigned a String object \"ijk\": \"" << s8 << "\"\n";
84 // Initialized a String object
87 std::cout << "A string initialized with a String object \"lmn\": \"" << s9 << "\"\n";