#include #include int main() { std::cout << "=== Test 0 ===" << std::endl; { Cloth c1{"PJ", 5}; Cloth c2{"JohnLongs", 10}; std::cout << c1 << ", " << c2 << std::endl; } std::cout << "=== Test 1 ===" << std::endl; { WashMachine m1{}; m1.insert(Cloth{"PJ", 7}); m1.insert(Cloth{"Sock", 3}); m1.insert(Cloth{"LongJohns", 10}); m1.insert(Cloth{"Bed Sheet", 90}); m1.insert(Cloth{"Shoe", 8}); m1.insert(Cloth{"T-Shirt", 8}); // Vi glömde avsiktligt att starta maskinen! while ( not m1.is_empty() ) { std::cout << m1.remove() << std::endl; } } std::cout << "=== Test 2 ===" << std::endl; { WashMachine m1{}; m1.insert(Cloth{"PJ", 7}); m1.insert(Cloth{"Sock", 3}); m1.insert(Cloth{"LongJohns", 10}); m1.insert(Cloth{"Bed Sheet", 90}); m1.insert(Cloth{"Shoe", 8}); m1.insert(Cloth{"T-Shirt", 8}); m1.start(); // Vi kom ihåg starta maskinen while ( not m1.is_empty() ) { std::cout << m1.remove() << std::endl; } } }