xref: /aosp_15_r20/external/cronet/build/rust/tests/bindgen_test/src/lib.rs (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2022 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 mod c_ffi {
6     #![allow(dead_code)]
7     #![allow(non_snake_case)]
8     #![allow(non_camel_case_types)]
9     #![allow(non_upper_case_globals)]
10     include!(env!("BINDGEN_RS_FILE"));
11 }
12 
add_two_numbers_in_c(a: u32, b: u32) -> u3213 pub fn add_two_numbers_in_c(a: u32, b: u32) -> u32 {
14     unsafe { c_ffi::add_two_numbers(a, b) }
15 }
16 
17 #[cfg(test)]
18 mod tests {
19     use super::*;
20 
21     #[test]
test_add_two_numbers()22     fn test_add_two_numbers() {
23         assert_eq!(add_two_numbers_in_c(5, 10), 15);
24     }
25 }
26