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

TyRoXx / NonlocalityOS / 18442729802

12 Oct 2025 10:29AM UTC coverage: 75.137% (+0.3%) from 74.885%
18442729802

Pull #327

github

web-flow
Merge dbd2fdb46 into ebeccd066
Pull Request #327: 301 sorted tree data structure

186 of 232 new or added lines in 6 files covered. (80.17%)

2 existing lines in 1 file now uncovered.

4107 of 5466 relevant lines covered (75.14%)

4071.12 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

97.22
/fuzz/fuzz_functions/src/sorted_tree_insert.rs
1
use arbitrary::Unstructured;
2
use std::collections::BTreeMap;
3
use tokio::sync::Mutex;
4

5
pub fn fuzz_function(data: &[u8]) -> bool {
2✔
6
    let mut unstructured = Unstructured::new(data);
6✔
7
    let entries: Vec<(String, i64)> = match unstructured.arbitrary() {
4✔
8
        Ok(success) => success,
NEW
9
        Err(_) => return false,
×
10
    };
11
    tokio::runtime::Builder::new_multi_thread()
12
        .enable_all()
13
        .build()
14
        .unwrap()
15
        .block_on(async {
2✔
16
            let storage = astraea::storage::InMemoryTreeStorage::new(Mutex::new(BTreeMap::new()));
8✔
17
            let mut current_state = sorted_tree::sorted_tree::new_tree::<String, i64>(&storage)
6✔
18
                .await
2✔
19
                .expect("creating a new tree should succeed");
4✔
20
            let mut oracle = BTreeMap::new();
4✔
21
            for (key, _value) in entries.iter() {
14✔
22
                let found =
5✔
23
                    sorted_tree::sorted_tree::find::<String, i64>(&storage, &current_state, key)
20✔
24
                        .await;
5✔
25
                assert_eq!(None, found);
5✔
26
            }
27
            for (key, value) in entries.iter() {
12✔
28
                current_state = sorted_tree::sorted_tree::insert::<String, i64>(
10✔
29
                    &storage,
10✔
30
                    &storage,
10✔
31
                    &current_state,
10✔
32
                    key.clone(),
15✔
33
                    *value,
5✔
34
                )
35
                .await
5✔
36
                .expect("inserting key should succeed");
10✔
37
                let found =
5✔
38
                    sorted_tree::sorted_tree::find::<String, i64>(&storage, &current_state, key)
20✔
39
                        .await;
5✔
40
                assert_eq!(Some(*value), found);
10✔
41
                oracle.insert(key.clone(), *value);
5✔
42
            }
43
            for (key, value) in oracle.iter() {
6✔
44
                let found =
2✔
45
                    sorted_tree::sorted_tree::find::<String, i64>(&storage, &current_state, key)
8✔
46
                        .await;
2✔
47
                assert_eq!(Some(*value), found);
4✔
48
            }
49
        });
50
    true
51
}
52

53
#[test]
54
fn crash_0() {
1✔
55
    assert!(fuzz_function(&[
56
        33, 183, 70, 70, 70, 70, 183, 63, 37, 19, 10
57
    ]));
58
}
59

60
#[test]
61
fn crash_1() {
1✔
62
    assert!(fuzz_function(&[
63
        255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
64
        255, 255, 255, 51
65
    ]));
66
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc