Merge branch 'mueller/version-getter-upstream' into mueller/version-getter

This commit is contained in:
Robin Müller 2022-03-10 09:47:10 +01:00
commit 3aa0bbde68
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
2 changed files with 18 additions and 3 deletions

View File

@ -26,6 +26,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## Additions ## Additions
- Linux HAL: Add wiretapping option for I2C. Enabled with `FSFW_HAL_I2C_WIRETAPPING` defined to 1 - Linux HAL: Add wiretapping option for I2C. Enabled with `FSFW_HAL_I2C_WIRETAPPING` defined to 1
- Dedicated Version class and constant `fsfw::FSFW_VERSION` containing version information
inside `fsfw/version.h`
# [v4.0.0] # [v4.0.0]

View File

@ -16,6 +16,9 @@ TEST_CASE("Version API Tests", "[TestVersionAPI]") {
REQUIRE(fsfw::Version(0, 0, 0) <= fsfw::FSFW_VERSION); REQUIRE(fsfw::Version(0, 0, 0) <= fsfw::FSFW_VERSION);
fsfw::Version v1 = fsfw::Version(1, 1, 1); fsfw::Version v1 = fsfw::Version(1, 1, 1);
fsfw::Version v2 = fsfw::Version(1, 1, 1); fsfw::Version v2 = fsfw::Version(1, 1, 1);
REQUIRE(v1 == v2);
REQUIRE(v1 <= v2);
REQUIRE(v1 >= v2);
v1.revision -= 1; v1.revision -= 1;
REQUIRE(v1 != v2); REQUIRE(v1 != v2);
REQUIRE(v1 < v2); REQUIRE(v1 < v2);
@ -32,24 +35,34 @@ TEST_CASE("Version API Tests", "[TestVersionAPI]") {
REQUIRE(v1 <= v2); REQUIRE(v1 <= v2);
v1.major += 1; v1.major += 1;
REQUIRE(v1 == v2); REQUIRE(v1 == v2);
REQUIRE(v1 <= v2);
REQUIRE(v1 >= v2);
v1.major += 1; v1.major += 1;
v1.minor -= 1;
REQUIRE(v1 != v2); REQUIRE(v1 != v2);
REQUIRE(v1 > v2); REQUIRE(v1 > v2);
REQUIRE(v1 >= v2); REQUIRE(v1 >= v2);
v1.major -= 1; v1.major -= 1;
v1.minor += 1; v1.minor += 2;
v1.revision -= 1;
REQUIRE(v1 != v2); REQUIRE(v1 != v2);
REQUIRE(v1 > v2); REQUIRE(v1 > v2);
REQUIRE(v1 >= v2); REQUIRE(v1 >= v2);
v1.minor -= 1; v1.minor -= 1;
v1.revision += 1; v1.revision += 2;
REQUIRE(v1 != v2); REQUIRE(v1 != v2);
REQUIRE(v1 > v2); REQUIRE(v1 > v2);
REQUIRE(v1 >= v2); REQUIRE(v1 >= v2);
v1.revision -= 1; v1.revision -= 1;
REQUIRE(v1 == v2); REQUIRE(v1 == v2);
REQUIRE(v1 <= v2);
REQUIRE(v1 >= v2);
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::info << "v" << fsfw::FSFW_VERSION << std::endl; sif::info << "v" << fsfw::FSFW_VERSION << std::endl;
#endif
char verString[10] = {}; char verString[10] = {};
fsfw::FSFW_VERSION.getVersion(verString, sizeof(verString)); fsfw::FSFW_VERSION.getVersion(verString, sizeof(verString));
sif::info << "v" << verString << std::endl; #if FSFW_DISABLE_PRINTOUT == 0
printf("v%s\n",verString);
#endif
} }