• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

schweikert / fping / 43619292405
94%
master: 80%

Build:
Build:
LAST BUILD BRANCH: push-nkkwpvyzmnmv
DEFAULT BRANCH: master
Ran 14 Nov 2026 05:08PM UTC
Jobs 5
Files 7
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

14 Nov 2026 05:06PM UTC coverage: 90.496% (+0.6%) from 89.919%
43619292405

push

github

schweikert
cleanup: remove unreachable %return stats branches and num_recv_total

Remove the unreachable `else` branches guarded by `h->num_recv <= h->num_sent`
and `h->num_recv_i <= h->num_sent_i` in `src/output.c` and `src/stats.c`, along
with the now write-only `HOST_ENTRY.num_recv_total` field.

Historical background:
- In `fping 2.4b2_to-ipv6` (`fa6cbdb`), `send_ping()` incremented `h->num_sent`
  on transmit while `wait_for_reply()` incremented `h->num_recv` on every
  received reply (including duplicate/broadcast/multicast replies). Whenever
  duplicates pushed `h->num_recv > h->num_sent`, `fping` printed `%return`
  instead of a negative `%loss`.
- Commit `5c68d6f` ("don't consider duplicate pings as successful replies (#53)",
  2013; `-l` loop mode fixed in `d6808ef`, #55) introduced `h->num_recv_total`
  and restricted `h->num_recv` outside `-l` loop mode to the first reply per
  sequence (`RESP_WAITING`), changing the `else` branch in `wait_for_reply()` to
  use `h->num_recv_total` while keeping the `h->num_recv <= h->num_sent`
  condition (which already made that `else` branch unreachable outside `-l` loop
  mode).
- Commit `bb8d71e` / PR #193 ("refactored event loop, now for each ping we
  create both a ping and a timeout event", 2020) moved `h->num_sent++` and
  `h->num_sent_i++` for transmitted pings out of `send_ping()` into
  `stats_add()`, which always increments `num_sent` and `num_sent_i` at entry
  and only increments `num_recv` and `num_recv_i` when `success != 0` (send
  errors only increment `num_sent`/`num_sent_i`, and `stats_reset_interval()`
  resets both `_i` counters to 0). As a result, `0 <= num_recv <= num_sent` and
  `0 <= num_recv_i <= num_sent_i` hold across all modes—even when duplicate
  replies reach `stats_add()` in `-l` or `-c`/`-C` with `-q`/`-Q` (`05b8f45e`),
  because both counters increment together.
- Subsequent commits `43f6e34` (#175) and `4c8706d` (JSON `-J` output) copied
  the already-unreachable `if (h->num_recv ... (continued)

22 of 26 new or added lines in 2 files covered. (84.62%)

1752 of 1936 relevant lines covered (90.5%)

664.47 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
93.83
3.22% src/output.c
2
94.55
3.79% src/stats.c
Jobs
ID Job ID Ran Files Coverage
1 ubuntu-26.04 - 43619292405.1 14 Nov 2026 05:08PM UTC 7
88.43
GitHub Action Run
2 ubuntu-24.04 - 43619292405.2 14 Nov 2026 05:08PM UTC 7
88.43
GitHub Action Run
3 macos - 43619292405.3 14 Nov 2026 05:08PM UTC 7
75.41
GitHub Action Run
4 ubuntu-22.04 - 43619292405.4 14 Nov 2026 05:08PM UTC 7
88.43
GitHub Action Run
5 ubuntu-26.04-arm - 43619292405.5 14 Nov 2026 05:08PM UTC 7
88.43
GitHub Action Run
Source Files on build 43619292405
  • Tree
  • List 7
  • Changed 3
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #43619292405
  • 50f08564 on github
  • Prev Build on develop (#43619220294)
  • Next Build on develop (#43619606043)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc