Debian Codegraph @

debian/rust-vendor/aws-lc-sys/aws-lc/crypto/stack/stack_test.cc

raw
1 // Copyright (c) 2018, Google Inc.
2 // SPDX-License-Identifier: ISC
3
4 #include <openssl/stack.h>
5
6 #include <limits.h>
7
8 #include <algorithm>
9 #include <memory>
10 #include <utility>
11 #include <vector>
12
13 #include <gtest/gtest.h>
14
15 #include <openssl/mem.h>
16
17
18 // Define a custom stack type for testing.
19 using TEST_INT = int;
20
21 static void TEST_INT_free(TEST_INT *x) { OPENSSL_free(x); }
22
23 BSSL_NAMESPACE_BEGIN
24 BORINGSSL_MAKE_DELETER(TEST_INT, TEST_INT_free)
25 BSSL_NAMESPACE_END
26
27 static bssl::UniquePtr<TEST_INT> TEST_INT_new(int x) {
28 bssl::UniquePtr<TEST_INT> ret(
29 static_cast<TEST_INT *>(OPENSSL_malloc(sizeof(TEST_INT))));
30 if (!ret) {
31 return nullptr;
32 }
33 *ret = x;
34 return ret;
35 }
36
37 DEFINE_STACK_OF(TEST_INT)
38
39 struct ShallowStackDeleter {
40 void operator()(STACK_OF(TEST_INT) *sk) const { sk_TEST_INT_free(sk); }
41 };
42
43 using ShallowStack = std::unique_ptr<STACK_OF(TEST_INT), ShallowStackDeleter>;
44
45 // kNull is treated as a nullptr expectation for purposes of ExpectStackEquals.
46 // The tests in this file will never use it as a test value.
47 static const int kNull = INT_MIN;
48
49 static void ExpectStackEquals(const STACK_OF(TEST_INT) *sk,
50 const std::vector<int> &vec) {
51 EXPECT_EQ(vec.size(), sk_TEST_INT_num(sk));
52 for (size_t i = 0; i < vec.size(); i++) {
53 SCOPED_TRACE(i);
54 const TEST_INT *obj = sk_TEST_INT_value(sk, i);
55 if (vec[i] == kNull) {
56 EXPECT_FALSE(obj);
57 } else {
58 EXPECT_TRUE(obj);
59 if (obj) {
60 EXPECT_EQ(vec[i], *obj);
61 }
62 }
63 }
64
65 // Reading out-of-bounds fails.
66 EXPECT_FALSE(sk_TEST_INT_value(sk, vec.size()));
67 EXPECT_FALSE(sk_TEST_INT_value(sk, vec.size() + 1));
68 }
69
70 TEST(StackTest, Basic) {
71 bssl::UniquePtr<STACK_OF(TEST_INT)> sk(sk_TEST_INT_new_null());
72 ASSERT_TRUE(sk);
73
74 // The stack starts out empty.
75 ExpectStackEquals(sk.get(), {});
76
77 // Removing elements from an empty stack does nothing.
78 EXPECT_FALSE(sk_TEST_INT_pop(sk.get()));
79 EXPECT_FALSE(sk_TEST_INT_shift(sk.get()));
80 EXPECT_FALSE(sk_TEST_INT_delete(sk.get(), 0));
81
82 // Push some elements.
83 for (int i = 0; i < 6; i++) {
84 auto value = TEST_INT_new(i);
85 ASSERT_TRUE(value);
86 ASSERT_TRUE(bssl::PushToStack(sk.get(), std::move(value)));
87 }
88
89 ExpectStackEquals(sk.get(), {0, 1, 2, 3, 4, 5});
90
91 // Items may be inserted in the middle.
92 auto value = TEST_INT_new(6);
93 ASSERT_TRUE(value);
94 // Hold on to the object for later.
95 TEST_INT *raw = value.get();
96 ASSERT_TRUE(sk_TEST_INT_insert(sk.get(), value.get(), 4));
97 value.release(); // sk_TEST_INT_insert takes ownership on success.
98
99 ExpectStackEquals(sk.get(), {0, 1, 2, 3, 6, 4, 5});
100
101 // Without a comparison function, find searches by pointer.
102 value = TEST_INT_new(6);
103 ASSERT_TRUE(value);
104 size_t index;
105 EXPECT_FALSE(sk_TEST_INT_find_awslc(sk.get(), &index, value.get()));
106 EXPECT_EQ(-1, sk_TEST_INT_find(sk.get(), value.get()));
107 EXPECT_TRUE(sk_TEST_INT_find_awslc(sk.get(), &index, raw));
108 EXPECT_EQ(4UL, index);
109 EXPECT_EQ((int) index, sk_TEST_INT_find(sk.get(), raw));
110
111 // sk_TEST_INT_insert can also insert values at the end.
112 value = TEST_INT_new(7);
113 ASSERT_TRUE(value);
114 ASSERT_TRUE(sk_TEST_INT_insert(sk.get(), value.get(), 7));
115 value.release(); // sk_TEST_INT_insert takes ownership on success.
116
117 ExpectStackEquals(sk.get(), {0, 1, 2, 3, 6, 4, 5, 7});
118
119 // Out-of-bounds indices are clamped.
120 value = TEST_INT_new(8);
121 ASSERT_TRUE(value);
122 ASSERT_TRUE(sk_TEST_INT_insert(sk.get(), value.get(), 999));
123 value.release(); // sk_TEST_INT_insert takes ownership on success.
124
125 ExpectStackEquals(sk.get(), {0, 1, 2, 3, 6, 4, 5, 7, 8});
126
127 // Test removing elements from various places.
128 bssl::UniquePtr<TEST_INT> removed(sk_TEST_INT_pop(sk.get()));
129 EXPECT_EQ(8, *removed);
130 ExpectStackEquals(sk.get(), {0, 1, 2, 3, 6, 4, 5, 7});
131
132 removed.reset(sk_TEST_INT_shift(sk.get()));
133 EXPECT_EQ(0, *removed);
134 ExpectStackEquals(sk.get(), {1, 2, 3, 6, 4, 5, 7});
135
136 removed.reset(sk_TEST_INT_delete(sk.get(), 2));
137 EXPECT_EQ(3, *removed);
138 ExpectStackEquals(sk.get(), {1, 2, 6, 4, 5, 7});
139
140 // Objects may also be deleted by pointer.
141 removed.reset(sk_TEST_INT_delete_ptr(sk.get(), raw));
142 EXPECT_EQ(raw, removed.get());
143 ExpectStackEquals(sk.get(), {1, 2, 4, 5, 7});
144
145 // Test using "unshift" to insert at the beginning.
146 value = TEST_INT_new(8);
147 ASSERT_TRUE(value);
148 ASSERT_TRUE(sk_TEST_INT_unshift(sk.get(), value.get()));
149 value.release(); // sk_TEST_INT_unshift takes ownership on success.
150 ExpectStackEquals(sk.get(), {8, 1, 2, 4, 5, 7});
151 removed.reset(sk_TEST_INT_shift(sk.get()));
152 EXPECT_EQ(8, *removed);
153 ExpectStackEquals(sk.get(), {1, 2, 4, 5, 7});
154
155 // Deleting is a no-op is the object is not found.
156 value = TEST_INT_new(100);
157 ASSERT_TRUE(value);
158 EXPECT_FALSE(sk_TEST_INT_delete_ptr(sk.get(), value.get()));
159
160 // Insert nullptr to test deep copy handling of it.
161 ASSERT_TRUE(sk_TEST_INT_insert(sk.get(), nullptr, 0));
162 ExpectStackEquals(sk.get(), {kNull, 1, 2, 4, 5, 7});
163
164 // Test both deep and shallow copies.
165 bssl::UniquePtr<STACK_OF(TEST_INT)> copy(sk_TEST_INT_deep_copy(
166 sk.get(),
167 [](const TEST_INT *x) -> TEST_INT * {
168 return x == nullptr ? nullptr : TEST_INT_new(*x).release();
169 },
170 TEST_INT_free));
171 ASSERT_TRUE(copy);
172 ExpectStackEquals(copy.get(), {kNull, 1, 2, 4, 5, 7});
173
174 ShallowStack shallow(sk_TEST_INT_dup(sk.get()));
175 ASSERT_TRUE(shallow);
176 ASSERT_EQ(sk_TEST_INT_num(sk.get()), sk_TEST_INT_num(shallow.get()));
177 for (size_t i = 0; i < sk_TEST_INT_num(sk.get()); i++) {
178 EXPECT_EQ(sk_TEST_INT_value(sk.get(), i),
179 sk_TEST_INT_value(shallow.get(), i));
180 }
181
182 // Deep copies may fail. This should clean up temporaries.
183 EXPECT_FALSE(sk_TEST_INT_deep_copy(
184 sk.get(),
185 [](const TEST_INT *x) -> TEST_INT * {
186 return x == nullptr || *x == 4 ? nullptr : TEST_INT_new(*x).release();
187 },
188 TEST_INT_free));
189
190 // sk_TEST_INT_zero clears a stack, but does not free the elements.
191 ShallowStack shallow2(sk_TEST_INT_dup(sk.get()));
192 ASSERT_TRUE(shallow2);
193 sk_TEST_INT_zero(shallow2.get());
194 ExpectStackEquals(shallow2.get(), {});
195 }
196
197 TEST(StackTest, BigStack) {
198 bssl::UniquePtr<STACK_OF(TEST_INT)> sk(sk_TEST_INT_new_null());
199 ASSERT_TRUE(sk);
200
201 std::vector<int> expected;
202 static const int kCount = 100000;
203 for (int i = 0; i < kCount; i++) {
204 auto value = TEST_INT_new(i);
205 ASSERT_TRUE(value);
206 ASSERT_TRUE(bssl::PushToStack(sk.get(), std::move(value)));
207 expected.push_back(i);
208 }
209 ExpectStackEquals(sk.get(), expected);
210 }
211
212 static uint64_t g_compare_count = 0;
213
214 static int compare(const TEST_INT *const *a, const TEST_INT *const *b) {
215 g_compare_count++;
216 if (**a < **b) {
217 return -1;
218 }
219 if (**a > **b) {
220 return 1;
221 }
222 return 0;
223 }
224
225 static int compare_reverse(const TEST_INT *const *a, const TEST_INT *const *b) {
226 return -compare(a, b);
227 }
228
229 TEST(StackTest, Sorted) {
230 std::vector<int> vec_sorted = {0, 1, 2, 3, 4, 5, 6};
231 std::vector<int> vec = vec_sorted;
232 do {
233 bssl::UniquePtr<STACK_OF(TEST_INT)> sk(sk_TEST_INT_new(compare));
234 ASSERT_TRUE(sk);
235 for (int v : vec) {
236 auto value = TEST_INT_new(v);
237 ASSERT_TRUE(value);
238 ASSERT_TRUE(bssl::PushToStack(sk.get(), std::move(value)));
239 }
240
241 // The stack is not (known to be) sorted.
242 EXPECT_FALSE(sk_TEST_INT_is_sorted(sk.get()));
243
244 // With a comparison function, find matches by value.
245 auto ten = TEST_INT_new(10);
246 ASSERT_TRUE(ten);
247 size_t index;
248 EXPECT_FALSE(sk_TEST_INT_find_awslc(sk.get(), &index, ten.get()));
249 EXPECT_EQ(-1, sk_TEST_INT_find(sk.get(), ten.get()));
250
251 auto three = TEST_INT_new(3);
252 ASSERT_TRUE(three);
253 ASSERT_TRUE(sk_TEST_INT_find_awslc(sk.get(), &index, three.get()));
254 EXPECT_EQ(3, *sk_TEST_INT_value(sk.get(), index));
255 EXPECT_EQ((int) index, sk_TEST_INT_find(sk.get(), three.get()));
256
257 sk_TEST_INT_sort(sk.get());
258 EXPECT_TRUE(sk_TEST_INT_is_sorted(sk.get()));
259 ExpectStackEquals(sk.get(), vec_sorted);
260
261 // Sorting an already-sorted list is a no-op.
262 uint64_t old_compare_count = g_compare_count;
263 sk_TEST_INT_sort(sk.get());
264 EXPECT_EQ(old_compare_count, g_compare_count);
265 EXPECT_TRUE(sk_TEST_INT_is_sorted(sk.get()));
266 ExpectStackEquals(sk.get(), vec_sorted);
267
268 // When sorted, find uses binary search.
269 ASSERT_TRUE(ten);
270 EXPECT_FALSE(sk_TEST_INT_find_awslc(sk.get(), &index, ten.get()));
271 EXPECT_EQ(-1, sk_TEST_INT_find(sk.get(), ten.get()));
272
273 ASSERT_TRUE(three);
274 ASSERT_TRUE(sk_TEST_INT_find_awslc(sk.get(), &index, three.get()));
275 EXPECT_EQ(3u, index);
276 EXPECT_EQ((int) index, sk_TEST_INT_find(sk.get(), three.get()));
277
278 // Copies preserve comparison and sorted information.
279 bssl::UniquePtr<STACK_OF(TEST_INT)> copy(sk_TEST_INT_deep_copy(
280 sk.get(),
281 [](const TEST_INT *x) -> TEST_INT * {
282 return TEST_INT_new(*x).release();
283 },
284 TEST_INT_free));
285 ASSERT_TRUE(copy);
286 EXPECT_TRUE(sk_TEST_INT_is_sorted(copy.get()));
287 ASSERT_TRUE(sk_TEST_INT_find_awslc(copy.get(), &index, three.get()));
288 EXPECT_EQ(3u, index);
289 EXPECT_EQ((int) index, sk_TEST_INT_find(copy.get(), three.get()));
290
291 ShallowStack copy2(sk_TEST_INT_dup(sk.get()));
292 ASSERT_TRUE(copy2);
293 EXPECT_TRUE(sk_TEST_INT_is_sorted(copy2.get()));
294 ASSERT_TRUE(sk_TEST_INT_find_awslc(copy2.get(), &index, three.get()));
295 EXPECT_EQ(3u, index);
296 EXPECT_EQ((int) index, sk_TEST_INT_find(copy.get(), three.get()));
297
298 // Removing elements does not affect sortedness.
299 TEST_INT_free(sk_TEST_INT_delete(sk.get(), 0));
300 EXPECT_TRUE(sk_TEST_INT_is_sorted(sk.get()));
301 EXPECT_TRUE(sk_TEST_INT_is_sorted(sk.get()));
302
303 // Changing the comparison function invalidates sortedness.
304 sk_TEST_INT_set_cmp_func(sk.get(), compare_reverse);
305 EXPECT_FALSE(sk_TEST_INT_is_sorted(sk.get()));
306 ASSERT_TRUE(sk_TEST_INT_find_awslc(sk.get(), &index, three.get()));
307 EXPECT_EQ(2u, index);
308 EXPECT_EQ((int) index, sk_TEST_INT_find(sk.get(), three.get()));
309
310 sk_TEST_INT_sort(sk.get());
311 ExpectStackEquals(sk.get(), {6, 5, 4, 3, 2, 1});
312 ASSERT_TRUE(sk_TEST_INT_find_awslc(sk.get(), &index, three.get()));
313 EXPECT_EQ(3u, index);
314 EXPECT_EQ((int) index, sk_TEST_INT_find(sk.get(), three.get()));
315
316 // Inserting a new element invalidates sortedness.
317 auto tmp = TEST_INT_new(10);
318 ASSERT_TRUE(tmp);
319 ASSERT_TRUE(bssl::PushToStack(sk.get(), std::move(tmp)));
320 EXPECT_FALSE(sk_TEST_INT_is_sorted(sk.get()));
321 ASSERT_TRUE(sk_TEST_INT_find_awslc(sk.get(), &index, ten.get()));
322 EXPECT_EQ(6u, index);
323 EXPECT_EQ((int) index, sk_TEST_INT_find(sk.get(), ten.get()));
324 } while (std::next_permutation(vec.begin(), vec.end()));
325 }
326
327 // sk_*_find_awslc should return the first matching element in all cases.
328 TEST(StackTest, FindFirst) {
329 bssl::UniquePtr<STACK_OF(TEST_INT)> sk(sk_TEST_INT_new(compare));
330 ASSERT_TRUE(sk);
331 auto value = TEST_INT_new(1);
332 ASSERT_TRUE(value);
333 ASSERT_TRUE(bssl::PushToStack(sk.get(), std::move(value)));
334 for (int i = 0; i < 10; i++) {
335 value = TEST_INT_new(2);
336 ASSERT_TRUE(value);
337 ASSERT_TRUE(bssl::PushToStack(sk.get(), std::move(value)));
338 }
339
340 const TEST_INT *two = sk_TEST_INT_value(sk.get(), 1);
341 // Pointer-based equality.
342 size_t index;
343 ASSERT_TRUE(sk_TEST_INT_find_awslc(sk.get(), &index, two));
344 EXPECT_EQ(1u, index);
345 EXPECT_EQ((int) index, sk_TEST_INT_find(sk.get(), two));
346
347 // Comparator-based equality, unsorted.
348 sk_TEST_INT_set_cmp_func(sk.get(), compare);
349 EXPECT_FALSE(sk_TEST_INT_is_sorted(sk.get()));
350 ASSERT_TRUE(sk_TEST_INT_find_awslc(sk.get(), &index, two));
351 EXPECT_EQ(1u, index);
352 EXPECT_EQ((int) index, sk_TEST_INT_find(sk.get(), two));
353
354 // Comparator-based equality, sorted.
355 sk_TEST_INT_sort(sk.get());
356 EXPECT_TRUE(sk_TEST_INT_is_sorted(sk.get()));
357 ASSERT_TRUE(sk_TEST_INT_find_awslc(sk.get(), &index, two));
358 EXPECT_EQ(1u, index);
359 EXPECT_EQ((int) index, sk_TEST_INT_find(sk.get(), two));
360
361 // Comparator-based equality, sorted and at the front.
362 sk_TEST_INT_set_cmp_func(sk.get(), compare_reverse);
363 sk_TEST_INT_sort(sk.get());
364 EXPECT_TRUE(sk_TEST_INT_is_sorted(sk.get()));
365 ASSERT_TRUE(sk_TEST_INT_find_awslc(sk.get(), &index, two));
366 EXPECT_EQ(0u, index);
367 EXPECT_EQ((int) index, sk_TEST_INT_find(sk.get(), two));
368 }
369
370 // Exhaustively test the binary search.
371 TEST(StackTest, BinarySearch) {
372 static const size_t kCount = 100;
373 for (size_t i = 0; i < kCount; i++) {
374 SCOPED_TRACE(i);
375 for (size_t j = i; j <= kCount; j++) {
376 SCOPED_TRACE(j);
377 // Make a stack where [0, i) are below, [i, j) match, and [j, kCount) are
378 // above.
379 bssl::UniquePtr<STACK_OF(TEST_INT)> sk(sk_TEST_INT_new(compare));
380 ASSERT_TRUE(sk);
381 for (size_t k = 0; k < i; k++) {
382 auto value = TEST_INT_new(-1);
383 ASSERT_TRUE(value);
384 ASSERT_TRUE(bssl::PushToStack(sk.get(), std::move(value)));
385 }
386 for (size_t k = i; k < j; k++) {
387 auto value = TEST_INT_new(0);
388 ASSERT_TRUE(value);
389 ASSERT_TRUE(bssl::PushToStack(sk.get(), std::move(value)));
390 }
391 for (size_t k = j; k < kCount; k++) {
392 auto value = TEST_INT_new(1);
393 ASSERT_TRUE(value);
394 ASSERT_TRUE(bssl::PushToStack(sk.get(), std::move(value)));
395 }
396 sk_TEST_INT_sort(sk.get());
397
398 auto key = TEST_INT_new(0);
399 ASSERT_TRUE(key);
400
401 size_t idx;
402 int found = sk_TEST_INT_find_awslc(sk.get(), &idx, key.get());
403 if (i == j) {
404 EXPECT_FALSE(found);
405 EXPECT_EQ(-1, sk_TEST_INT_find(sk.get(), key.get()));
406 } else {
407 ASSERT_TRUE(found);
408 EXPECT_EQ(i, idx);
409 EXPECT_EQ((int) idx, sk_TEST_INT_find(sk.get(), key.get()));
410 }
411 }
412 }
413 }
414
415 TEST(StackTest, DeleteIf) {
416 bssl::UniquePtr<STACK_OF(TEST_INT)> sk(sk_TEST_INT_new(compare));
417 ASSERT_TRUE(sk);
418 for (int v : {1, 9, 2, 8, 3, 7, 4, 6, 5}) {
419 auto obj = TEST_INT_new(v);
420 ASSERT_TRUE(obj);
421 ASSERT_TRUE(bssl::PushToStack(sk.get(), std::move(obj)));
422 }
423
424 auto keep_only_multiples = [](TEST_INT *x, void *data) {
425 auto d = static_cast<const int *>(data);
426 if (*x % *d == 0) {
427 return 0;
428 }
429 TEST_INT_free(x);
430 return 1;
431 };
432
433 int d = 2;
434 sk_TEST_INT_delete_if(sk.get(), keep_only_multiples, &d);
435 ExpectStackEquals(sk.get(), {2, 8, 4, 6});
436
437 EXPECT_FALSE(sk_TEST_INT_is_sorted(sk.get()));
438 sk_TEST_INT_sort(sk.get());
439 ExpectStackEquals(sk.get(), {2, 4, 6, 8});
440 EXPECT_TRUE(sk_TEST_INT_is_sorted(sk.get()));
441
442 // Keep only multiples of four.
443 d = 4;
444 sk_TEST_INT_delete_if(sk.get(), keep_only_multiples, &d);
445 ExpectStackEquals(sk.get(), {4, 8});
446
447 // Removing elements preserves the sorted bit.
448 EXPECT_TRUE(sk_TEST_INT_is_sorted(sk.get()));
449
450 // Delete everything.
451 d = 16;
452 sk_TEST_INT_delete_if(sk.get(), keep_only_multiples, &d);
453 ExpectStackEquals(sk.get(), {});
454 EXPECT_TRUE(sk_TEST_INT_is_sorted(sk.get()));
455 }
456
457 TEST(StackTest, IsSorted) {
458 bssl::UniquePtr<STACK_OF(TEST_INT)> sk(sk_TEST_INT_new_null());
459 ASSERT_TRUE(sk);
460 EXPECT_FALSE(sk_TEST_INT_is_sorted(sk.get()));
461
462 // Empty lists are always known to be sorted.
463 sk_TEST_INT_set_cmp_func(sk.get(), compare);
464 EXPECT_TRUE(sk_TEST_INT_is_sorted(sk.get()));
465
466 // As are one-element lists.
467 auto value = TEST_INT_new(2);
468 ASSERT_TRUE(value);
469 ASSERT_TRUE(bssl::PushToStack(sk.get(), std::move(value)));
470 EXPECT_TRUE(sk_TEST_INT_is_sorted(sk.get()));
471
472 // Two-element lists require an explicit sort.
473 value = TEST_INT_new(1);
474 ASSERT_TRUE(value);
475 ASSERT_TRUE(bssl::PushToStack(sk.get(), std::move(value)));
476 EXPECT_FALSE(sk_TEST_INT_is_sorted(sk.get()));
477
478 // The list is now sorted.
479 sk_TEST_INT_sort(sk.get());
480 EXPECT_TRUE(sk_TEST_INT_is_sorted(sk.get()));
481
482 // After changing the comparison function, it no longer is sorted.
483 sk_TEST_INT_set_cmp_func(sk.get(), compare_reverse);
484 EXPECT_FALSE(sk_TEST_INT_is_sorted(sk.get()));
485
486 sk_TEST_INT_sort(sk.get());
487 EXPECT_TRUE(sk_TEST_INT_is_sorted(sk.get()));
488
489 // But, starting from one element, switching the comparison function preserves
490 // the sorted bit.
491 TEST_INT_free(sk_TEST_INT_pop(sk.get()));
492 EXPECT_TRUE(sk_TEST_INT_is_sorted(sk.get()));
493 sk_TEST_INT_set_cmp_func(sk.get(), compare);
494 EXPECT_TRUE(sk_TEST_INT_is_sorted(sk.get()));
495
496 // Without a comparison function, the list cannot be sorted.
497 sk_TEST_INT_set_cmp_func(sk.get(), nullptr);
498 EXPECT_FALSE(sk_TEST_INT_is_sorted(sk.get()));
499 }
500
501 TEST(StackTest, NullIsEmpty) {
502 EXPECT_EQ(0u, sk_TEST_INT_num(nullptr));
503
504 EXPECT_EQ(nullptr, sk_TEST_INT_value(nullptr, 0));
505 EXPECT_EQ(nullptr, sk_TEST_INT_value(nullptr, 1));
506
507 bssl::UniquePtr<TEST_INT> value = TEST_INT_new(6);
508 ASSERT_TRUE(value);
509 // The return value of -1 is compatible with OpenSSL
510 // BoringSSL's function takes 3 arguments in this case
511 // and returns False.
512 EXPECT_EQ(-1, sk_TEST_INT_find(nullptr, value.get()));
513 }