Test helper for SYS-REQ-015.
(bytes []byte)
| 151 | |
| 152 | // Test helper for SYS-REQ-015. |
| 153 | func parseIntOverflows(bytes []byte) (v int64, ok bool) { |
| 154 | if len(bytes) == 0 { |
| 155 | return 0, false |
| 156 | } |
| 157 | |
| 158 | var neg bool = false |
| 159 | if bytes[0] == '-' { |
| 160 | neg = true |
| 161 | bytes = bytes[1:] |
| 162 | } |
| 163 | |
| 164 | for _, c := range bytes { |
| 165 | if c >= '0' && c <= '9' { |
| 166 | v = (10 * v) + int64(c-'0') |
| 167 | } else { |
| 168 | return 0, false |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | if neg { |
| 173 | return -v, true |
| 174 | } else { |
| 175 | return v, true |
| 176 | } |
| 177 | } |
no outgoing calls
no test coverage detected