[PATCH] D27828: [APFloatTest] Log when test fails. NFC
Tim Shen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 15 16:57:49 PST 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL289904: [APFloatTest] Log when test fails. NFC (authored by timshen).
Changed prior to commit:
https://reviews.llvm.org/D27828?vs=81658&id=81688#toc
Repository:
rL LLVM
https://reviews.llvm.org/D27828
Files:
llvm/trunk/unittests/ADT/APFloatTest.cpp
Index: llvm/trunk/unittests/ADT/APFloatTest.cpp
===================================================================
--- llvm/trunk/unittests/ADT/APFloatTest.cpp
+++ llvm/trunk/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.81688.patch
Type: text/x-patch
Size: 2188 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161216/10dfdb21/attachment.bin>
More information about the llvm-commits
mailing list