File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 6
6
pub mod cprover_api {
7
7
8
8
unsafe extern "C++" {
9
- include ! ( "libcprover-cpp /api.h" ) ;
9
+ include ! ( "cprover /api.h" ) ;
10
10
include ! ( "include/c_api.h" ) ;
11
11
12
12
/// Central organisational handle of the API. This directly corresponds to the
@@ -101,6 +101,22 @@ mod tests {
101
101
assert_eq ! ( vect. len( ) , 2 ) ;
102
102
}
103
103
104
+ // This test will capture a `system_exceptiont` from CBMC's end at the C++ shim that this
105
+ // library depends on, and it will be correctly translated into the Result type for Rust.
106
+ // This also validates that our type definition include of the base class for the exceptions
107
+ // works as we expect it to.
108
+ #[ test]
109
+ fn it_translates_exceptions_to_errors ( ) {
110
+ let client = cprover_api:: new_api_session ( ) ;
111
+
112
+ // The vector of string is supposed to contain a string denoting
113
+ // a filepath that is erroneous.
114
+ let vec: Vec < String > = vec ! [ "/fkjsdlkjfisudifoj2309" . to_owned( ) ] ;
115
+ let vect = ffi_util:: translate_rust_vector_to_cpp ( vec) ;
116
+
117
+ assert ! ( client. load_model_from_files( vect) . is_err( ) ) ;
118
+ }
119
+
104
120
#[ test]
105
121
fn it_can_load_model_from_file ( ) {
106
122
let binding = cprover_api:: new_api_session ( ) ;
You can’t perform that action at this time.
0 commit comments