File: empty_file

package info (click to toggle)
rust-prr 0.20.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 796 kB
  • sloc: makefile: 7
file content (39 lines) | stat: -rw-r--r-- 1,006 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
> diff --git a/libbpf-cargo/src/btf/btf.rs b/libbpf-cargo/src/btf/btf.rs
> index 0000000..fffb281 100644
> --- /dev/null
> +++ b/libbpf-cargo/src/btf/btf.rs
> diff --git a/libbpf-cargo/src/test.rs b/libbpf-cargo/src/test.rs
> index 5b08843..82a0586 100644
> --- a/libbpf-cargo/src/test.rs
> +++ b/libbpf-cargo/src/test.rs
> @@ -2145,3 +2145,27 @@ pub struct __anon_3 {
>  
>      assert_definition(&btf, struct_bpf_sock_tuple, expected_output);
>  }
> +
> +#[test]
> +fn test_btf_dump_float() {
> +    let prog_text = r#"
> +float f = 2.16;
> +double d = 12.15;
> +"#;
> +
> +    let btf = build_btf_prog(prog_text);
> +
> +    let f = find_type_in_btf!(btf, Var, "f");
> +    let d = find_type_in_btf!(btf, Var, "d");

Comment

> +
> +    assert_eq!(
> +        "f32",
> +        btf.type_declaration(f)
> +            .expect("Failed to generate f decl")
> +    );
> +    assert_eq!(
> +        "f64",
> +        btf.type_declaration(d)
> +            .expect("Failed to generate d decl")
> +    );
> +}