tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

lib.rs (486B)


      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 chromium::import! {
      6    "//chromium/build/rust/tests/bindgen_test:c_lib_bindgen";
      7 }
      8 
      9 pub fn add_two_numbers_in_c(a: u32, b: u32) -> u32 {
     10    unsafe { c_lib_bindgen::add_two_numbers(a, b) }
     11 }
     12 
     13 #[cfg(test)]
     14 mod tests {
     15    use super::*;
     16 
     17    #[test]
     18    fn test_add_two_numbers() {
     19        assert_eq!(add_two_numbers_in_c(5, 10), 15);
     20    }
     21 }