Skip to content

Commit 78df449

Browse files
committed
Merge branch 'latest' of https://github.com/ERGO-Code/HiGHS into latest
2 parents c5ba1cd + 65945ce commit 78df449

File tree

2 files changed

+27
-8
lines changed

2 files changed

+27
-8
lines changed

check/TestHighsVersion.cpp

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

3553
TEST_CASE("sizeof-highs-int", "[highs_version]") {

src/Highs.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ HighsInt highsVersionMajor();
3737
HighsInt highsVersionMinor();
3838
HighsInt highsVersionPatch();
3939
const char* highsGithash();
40-
const char* highsCompilationDate();
4140

4241
/**
4342
* @brief Class to set parameters and run HiGHS
@@ -1213,9 +1212,6 @@ class Highs {
12131212

12141213
// Start of deprecated methods
12151214

1216-
/**
1217-
* @brief Return compilation date
1218-
*/
12191215
std::string compilationDate() const { return "deprecated"; }
12201216

12211217
HighsStatus setLogCallback(void (*user_log_callback)(HighsLogType,
@@ -1525,4 +1521,9 @@ class Highs {
15251521
const double ill_conditioning_bound);
15261522
bool infeasibleBoundsOk();
15271523
};
1524+
1525+
// Start of deprecated methods not in the Highs class
1526+
1527+
const char* highsCompilationDate();
1528+
15281529
#endif

0 commit comments

Comments
 (0)