Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remove mock for tests #823

Merged
merged 2 commits into from
Aug 9, 2023
Merged

Conversation

thvdveld
Copy link
Contributor

mock was configured at compile time by feature flags. However, this is not very handy when using fixtures. I removed the mock function and added fixtures where needed. For the tests I had to make inner in Interface public for the crate.

This PR also sneeks in a fix for a feature flag combination that did not compile: std,medium-ieee802154,medium-ip,proto-ipv4,socket-raw. With these feature flags, the lookup_hardware_address is called, however, we did not check that the medium for the IPv4 case in there.

The combination `medium-ieee802154` + `medium-ip` + `proto-ipv4` +
`proto-ipv6` did not compile because of `lookup_hardware_addr`.
@codecov
Copy link

codecov bot commented Jul 31, 2023

Codecov Report

Merging #823 (7044bd1) into main (fa7fd3c) will decrease coverage by 0.86%.
The diff coverage is 90.50%.

@@            Coverage Diff             @@
##             main     #823      +/-   ##
==========================================
- Coverage   79.65%   78.79%   -0.86%     
==========================================
  Files          72       72              
  Lines       27862    27008     -854     
==========================================
- Hits        22193    21281     -912     
- Misses       5669     5727      +58     
Files Changed Coverage Δ
src/iface/neighbor.rs 98.00% <ø> (ø)
src/iface/interface/mod.rs 45.63% <38.46%> (-4.00%) ⬇️
src/socket/raw.rs 73.84% <63.63%> (-11.27%) ⬇️
src/socket/icmp.rs 70.88% <88.88%> (-15.14%) ⬇️
src/socket/udp.rs 79.13% <92.30%> (-5.75%) ⬇️
src/tests.rs 98.00% <98.00%> (ø)
src/socket/dhcpv4.rs 85.61% <100.00%> (-3.08%) ⬇️
src/socket/tcp.rs 96.49% <100.00%> (+<0.01%) ⬆️

... and 4 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@thvdveld thvdveld added this pull request to the merge queue Aug 9, 2023
Merged via the queue into smoltcp-rs:main with commit 784de3f Aug 9, 2023
11 checks passed
@thvdveld thvdveld deleted the remove-mock-for-tests branch August 9, 2023 08:11
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant