Lines Matching refs:list
49 std::string test_list_to_string(test_list_t& list) { in test_list_to_string() argument
51 list.for_each([&] (const char* c) { in test_list_to_string()
62 test_list_t list; in TEST() local
63 ASSERT_EQ("", test_list_to_string(list)); in TEST()
66 list.push_front("a"); in TEST()
69 ASSERT_EQ("a", test_list_to_string(list)); in TEST()
70 list.push_front("b"); in TEST()
71 ASSERT_EQ("ba", test_list_to_string(list)); in TEST()
72 list.push_front("c"); in TEST()
73 list.push_front("d"); in TEST()
74 ASSERT_EQ("dcba", test_list_to_string(list)); in TEST()
78 list.remove_if([] (const char* c) { in TEST()
85 ASSERT_EQ("dba", test_list_to_string(list)); in TEST()
87 list.remove_if([] (const char* c) { in TEST()
92 ASSERT_EQ("dba", test_list_to_string(list)); in TEST()
93 list.clear(); in TEST()
96 ASSERT_EQ("", test_list_to_string(list)); in TEST()
100 test_list_t list; in TEST() local
101 list.push_front("b"); in TEST()
102 list.push_front("a"); in TEST()
103 ASSERT_EQ("ab", test_list_to_string(list)); in TEST()
104 list.push_back("c"); in TEST()
105 ASSERT_EQ("abc", test_list_to_string(list)); in TEST()
106 ASSERT_STREQ("a", list.pop_front()); in TEST()
107 ASSERT_EQ("bc", test_list_to_string(list)); in TEST()
108 ASSERT_STREQ("b", list.pop_front()); in TEST()
109 ASSERT_EQ("c", test_list_to_string(list)); in TEST()
110 ASSERT_STREQ("c", list.pop_front()); in TEST()
111 ASSERT_EQ("", test_list_to_string(list)); in TEST()
112 ASSERT_TRUE(list.pop_front() == nullptr); in TEST()
113 list.push_back("r"); in TEST()
114 ASSERT_EQ("r", test_list_to_string(list)); in TEST()
115 ASSERT_STREQ("r", list.pop_front()); in TEST()
116 ASSERT_TRUE(list.pop_front() == nullptr); in TEST()
120 test_list_t list; in TEST() local
121 list.push_back("a"); in TEST()
122 list.push_back("b"); in TEST()
123 list.push_back("c"); in TEST()
124 list.push_back("d"); in TEST()
125 list.remove_if([](const char* c) { in TEST()
129 ASSERT_EQ("ad", test_list_to_string(list)); in TEST()
130 ASSERT_STREQ("a", list.pop_front()); in TEST()
131 ASSERT_EQ("d", test_list_to_string(list)); in TEST()
132 ASSERT_STREQ("d", list.pop_front()); in TEST()
133 ASSERT_TRUE(list.pop_front() == nullptr); in TEST()
137 test_list_t list; in TEST() local
142 ASSERT_EQ(0U, list.copy_to_array(buf, max_size)); in TEST()
145 list.push_back("a"); in TEST()
146 list.push_back("b"); in TEST()
147 list.push_back("c"); in TEST()
148 list.push_back("d"); in TEST()
151 ASSERT_EQ(2U, list.copy_to_array(buf, 2)); in TEST()
156 ASSERT_EQ(4U, list.copy_to_array(buf, max_size)); in TEST()
164 list.remove_if([](const char* c) { in TEST()
167 ASSERT_EQ(1U, list.copy_to_array(buf, max_size)); in TEST()
173 list.remove_if([](const char* c) { in TEST()
177 ASSERT_EQ(0U, list.copy_to_array(buf, max_size)); in TEST()
182 test_list_t list; in TEST() local
183 list.push_back("a"); in TEST()
184 list.push_back("b"); in TEST()
185 list.push_back("c"); in TEST()
186 list.push_back("d"); in TEST()
190 bool result = list.visit([&](const char* c) { in TEST()
203 result = list.visit([&](const char* c) { in TEST()