]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
regtest: update none/tests/linux/bug506910.cpp to add errno value
authorPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 26 Oct 2025 19:41:38 +0000 (20:41 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 26 Oct 2025 19:41:38 +0000 (20:41 +0100)
This test recently had a couple of failures. Don't know why, but know
that errno wasn't the expected ELOOP. This change adds the value of
errno.

none/tests/linux/bug506910.cpp

index 2dbadf56a2136dfb758dbe0148adef2f10f5d3cc..fb0fac13ade921660f60c7e25a3398dfdba26326 100644 (file)
@@ -8,6 +8,7 @@
 #include <sys/syscall.h>
 #include <unistd.h>
 #include <linux/openat2.h>
+#include <sstream>
 
 int main(int argc, char** argv)
 {
@@ -24,7 +25,9 @@ int main(int argc, char** argv)
    {
       if (errno != ELOOP)
       {
-         throw std::runtime_error("errno should be ELOOP");
+         std::stringstream ss;
+         ss << "errno should be ELOOP (value is " << errno << ')';
+         throw std::runtime_error(ss.str());
       }
    }
 
@@ -37,7 +40,9 @@ int main(int argc, char** argv)
    {
        if (errno != ELOOP)
        {
-           throw std::runtime_error("errno should be ELOOP");
+           std::stringstream ss;
+           ss << "errno should be ELOOP (value is " << errno << ')';
+           throw std::runtime_error(ss.str());
        }
    }
 #endif