Skip to content

Commit c10703d

Browse files
committed
Change API version to correspond to CBMC version
1 parent e0aa536 commit c10703d

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

regression/libcprover-cpp/call_bmc.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ int main(int argc, char *argv[])
2323
try
2424
{
2525
std::cout << "Hello from API stub" << std::endl;
26+
std::cout << "Working from C++ API version ";
2627

2728
// Convert argv to vector of strings for initialize_goto_model
2829
std::vector<std::string> arguments(argv + 1, argv + argc);
@@ -35,6 +36,7 @@ int main(int argc, char *argv[])
3536

3637
// Initialise API dependencies and global configuration in one step.
3738
api_sessiont api(api_options);
39+
std::cout << *api.get_api_version() << std::endl;
3840

3941
// Demonstrate the loading of a goto-model from the command line arguments
4042
api.set_message_callback(print_messages_to_stdout, nullptr);

src/libcprover-cpp/api.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <util/message.h>
99
#include <util/options.h>
1010
#include <util/ui_message.h>
11+
#include <util/version.h>
1112

1213
#include <goto-programs/goto_model.h>
1314
#include <goto-programs/initialize_goto_model.h>
@@ -34,7 +35,7 @@ extern configt config;
3435

3536
std::unique_ptr<std::string> api_sessiont::get_api_version() const
3637
{
37-
return util_make_unique<std::string>(std::string{"0.1"});
38+
return util_make_unique<std::string>(std::string{CBMC_VERSION});
3839
}
3940

4041
struct api_session_implementationt

src/libcprover-rust/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ mod tests {
8989
let client = cprover_api::new_api_session();
9090
let result = client.get_api_version();
9191

92-
let_cxx_string!(expected_version = "0.1");
93-
assert_eq!(*result, *expected_version);
92+
let_cxx_string!(expected_version = "5.79.0");
93+
assert!(*result > *expected_version);
9494
}
9595

9696
#[test]

0 commit comments

Comments
 (0)