@@ -13,6 +13,8 @@ TEST_CASE("HighsVersion", "[highs_version]") {
1313 const HighsInt major = highsVersionMajor ();
1414 const HighsInt minor = highsVersionMinor ();
1515 const HighsInt patch = highsVersionPatch ();
16+ const std::string compilation = highsCompilationDate ();
17+ const std::string githash = std::string (highsGithash ());
1618 std::stringstream ss;
1719 ss << major << " ." << minor << " ." << patch;
1820 std::string local_version = ss.str ();
@@ -21,15 +23,31 @@ TEST_CASE("HighsVersion", "[highs_version]") {
2123 printf (" HiGHS major version %d\n " , int (major));
2224 printf (" HiGHS minor version %d\n " , int (minor));
2325 printf (" HiGHS patch version %d\n " , int (patch));
24- printf (" HiGHS githash: %s\n " , highsGithash ());
25- // Compilation date is deprecated.
26- // printf("HiGHS compilation date: %s\n", highsCompilationDate());
26+ printf (" HiGHS githash: %s\n " , githash.c_str ());
27+ // Compilation date is deprecated, but make sure that the
28+ // deprecated method is still tested.
29+ printf (" HiGHS compilation date: %s\n " , compilation.c_str ());
2730 printf (" HiGHS local version: %s\n " , local_version.c_str ());
2831 }
2932 REQUIRE (major == HIGHS_VERSION_MAJOR);
3033 REQUIRE (minor == HIGHS_VERSION_MINOR);
3134 REQUIRE (patch == HIGHS_VERSION_PATCH);
32- REQUIRE (local_version == version);
35+ REQUIRE (githash == std::string (HIGHS_GITHASH));
36+ REQUIRE (version == local_version);
37+ // Check that the corresponding methods
38+ Highs highs;
39+ const std::string version0 = highs.version ();
40+ REQUIRE (version0 == version);
41+ const HighsInt major0 = highs.versionMajor ();
42+ REQUIRE (major0 == major);
43+ const HighsInt minor0 = highs.versionMinor ();
44+ REQUIRE (minor0 == minor);
45+ const HighsInt patch0 = highs.versionPatch ();
46+ REQUIRE (patch0 == patch);
47+ const std::string githash0 = highs.githash ();
48+ REQUIRE (githash0 == githash);
49+ const std::string compilation0 = highs.compilationDate ();
50+ REQUIRE (compilation == compilation);
3351}
3452
3553TEST_CASE (" sizeof-highs-int" , " [highs_version]" ) {
0 commit comments