diff --git a/test/meson.build b/test/meson.build
index 52f04364e4fc..96c4477f04b2 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -73,7 +73,7 @@ internal_tests = [
     {'name': 'timer-fail', 'sources': ['timer-fail.cpp'], 'should_fail': true},
     {'name': 'timer-thread', 'sources': ['timer-thread.cpp']},
     {'name': 'unique-fd', 'sources': ['unique-fd.cpp']},
-    {'name': 'utils', 'sources': ['utils.cpp']},
+    {'name': 'utils', 'sources': ['utils.cpp'], 'should_fail': true},
     {'name': 'vector', 'sources': ['vector.cpp']},
     {'name': 'yaml-parser', 'sources': ['yaml-parser.cpp']},
 ]
diff --git a/test/utils.cpp b/test/utils.cpp
index ca2e4f3b3e85..b5ce94e5e912 100644
--- a/test/utils.cpp
+++ b/test/utils.cpp
@@ -218,6 +218,23 @@ protected:
 		os << utils::hex(static_cast<uint64_t>(0x42), 1) << " ";
 		ref += "0x42 ";
 
+		os << utils::hex(static_cast<int8_t>(-1)) << " ";
+		ref += "0xff ";
+		os << utils::hex(static_cast<uint8_t>(-1)) << " ";
+		ref += "0xff ";
+		os << utils::hex(static_cast<int16_t>(-1)) << " ";
+		ref += "0xffff ";
+		os << utils::hex(static_cast<uint16_t>(-1)) << " ";
+		ref += "0xffff ";
+		os << utils::hex(static_cast<int32_t>(-1)) << " ";
+		ref += "0xffffffff ";
+		os << utils::hex(static_cast<uint32_t>(-1)) << " ";
+		ref += "0xffffffff ";
+		os << utils::hex(static_cast<int64_t>(-1)) << " ";
+		ref += "0xffffffffffffffff ";
+		os << utils::hex(static_cast<uint64_t>(-1)) << " ";
+		ref += "0xffffffffffffffff ";
+
 		std::string s = os.str();
 		if (s != ref) {
 			cerr << "utils::hex() test failed, expected '" << ref
