============================================================================= ParseInt boundary values (SYS-REQ-058, SYS-REQ-059, SYS-REQ-064) ============================================================================= Verifies: SYS-REQ-058 [boundary] ParseInt at exact int64 boundary values shall
(t *testing.T)
| 507 | // Verifies: SYS-REQ-058 [boundary] |
| 508 | // ParseInt at exact int64 boundary values shall return correct values. |
| 509 | func TestParseIntBoundaryValues(t *testing.T) { |
| 510 | // int64 max: 9223372036854775807 |
| 511 | maxVal, err := ParseInt([]byte("9223372036854775807")) |
| 512 | if err != nil { |
| 513 | t.Fatalf("ParseInt(int64 max) error: %v", err) |
| 514 | } |
| 515 | if maxVal != math.MaxInt64 { |
| 516 | t.Fatalf("ParseInt(int64 max) = %d, want %d", maxVal, int64(math.MaxInt64)) |
| 517 | } |
| 518 | |
| 519 | // int64 min: -9223372036854775808 |
| 520 | minVal, err := ParseInt([]byte("-9223372036854775808")) |
| 521 | if err != nil { |
| 522 | t.Fatalf("ParseInt(int64 min) error: %v", err) |
| 523 | } |
| 524 | if minVal != math.MinInt64 { |
| 525 | t.Fatalf("ParseInt(int64 min) = %d, want %d", minVal, int64(math.MinInt64)) |
| 526 | } |
| 527 | } |
| 528 | |
| 529 | // Verifies: SYS-REQ-059 [boundary] |
| 530 | // ParseInt one beyond int64 range shall return OverflowIntegerError. |
nothing calls this directly
no test coverage detected
searching dependent graphs…