[PATCH] D27828: [APFloatTest] Log when test fails. NFC
Tim Shen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 15 13:58:32 PST 2016
timshen created this revision.
timshen added a reviewer: iteratee.
timshen added a subscriber: llvm-commits.
https://reviews.llvm.org/D27828
Files:
llvm/unittests/ADT/APFloatTest.cpp
Index: llvm/unittests/ADT/APFloatTest.cpp
===================================================================
--- llvm/unittests/ADT/APFloatTest.cpp
+++ llvm/unittests/ADT/APFloatTest.cpp
@@ -10,6 +10,7 @@
#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/APSInt.h"
#include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/raw_ostream.h"
#include "gtest/gtest.h"
#include <cmath>
@@ -3209,7 +3210,10 @@
APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, 2, Op2));
A1.add(A2, RM);
- EXPECT_EQ(Expected, A1.getCategory());
+ EXPECT_EQ(Expected, A1.getCategory())
+ << formatv("({0:x} + {1:x}) + ({2:x} + {3:x})", Op1[0], Op1[1], Op2[0],
+ Op2[1])
+ .str();
}
}
@@ -3258,9 +3262,14 @@
APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, 2, Op2));
A1.add(A2, RM);
- EXPECT_EQ(Expected[0], A1.bitcastToAPInt().getRawData()[0]);
- EXPECT_EQ(Expected[1],
- A1.getSecondFloat().bitcastToAPInt().getRawData()[0]);
+ EXPECT_EQ(Expected[0], A1.bitcastToAPInt().getRawData()[0])
+ << formatv("({0:x} + {1:x}) + ({2:x} + {3:x})", Op1[0], Op1[1], Op2[0],
+ Op2[1])
+ .str();
+ EXPECT_EQ(Expected[1], A1.getSecondFloat().bitcastToAPInt().getRawData()[0])
+ << formatv("({0:x} + {1:x}) + ({2:x} + {3:x})", Op1[0], Op1[1], Op2[0],
+ Op2[1])
+ .str();
}
}
@@ -3287,9 +3296,14 @@
APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, 2, Op2));
A1.subtract(A2, RM);
- EXPECT_EQ(Expected[0], A1.bitcastToAPInt().getRawData()[0]);
- EXPECT_EQ(Expected[1],
- A1.getSecondFloat().bitcastToAPInt().getRawData()[0]);
+ EXPECT_EQ(Expected[0], A1.bitcastToAPInt().getRawData()[0])
+ << formatv("({0:x} + {1:x}) - ({2:x} + {3:x})", Op1[0], Op1[1], Op2[0],
+ Op2[1])
+ .str();
+ EXPECT_EQ(Expected[1], A1.getSecondFloat().bitcastToAPInt().getRawData()[0])
+ << formatv("({0:x} + {1:x}) - ({2:x} + {3:x})", Op1[0], Op1[1], Op2[0],
+ Op2[1])
+ .str();
}
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27828.81658.patch
Type: text/x-patch
Size: 2170 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161215/7d9613c2/attachment.bin>
More information about the llvm-commits
mailing list