Rename Count to lowercase, make const
This commit is contained in:
parent
3124548314
commit
13bd166827
2 changed files with 6 additions and 6 deletions
|
@ -27,7 +27,7 @@ namespace dhandy {
|
||||||
template <std::size_t N>
|
template <std::size_t N>
|
||||||
class Version {
|
class Version {
|
||||||
public:
|
public:
|
||||||
constexpr static std::size_t Count = N;
|
constexpr static const std::size_t count = N;
|
||||||
|
|
||||||
constexpr Version (const char* const ver, bool accept_less=false);
|
constexpr Version (const char* const ver, bool accept_less=false);
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ TEST_CASE ("Version class tests", "[version][bt]") {
|
||||||
{
|
{
|
||||||
constexpr Version<1> ver{"102"};
|
constexpr Version<1> ver{"102"};
|
||||||
static_assert(ver.major() == 102, "Version error");
|
static_assert(ver.major() == 102, "Version error");
|
||||||
static_assert(ver.Count == 1, "Version error");
|
static_assert(ver.count == 1, "Version error");
|
||||||
CHECK(ver[0] == 102);
|
CHECK(ver[0] == 102);
|
||||||
CHECK_THROWS(ver[1]);
|
CHECK_THROWS(ver[1]);
|
||||||
CHECK_THROWS(ver[2]);
|
CHECK_THROWS(ver[2]);
|
||||||
|
@ -34,7 +34,7 @@ TEST_CASE ("Version class tests", "[version][bt]") {
|
||||||
|
|
||||||
{
|
{
|
||||||
constexpr Version<3> ver{".aheud15,a.ud22,cu.sh81,.nuad.h44"};
|
constexpr Version<3> ver{".aheud15,a.ud22,cu.sh81,.nuad.h44"};
|
||||||
static_assert(ver.Count == 3, "Version error");
|
static_assert(ver.count == 3, "Version error");
|
||||||
static_assert(ver.major() == 15, "Version error");
|
static_assert(ver.major() == 15, "Version error");
|
||||||
static_assert(ver.minor() == 22, "Version error");
|
static_assert(ver.minor() == 22, "Version error");
|
||||||
static_assert(ver.revision() == 81, "Version error");
|
static_assert(ver.revision() == 81, "Version error");
|
||||||
|
@ -47,7 +47,7 @@ TEST_CASE ("Version class tests", "[version][bt]") {
|
||||||
|
|
||||||
{
|
{
|
||||||
constexpr Version<10> ver{"1.2.3.44.55.66.777.888.999.101010"};
|
constexpr Version<10> ver{"1.2.3.44.55.66.777.888.999.101010"};
|
||||||
static_assert(ver.Count == 10, "Version error");
|
static_assert(ver.count == 10, "Version error");
|
||||||
static_assert(ver.major() == 1, "Version error");
|
static_assert(ver.major() == 1, "Version error");
|
||||||
static_assert(ver.minor() == 2, "Version error");
|
static_assert(ver.minor() == 2, "Version error");
|
||||||
static_assert(ver.revision() == 3, "Version error");
|
static_assert(ver.revision() == 3, "Version error");
|
||||||
|
@ -66,7 +66,7 @@ TEST_CASE ("Version class tests", "[version][bt]") {
|
||||||
|
|
||||||
{
|
{
|
||||||
constexpr Version<4> ver{"1.2.3.", true};
|
constexpr Version<4> ver{"1.2.3.", true};
|
||||||
static_assert(ver.Count == 4, "Version error");
|
static_assert(ver.count == 4, "Version error");
|
||||||
static_assert(ver.major() == 1, "Version error");
|
static_assert(ver.major() == 1, "Version error");
|
||||||
static_assert(ver.minor() == 2, "Version error");
|
static_assert(ver.minor() == 2, "Version error");
|
||||||
static_assert(ver.revision() == 3, "Version error");
|
static_assert(ver.revision() == 3, "Version error");
|
||||||
|
@ -79,7 +79,7 @@ TEST_CASE ("Version class tests", "[version][bt]") {
|
||||||
|
|
||||||
{
|
{
|
||||||
constexpr Version<4> ver{"6.7.2-r1"};
|
constexpr Version<4> ver{"6.7.2-r1"};
|
||||||
static_assert(ver.Count == 4, "Version error");
|
static_assert(ver.count == 4, "Version error");
|
||||||
static_assert(ver.major() == 6, "Version error");
|
static_assert(ver.major() == 6, "Version error");
|
||||||
static_assert(ver.minor() == 7, "Version error");
|
static_assert(ver.minor() == 7, "Version error");
|
||||||
static_assert(ver.revision() == 2, "Version error");
|
static_assert(ver.revision() == 2, "Version error");
|
||||||
|
|
Loading…
Add table
Reference in a new issue