matrix-org / vodozemac

An implementation of Olm and Megolm in pure Rust.
Apache License 2.0
175 stars 30 forks source link

test(olm): Add mutation tests for account #138

Closed Johennes closed 7 months ago

Johennes commented 7 months ago

This fixes:

MISSED   src/olm/account/one_time_keys.rs:126:9: replace OneTimeKeys::is_secret_key_published -> bool with false in 0.9s build + 3.5s test
MISSED   src/olm/account/one_time_keys.rs:126:9: replace OneTimeKeys::is_secret_key_published -> bool with true in 0.9s build + 3.4s test
MISSED   src/olm/account/fallback_keys.rs:53:9: replace FallbackKey::published -> bool with false in 0.8s build + 3.0s test
MISSED   src/olm/account/fallback_keys.rs:70:9: replace FallbackKeys::mark_as_published with () in 0.8s build + 3.3s test
MISSED   src/olm/account/fallback_keys.rs:77:21: replace += with *= in FallbackKeys::generate_fallback_key in 0.8s build + 3.1s test
MISSED   src/olm/account/fallback_keys.rs:49:9: replace FallbackKey::mark_as_published with () in 0.8s build + 3.1s test
MISSED   src/olm/account/mod.rs:289:9: replace Account::stored_one_time_key_count -> usize with 1 in 1.0s build + 3.0s test
MISSED   src/olm/account/mod.rs:334:9: replace Account::forget_fallback_key -> bool with true in 0.8s build + 3.3s test
MISSED   src/olm/account/mod.rs:334:9: replace Account::forget_fallback_key -> bool with false in 1.0s build + 3.0s test
MISSED   src/olm/account/mod.rs:289:9: replace Account::stored_one_time_key_count -> usize with 0 in 0.8s build + 2.9s test
MISSED   src/olm/account/mod.rs:339:9: replace Account::mark_keys_as_published with () in 1.0s build + 3.9s test
MISSED   src/olm/account/mod.rs:551:25: replace += with *= in libolm::<impl Encode for FallbackKeysArray>::encode in 1.1s build + 3.2s test
MISSED   src/olm/account/mod.rs:552:25: replace += with -= in libolm::<impl Encode for FallbackKeysArray>::encode in 0.9s build + 3.1s test
MISSED   src/olm/account/mod.rs:201:9: replace Account::remove_one_time_key -> Option<Curve25519SecretKey> with None in 1.0s build + 3.1s test
MISSED   src/olm/account/mod.rs:152:9: replace Account::max_number_of_one_time_keys -> usize with 0 in 0.8s build + 2.9s test
MISSED   src/olm/account/mod.rs:201:9: replace Account::remove_one_time_key -> Option<Curve25519SecretKey> with Some(Default::default()) in 0.9s build + 2.9s test
MISSED   src/olm/account/mod.rs:152:9: replace Account::max_number_of_one_time_keys -> usize with 1 in 0.8s build + 3.0s test
MISSED   src/olm/account/mod.rs:545:25: replace += with *= in libolm::<impl Encode for FallbackKeysArray>::encode in 1.0s build + 3.1s test
MISSED   src/olm/account/mod.rs:552:25: replace += with *= in libolm::<impl Encode for FallbackKeysArray>::encode in 0.9s build + 3.0s test
MISSED   src/olm/account/mod.rs:419:9: replace Account::from_decrypted_libolm_pickle -> Result<Self, crate::LibolmPickleError> with Ok(Default::default()) in 1.1s build + 2.6s test
MISSED   src/olm/account/mod.rs:551:25: replace += with -= in libolm::<impl Encode for FallbackKeysArray>::encode in 1.0s build + 3.2s test

Relates to: #78

codecov-commenter commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 88.35%. Comparing base (cefd49c) to head (cda3528).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #138 +/- ## ========================================== + Coverage 87.68% 88.35% +0.67% ========================================== Files 32 32 Lines 1786 1786 ========================================== + Hits 1566 1578 +12 + Misses 220 208 -12 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.