summaryrefslogtreecommitdiff
path: root/test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test.cc')
-rw-r--r--test.cc26
1 files changed, 14 insertions, 12 deletions
diff --git a/test.cc b/test.cc
index 4d8ad85..299a93b 100644
--- a/test.cc
+++ b/test.cc
@@ -91,13 +91,13 @@ static_assert(::zp::isusgn<int>::val == ::std::is_unsigned<in
static_assert(::zp::isusgn<int long>::val == ::std::is_unsigned<int long>::value);
static_assert(::zp::isusgn<double long>::val == ::std::is_unsigned<double long>::value);
static_assert(::zp::isusgn<int long long>::val == ::std::is_unsigned<int long long>::value);
-static_assert(::zp::isusgn<short>::val == ::std::is_unsigned<short>::value);
+static_assert(::zp::isusgn<int short>::val == ::std::is_unsigned<int short>::value);
static_assert(::zp::isusgn<char signed>::val == ::std::is_unsigned<char signed>::value);
static_assert(::zp::isusgn<char unsigned>::val == ::std::is_unsigned<char unsigned>::value);
static_assert(::zp::isusgn<int unsigned>::val == ::std::is_unsigned<int unsigned>::value);
static_assert(::zp::isusgn<int long unsigned>::val == ::std::is_unsigned<int long unsigned>::value);
static_assert(::zp::isusgn<int long long unsigned>::val == ::std::is_unsigned<int long long unsigned>::value);
-static_assert(::zp::isusgn<short unsigned>::val == ::std::is_unsigned<short unsigned>::value);
+static_assert(::zp::isusgn<int short unsigned>::val == ::std::is_unsigned<int short unsigned>::value);
static_assert(::zp::isusgn<wchar_t>::val == ::std::is_unsigned<wchar_t>::value);
static_assert(::zp::issgn<char>::val == ::std::is_signed<char>::value);
@@ -107,13 +107,13 @@ static_assert(::zp::issgn<int>::val == ::std::is_signed<int>:
static_assert(::zp::issgn<int long>::val == ::std::is_signed<int long>::value);
static_assert(::zp::issgn<double long>::val == ::std::is_signed<double long>::value);
static_assert(::zp::issgn<int long long>::val == ::std::is_signed<int long long>::value);
-static_assert(::zp::issgn<short>::val == ::std::is_signed<short>::value);
+static_assert(::zp::issgn<int short>::val == ::std::is_signed<int short>::value);
static_assert(::zp::issgn<char signed>::val == ::std::is_signed<char signed>::value);
static_assert(::zp::issgn<char unsigned>::val == ::std::is_signed<char unsigned>::value);
static_assert(::zp::issgn<int unsigned>::val == ::std::is_signed<int unsigned>::value);
static_assert(::zp::issgn<int long unsigned>::val == ::std::is_signed<int long unsigned>::value);
static_assert(::zp::issgn<int long long unsigned>::val == ::std::is_signed<int long long unsigned>::value);
-static_assert(::zp::issgn<short unsigned>::val == ::std::is_signed<short unsigned>::value);
+static_assert(::zp::issgn<int short unsigned>::val == ::std::is_signed<int short unsigned>::value);
static_assert(::zp::issgn<wchar_t>::val == ::std::is_signed<wchar_t>::value);
static_assert(::zp::bytelen == CHAR_BIT);
@@ -129,10 +129,10 @@ static_assert(::zp::minval<int>::val == ::std::numeric_limits
static_assert(::zp::minval<int long>::val == ::std::numeric_limits<int long>::lowest());
static_assert(::zp::minval<double long>::val == ::std::numeric_limits<double long>::lowest());
static_assert(::zp::minval<int long long>::val == ::std::numeric_limits<int long long>::lowest());
-static_assert(::zp::minval<short>::val == ::std::numeric_limits<short>::lowest());
+static_assert(::zp::minval<int short>::val == ::std::numeric_limits<int short>::lowest());
static_assert(::zp::minval<char signed>::val == ::std::numeric_limits<char signed>::lowest());
static_assert(::zp::minval<char unsigned>::val == ::std::numeric_limits<char unsigned>::lowest());
-static_assert(::zp::minval<short unsigned>::val == ::std::numeric_limits<short unsigned>::lowest());
+static_assert(::zp::minval<int short unsigned>::val == ::std::numeric_limits<int short unsigned>::lowest());
static_assert(::zp::minval<int unsigned>::val == ::std::numeric_limits<int unsigned>::lowest());
static_assert(::zp::minval<int long unsigned>::val == ::std::numeric_limits<int long unsigned>::lowest());
static_assert(::zp::minval<int long long unsigned>::val == ::std::numeric_limits<int long long unsigned>::lowest());
@@ -149,18 +149,18 @@ static_assert(::zp::maxval<int>::val == ::std::numeric_limits
static_assert(::zp::maxval<int long>::val == ::std::numeric_limits<int long>::max());
static_assert(::zp::maxval<double long>::val == ::std::numeric_limits<double long>::max());
static_assert(::zp::maxval<int long long>::val == ::std::numeric_limits<int long long>::max());
-static_assert(::zp::maxval<short>::val == ::std::numeric_limits<short>::max());
+static_assert(::zp::maxval<int short>::val == ::std::numeric_limits<int short>::max());
static_assert(::zp::maxval<char signed>::val == ::std::numeric_limits<char signed>::max());
static_assert(::zp::maxval<char unsigned>::val == ::std::numeric_limits<char unsigned>::max());
-static_assert(::zp::maxval<short unsigned>::val == ::std::numeric_limits<short unsigned>::max());
+static_assert(::zp::maxval<int short unsigned>::val == ::std::numeric_limits<int short unsigned>::max());
static_assert(::zp::maxval<int unsigned>::val == ::std::numeric_limits<int unsigned>::max());
static_assert(::zp::maxval<int long unsigned>::val == ::std::numeric_limits<int long unsigned>::max());
static_assert(::zp::maxval<int long long unsigned>::val == ::std::numeric_limits<int long long unsigned>::max());
static_assert(::zp::maxval<wchar_t>::val == ::std::numeric_limits<wchar_t>::max());
template<typename ltyp,typename rtyp> static auto cmp(int unsigned & numerr,int long const ln,ltyp const & lvalref,rtyp const & rvalref) noexcept {
- char const * const ltypnm = typeid (ltyp).name();
- char const * const rtypnm = typeid (rtyp).name();
+ char const* const ltypnm = typeid (ltyp).name();
+ char const* const rtypnm = typeid (rtyp).name();
auto const getval = [](auto const & valref) {
using typ = typename ::zp::remqual<typename ::zp::remref<decltype (valref)>::typ>::typ;
@@ -191,13 +191,14 @@ template<typename ltyp,typename rtyp> static auto cmp(int unsigned & numerr,int
int main() {
int unsigned numerr = 0x0u;
- auto const tst = [](char const * const tst) noexcept {
+ auto const tst = [](char const* const tst) noexcept {
::std::cout <<"\n\x1B[38;5;75mtesting\x1B[0m " << tst <<"\n\n";
};
::std::cout <<"zp " <<::zp::ver.api <<"." <<::zp::ver.ext <<", run-time test\n";
try {
+#if false
[&] {
tst("optionals");
@@ -205,7 +206,7 @@ int main() {
cmp(opt.chk(),false);
- auto const fun = [](char const * msg) -> void {
+ auto const fun = [](char const* msg) -> void {
::std::cout << msg << ::std::endl;
::std::abort();
@@ -216,6 +217,7 @@ int main() {
cmp(opt.chk(),true);
cmp(opt.exp(fun,"expectation failed"),-0x45);
}();
+#endif
[&] {
tst("special numbers");