edponce commented on a change in pull request #10113:
URL: https://github.com/apache/arrow/pull/10113#discussion_r621551592
##########
File path: cpp/src/arrow/compute/kernels/scalar_arithmetic_test.cc
##########
@@ -817,5 +932,126 @@ TEST(TestBinaryArithmetic,
AddWithImplicitCastsUint64EdgeCase) {
ArrayFromJSON(uint64(),
"[18446744073709551615]")}));
}
+TEST(TestUnaryArithmetic, DispatchBest) {
+ for (std::string name : {"negate"}) {
+ for (const auto& ty : {int8(), int16(), int32(), int64(), uint8(),
uint16(), uint32(),
+ uint64(), float32(), float64()}) {
+ CheckDispatchBest(name, {ty}, {ty});
+ CheckDispatchBest(name, {dictionary(int8(), ty)}, {ty});
+ }
+ }
+
Review comment:
I added `CheckDispatchFails()` which checks if status is an error after
invoking either `DispatchBest()` or `DispatchExact`. It seems the only error
produced by `Dispatch*()` is `NotImplemented`. Nevertheless, I made the
function description general enough and check for not OK status instead of only
`NotImplemented` error,
https://github.com/edponce/arrow/blob/ARROW-11950-Compute-Add-unary-negative-kernel/cpp/src/arrow/compute/kernels/test_util.h#L151-L152
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]