(source, post string)
| 448 | } |
| 449 | |
| 450 | func testFetchSymbols(source, post string) ([]byte, error) { |
| 451 | var buf bytes.Buffer |
| 452 | |
| 453 | switch source { |
| 454 | case testSourceURL(8000) + "symbolz": |
| 455 | for _, address := range strings.Split(post, "+") { |
| 456 | a, _ := strconv.ParseInt(address, 0, 64) |
| 457 | fmt.Fprintf(&buf, "%v\t", address) |
| 458 | if a-testStart > testOffset { |
| 459 | fmt.Fprintf(&buf, "wrong_source_%v_", address) |
| 460 | continue |
| 461 | } |
| 462 | fmt.Fprintf(&buf, "%#x\n", a-testStart) |
| 463 | } |
| 464 | return buf.Bytes(), nil |
| 465 | case testSourceURL(8001) + "symbolz": |
| 466 | for _, address := range strings.Split(post, "+") { |
| 467 | a, _ := strconv.ParseInt(address, 0, 64) |
| 468 | fmt.Fprintf(&buf, "%v\t", address) |
| 469 | if a-testStart < testOffset { |
| 470 | fmt.Fprintf(&buf, "wrong_source_%v_", address) |
| 471 | continue |
| 472 | } |
| 473 | fmt.Fprintf(&buf, "%#x\n", a-testStart-testOffset) |
| 474 | } |
| 475 | return buf.Bytes(), nil |
| 476 | default: |
| 477 | return nil, fmt.Errorf("unexpected source: %s", source) |
| 478 | } |
| 479 | } |
| 480 | |
| 481 | type testSymbolzSymbolizer struct{} |
| 482 |
nothing calls this directly
no test coverage detected
searching dependent graphs…