isSameMemory checks if two slices contain the same memory pointer (meaning one is a subslice of the other, with possibly differing lengths/capacities). Test helper for SYS-REQ-014.
(a, b []byte)
| 140 | // subslice of the other, with possibly differing lengths/capacities). |
| 141 | // Test helper for SYS-REQ-014. |
| 142 | func isSameMemory(a, b []byte) bool { |
| 143 | if cap(a) == 0 || cap(b) == 0 { |
| 144 | return cap(a) == cap(b) |
| 145 | } else if a, b = a[:1], b[:1]; a[0] != b[0] { |
| 146 | return false |
| 147 | } else { |
| 148 | a[0]++ |
| 149 | same := (a[0] == b[0]) |
| 150 | a[0]-- |
| 151 | return same |
| 152 | } |
| 153 | |
| 154 | } |
| 155 | |
| 156 | // Verifies: SYS-REQ-014 [malformed] |
| 157 | // MCDC SYS-REQ-014: N/A |
no outgoing calls
no test coverage detected
searching dependent graphs…