| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
#include <aws/common/string.h> |
| 7 |
#include <proof_helpers/make_common_data_structures.h> |
| 8 |
#include <proof_helpers/utils.h> |
| 9 |
|
| 10 |
void aws_string_eq_harness() { |
| 11 |
struct aws_string *str_a = nondet_allocate_string_bounded_length(MAX_STRING_LEN); |
| 12 |
struct aws_string *str_b = nondet_bool() ? str_a : nondet_allocate_string_bounded_length(MAX_STRING_LEN); |
| 13 |
__CPROVER_assume(IMPLIES(str_a != NULL, aws_string_is_valid(str_a))); |
| 14 |
__CPROVER_assume(IMPLIES(str_b != NULL, aws_string_is_valid(str_b))); |
| 15 |
if (aws_string_eq(str_a, str_b) && str_a && str_b) { |
| 16 |
assert(str_a->len == str_b->len); |
| 17 |
assert_bytes_match(str_a->bytes, str_b->bytes, str_a->len); |
| 18 |
assert(aws_string_is_valid(str_a)); |
| 19 |
assert(aws_string_is_valid(str_b)); |
| 20 |
} |
| 21 |
} |