Commit 82da845
authored
CStr Safety invariant & Harnesses for
Towards #150
### Changes
* Added a `CStr` Safety Invariant
* Added a harness for `from_bytes_until_nul`, the harness covers:
* The input slice contains a single null byte at the end;
* The input slice contains no null bytes;
* The input slice contains intermediate null bytes
### Discussion
* [Safety invariant
implementation](#150 (comment))
* [Input array
generation](#181)
### Verification Result
`./scripts/run-kani.sh --kani-args --harness ffi::c_str::verify`
```
// array size 16
Checking harness ffi::c_str::verify::check_from_bytes_until_nul...
VERIFICATION RESULT:
** 0 of 140 failed (5 unreachable)
VERIFICATION:- SUCCESSFUL
Verification Time: 7.3023376s
Complete - 1 successfully verified harnesses, 0 failures, 1 total.
```
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.from_bytes_until_nul (#180)1 parent 07318df commit 82da845
1 file changed
+43
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
12 | 17 | | |
13 | 18 | | |
14 | 19 | | |
| |||
207 | 212 | | |
208 | 213 | | |
209 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
210 | 231 | | |
211 | 232 | | |
212 | 233 | | |
| |||
833 | 854 | | |
834 | 855 | | |
835 | 856 | | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
0 commit comments