cmake update

This commit is contained in:
Markus F.X.J. Oberhumer
2024-03-26 15:38:20 +01:00
parent a27a9e6000
commit 3ba91b8072
8 changed files with 57 additions and 36 deletions
+8 -6
View File
@@ -741,12 +741,14 @@ TEST_CASE("libc snprintf") {
CHECK_EQ(strcmp(buf, "-6.0.0.0.0.0.0.0.6.ffffffffffffffff"), 0);
snprintf(buf, sizeof(buf), "%d.%d.%d.%d.%d.%d.%d.%d.%d.%#jx", -7, 0, 0, 0, 0, 0, 0, 0, 7, um);
CHECK_EQ(strcmp(buf, "-7.0.0.0.0.0.0.0.7.0xffffffffffffffff"), 0);
snprintf(buf, sizeof(buf), "%#x %#lx %#llx", 17u, 18ul, 19ull);
CHECK_EQ(strcmp(buf, "0x11 0x12 0x13"), 0);
snprintf(buf, sizeof(buf), "%#X %#lX %#llX", 20u, 21ul, 22ull);
CHECK_EQ(strcmp(buf, "0X14 0X15 0X16"), 0);
snprintf(buf, sizeof(buf), "%#06x %#06lx %#06llx", 23u, 24ul, 25ull);
CHECK_EQ(strcmp(buf, "0x0017 0x0018 0x0019"), 0);
snprintf(buf, sizeof(buf), "%#X %#lx %#llx", 26u, 27ul, 28ull);
CHECK_EQ(strcmp(buf, "0X1A 0x1b 0x1c"), 0);
snprintf(buf, sizeof(buf), "%#06x %#06lX %#06llx", 26u, 27ul, 28ull);
CHECK_EQ(strcmp(buf, "0x001a 0X001B 0x001c"), 0);
snprintf(buf, sizeof(buf), "%#6x %#6lx %#6llX", 26u, 27ul, 28ull);
CHECK_EQ(strcmp(buf, " 0x1a 0x1b 0X1C"), 0);
snprintf(buf, sizeof(buf), "%#-6X %#-6lx %#-6llx", 26u, 27ul, 28ull);
CHECK_EQ(strcmp(buf, "0X1A 0x1b 0x1c "), 0);
}
#if 0
+9 -7
View File
@@ -131,7 +131,7 @@ TEST_CASE("libc++") {
CHECK(v.end() - v.begin() == N);
CHECK(&v[0] == &(*(v.begin())));
// CHECK(&v[0] + N == &(*(v.end()))); // TODO later: is this legal??
// TODO later
// TODO later: make sure that this throws
#if defined(_LIBCPP_HARDENING_MODE_DEBUG) && \
(_LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG)
CHECK_THROWS((void) &v[N]);
@@ -176,7 +176,7 @@ struct MyVType2 {
UPX_CXX_DISABLE_ADDRESS(Self)
UPX_CXX_DISABLE_NEW_DELETE(Self)
};
TEST_CASE("upx_cxx_disable") {
TEST_CASE("UPX_CXX_DISABLE_xxx") {
MyType1<char, int, 1> dummy1;
MyType2<char, int, 2> dummy2;
MyVType1<char, int, 1> vdummy1;
@@ -260,7 +260,7 @@ struct Z2_X2 : public X2 {
// util
**************************************************************************/
TEST_CASE("Deleter") {
TEST_CASE("upx::ObjectDeleter 1") {
LE16 *o = nullptr; // object
LE32 *a = nullptr; // array
{
@@ -275,7 +275,7 @@ TEST_CASE("Deleter") {
assert(a == nullptr);
}
TEST_CASE("Deleter") {
TEST_CASE("upx::ObjectDeleter 2") {
constexpr size_t N = 2;
BE16 *o[N]; // multiple objects
BE32 *a[N]; // multiple arrays
@@ -284,8 +284,10 @@ TEST_CASE("Deleter") {
upx::ArrayDeleter<BE32 **> a_deleter{a, 0};
for (size_t i = 0; i < N; i++) {
o[i] = new BE16;
assert(o[i] != nullptr);
o_deleter.count += 1;
a[i] = New(BE32, 1 + i);
assert(a[i] != nullptr);
a_deleter.count += 1;
}
}
@@ -295,7 +297,7 @@ TEST_CASE("Deleter") {
}
}
TEST_CASE("ptr_static_cast") {
TEST_CASE("upx::ptr_static_cast") {
// check that we don't trigger any -Wcast-align warnings
using upx::ptr_static_cast;
void *vp = nullptr;
@@ -335,7 +337,7 @@ TEST_CASE("ptr_static_cast") {
assert((ic == ptr_static_cast<const int *>(ic)));
}
TEST_CASE("noncopyable") {
TEST_CASE("upx::noncopyable") {
struct Test : private upx::noncopyable {
int v = 1;
};
@@ -458,7 +460,7 @@ struct TestTriBool {
};
} // namespace
TEST_CASE("TriBool") {
TEST_CASE("upx::TriBool") {
using upx::TriBool, upx::tribool;
static_assert(!tribool(false));
static_assert(tribool(true));