Lines Matching refs:sk
51 void operator()(STACK_OF(TEST_INT) *sk) const { sk_TEST_INT_free(sk); } in operator ()()
60 static void ExpectStackEquals(const STACK_OF(TEST_INT) *sk, in ExpectStackEquals() argument
62 EXPECT_EQ(vec.size(), sk_TEST_INT_num(sk)); in ExpectStackEquals()
65 const TEST_INT *obj = sk_TEST_INT_value(sk, i); in ExpectStackEquals()
77 EXPECT_FALSE(sk_TEST_INT_value(sk, vec.size())); in ExpectStackEquals()
78 EXPECT_FALSE(sk_TEST_INT_value(sk, vec.size() + 1)); in ExpectStackEquals()
82 bssl::UniquePtr<STACK_OF(TEST_INT)> sk(sk_TEST_INT_new_null()); in TEST() local
83 ASSERT_TRUE(sk); in TEST()
86 ExpectStackEquals(sk.get(), {}); in TEST()
89 EXPECT_FALSE(sk_TEST_INT_pop(sk.get())); in TEST()
90 EXPECT_FALSE(sk_TEST_INT_shift(sk.get())); in TEST()
91 EXPECT_FALSE(sk_TEST_INT_delete(sk.get(), 0)); in TEST()
97 ASSERT_TRUE(bssl::PushToStack(sk.get(), std::move(value))); in TEST()
100 ExpectStackEquals(sk.get(), {0, 1, 2, 3, 4, 5}); in TEST()
107 ASSERT_TRUE(sk_TEST_INT_insert(sk.get(), value.get(), 4)); in TEST()
110 ExpectStackEquals(sk.get(), {0, 1, 2, 3, 6, 4, 5}); in TEST()
116 EXPECT_FALSE(sk_TEST_INT_find(sk.get(), &index, value.get())); in TEST()
117 ASSERT_TRUE(sk_TEST_INT_find(sk.get(), &index, raw)); in TEST()
123 ASSERT_TRUE(sk_TEST_INT_insert(sk.get(), value.get(), 7)); in TEST()
126 ExpectStackEquals(sk.get(), {0, 1, 2, 3, 6, 4, 5, 7}); in TEST()
131 ASSERT_TRUE(sk_TEST_INT_insert(sk.get(), value.get(), 999)); in TEST()
134 ExpectStackEquals(sk.get(), {0, 1, 2, 3, 6, 4, 5, 7, 8}); in TEST()
137 bssl::UniquePtr<TEST_INT> removed(sk_TEST_INT_pop(sk.get())); in TEST()
139 ExpectStackEquals(sk.get(), {0, 1, 2, 3, 6, 4, 5, 7}); in TEST()
141 removed.reset(sk_TEST_INT_shift(sk.get())); in TEST()
143 ExpectStackEquals(sk.get(), {1, 2, 3, 6, 4, 5, 7}); in TEST()
145 removed.reset(sk_TEST_INT_delete(sk.get(), 2)); in TEST()
147 ExpectStackEquals(sk.get(), {1, 2, 6, 4, 5, 7}); in TEST()
150 removed.reset(sk_TEST_INT_delete_ptr(sk.get(), raw)); in TEST()
152 ExpectStackEquals(sk.get(), {1, 2, 4, 5, 7}); in TEST()
157 EXPECT_FALSE(sk_TEST_INT_delete_ptr(sk.get(), value.get())); in TEST()
160 ASSERT_TRUE(sk_TEST_INT_insert(sk.get(), nullptr, 0)); in TEST()
161 ExpectStackEquals(sk.get(), {kNull, 1, 2, 4, 5, 7}); in TEST()
165 sk.get(), in TEST()
173 ShallowStack shallow(sk_TEST_INT_dup(sk.get())); in TEST()
175 ASSERT_EQ(sk_TEST_INT_num(sk.get()), sk_TEST_INT_num(shallow.get())); in TEST()
176 for (size_t i = 0; i < sk_TEST_INT_num(sk.get()); i++) { in TEST()
177 EXPECT_EQ(sk_TEST_INT_value(sk.get(), i), in TEST()
182 EXPECT_FALSE(sk_TEST_INT_deep_copy(sk.get(), in TEST()
191 ShallowStack shallow2(sk_TEST_INT_dup(sk.get())); in TEST()
198 bssl::UniquePtr<STACK_OF(TEST_INT)> sk(sk_TEST_INT_new_null()); in TEST() local
199 ASSERT_TRUE(sk); in TEST()
206 ASSERT_TRUE(bssl::PushToStack(sk.get(), std::move(value))); in TEST()
209 ExpectStackEquals(sk.get(), expected); in TEST()
233 bssl::UniquePtr<STACK_OF(TEST_INT)> sk(sk_TEST_INT_new(compare)); in TEST() local
234 ASSERT_TRUE(sk); in TEST()
238 ASSERT_TRUE(bssl::PushToStack(sk.get(), std::move(value))); in TEST()
242 EXPECT_FALSE(sk_TEST_INT_is_sorted(sk.get())); in TEST()
248 EXPECT_FALSE(sk_TEST_INT_find(sk.get(), &index, ten.get())); in TEST()
252 ASSERT_TRUE(sk_TEST_INT_find(sk.get(), &index, three.get())); in TEST()
253 EXPECT_EQ(3, *sk_TEST_INT_value(sk.get(), index)); in TEST()
255 sk_TEST_INT_sort(sk.get()); in TEST()
256 EXPECT_TRUE(sk_TEST_INT_is_sorted(sk.get())); in TEST()
257 ExpectStackEquals(sk.get(), vec_sorted); in TEST()
261 sk_TEST_INT_sort(sk.get()); in TEST()
263 EXPECT_TRUE(sk_TEST_INT_is_sorted(sk.get())); in TEST()
264 ExpectStackEquals(sk.get(), vec_sorted); in TEST()
268 EXPECT_FALSE(sk_TEST_INT_find(sk.get(), &index, ten.get())); in TEST()
271 ASSERT_TRUE(sk_TEST_INT_find(sk.get(), &index, three.get())); in TEST()
276 sk.get(), in TEST()
284 ShallowStack copy2(sk_TEST_INT_dup(sk.get())); in TEST()
291 TEST_INT_free(sk_TEST_INT_delete(sk.get(), 0)); in TEST()
292 EXPECT_TRUE(sk_TEST_INT_is_sorted(sk.get())); in TEST()
295 sk_TEST_INT_set_cmp_func(sk.get(), compare_reverse); in TEST()
296 EXPECT_FALSE(sk_TEST_INT_is_sorted(sk.get())); in TEST()
297 ASSERT_TRUE(sk_TEST_INT_find(sk.get(), &index, three.get())); in TEST()
300 sk_TEST_INT_sort(sk.get()); in TEST()
301 ExpectStackEquals(sk.get(), {6, 5, 4, 3, 2, 1}); in TEST()
302 ASSERT_TRUE(sk_TEST_INT_find(sk.get(), &index, three.get())); in TEST()
308 ASSERT_TRUE(bssl::PushToStack(sk.get(), std::move(tmp))); in TEST()
309 EXPECT_FALSE(sk_TEST_INT_is_sorted(sk.get())); in TEST()
310 ASSERT_TRUE(sk_TEST_INT_find(sk.get(), &index, ten.get())); in TEST()
317 bssl::UniquePtr<STACK_OF(TEST_INT)> sk(sk_TEST_INT_new(compare)); in TEST() local
320 ASSERT_TRUE(bssl::PushToStack(sk.get(), std::move(value))); in TEST()
324 ASSERT_TRUE(bssl::PushToStack(sk.get(), std::move(value))); in TEST()
327 const TEST_INT *two = sk_TEST_INT_value(sk.get(), 1); in TEST()
330 ASSERT_TRUE(sk_TEST_INT_find(sk.get(), &index, two)); in TEST()
334 sk_TEST_INT_set_cmp_func(sk.get(), compare); in TEST()
335 EXPECT_FALSE(sk_TEST_INT_is_sorted(sk.get())); in TEST()
336 ASSERT_TRUE(sk_TEST_INT_find(sk.get(), &index, two)); in TEST()
340 sk_TEST_INT_sort(sk.get()); in TEST()
341 EXPECT_TRUE(sk_TEST_INT_is_sorted(sk.get())); in TEST()
342 ASSERT_TRUE(sk_TEST_INT_find(sk.get(), &index, two)); in TEST()
346 sk_TEST_INT_set_cmp_func(sk.get(), compare_reverse); in TEST()
347 sk_TEST_INT_sort(sk.get()); in TEST()
348 EXPECT_TRUE(sk_TEST_INT_is_sorted(sk.get())); in TEST()
349 ASSERT_TRUE(sk_TEST_INT_find(sk.get(), &index, two)); in TEST()
362 bssl::UniquePtr<STACK_OF(TEST_INT)> sk(sk_TEST_INT_new(compare)); in TEST() local
363 ASSERT_TRUE(sk); in TEST()
367 ASSERT_TRUE(bssl::PushToStack(sk.get(), std::move(value))); in TEST()
372 ASSERT_TRUE(bssl::PushToStack(sk.get(), std::move(value))); in TEST()
377 ASSERT_TRUE(bssl::PushToStack(sk.get(), std::move(value))); in TEST()
379 sk_TEST_INT_sort(sk.get()); in TEST()
385 int found = sk_TEST_INT_find(sk.get(), &idx, key.get()); in TEST()