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 remaining mutation tests #139

Closed Johennes closed 7 months ago

Johennes commented 7 months ago

This fixes the remaining mutation tests under src/olm:

MISSED   src/olm/account/one_time_keys.rs:45:42: replace * with + in 0.8s build + 3.2s test
MISSED   src/olm/messages/mod.rs:99:9: replace OlmMessage::message -> &[u8] with Vec::leak(Vec::new()) in 0.8s build + 3.2s test
MISSED   src/olm/messages/mod.rs:99:9: replace OlmMessage::message -> &[u8] with Vec::leak(vec![0]) in 0.8s build + 2.9s test
MISSED   src/olm/messages/mod.rs:99:9: replace OlmMessage::message -> &[u8] with Vec::leak(vec![1]) in 0.8s build + 3.1s test
MISSED   src/olm/session/chain_key.rs:112:9: replace ChainKey::index -> u64 with 0 in 0.8s build + 3.0s test
MISSED   src/olm/session/chain_key.rs:112:9: replace ChainKey::index -> u64 with 1 in 0.8s build + 2.9s test
MISSED   src/olm/session/mod.rs:226:9: replace Session::has_received_message -> bool with false in 0.8s build + 3.1s test
MISSED   src/olm/session/mod.rs:256:9: replace Session::session_config -> SessionConfig with Default::default() in 0.7s build + 3.0s test
MISSED   src/olm/session/mod.rs:485:5: replace default_config -> SessionConfig with Default::default() in 0.9s build + 3.8s test
MISSED   src/olm/session/mod.rs:98:9: replace ChainStore::is_empty -> bool with true in 1.1s build + 3.2s test
MISSED   src/olm/session/ratchet.rs:79:9: replace <impl From for RatchetKey>::from -> Self with Default::default() in 0.8s build + 3.1s test
MISSED   src/olm/session_config.rs:33:9: replace SessionConfig::version -> u8 with 0 in 0.9s build + 3.0s test
MISSED   src/olm/session_config.rs:33:9: replace SessionConfig::version -> u8 with 1 in 0.8s build + 3.5s tes
TIMEOUT  src/olm/session/chain_key.rs:71:9: replace RemoteChainKey::chain_index -> u64 with 0 in 0.8s build + 23.0s test
TIMEOUT  src/olm/session/chain_key.rs:71:9: replace RemoteChainKey::chain_index -> u64 with 1 in 1.0s build + 23.0s test
TIMEOUT  src/olm/session/chain_key.rs:80:9: replace RemoteChainKey::advance with () in 0.8s build + 23.0s test
TIMEOUT  src/olm/session/chain_key.rs:82:20: replace += with *= in RemoteChainKey::advance in 0.8s build + 23.0s 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 89.41%. Comparing base (4e51951) to head (dc6d48b).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #139 +/- ## ========================================== + Coverage 88.52% 89.41% +0.89% ========================================== Files 32 32 Lines 1786 1786 ========================================== + Hits 1581 1597 +16 + Misses 205 189 -16 ```

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