MCPcopy Create free account
hub / github.com/apache/arrow / VerifyAllSign

Method VerifyAllSign

cpp/src/gandiva/precompiled/decimal_ops_test.cc:166–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164}
165
166void TestDecimalSql::VerifyAllSign(DecimalTypeUtil::Op op, const DecimalScalar128& left,
167 const DecimalScalar128& right,
168 const DecimalScalar128& expected_output,
169 bool expected_overflow) {
170 // both +ve
171 Verify(op, left, right, expected_output, expected_overflow);
172
173 // left -ve
174 Verify(op, -left, right, -expected_output, expected_overflow);
175
176 if (op == DecimalTypeUtil::kOpMod) {
177 // right -ve
178 Verify(op, left, -right, expected_output, expected_overflow);
179
180 // both -ve
181 Verify(op, -left, -right, -expected_output, expected_overflow);
182 } else {
183 ASSERT_TRUE(op == DecimalTypeUtil::kOpMultiply || op == DecimalTypeUtil::kOpDivide);
184
185 // right -ve
186 Verify(op, left, -right, -expected_output, expected_overflow);
187
188 // both -ve
189 Verify(op, -left, -right, expected_output, expected_overflow);
190 }
191}
192
193TEST_F(TestDecimalSql, Add) {
194 // fast-path

Callers

nothing calls this directly

Calls 1

VerifyFunction · 0.50

Tested by

no test coverage detected