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

Function TEST

cpp/src/arrow/compute/kernels/scalar_arithmetic_test.cc:616–636  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

614}
615
616TEST(TestBinaryArithmetic, SubtractTimestamps) {
617 random::RandomArrayGenerator rand(kRandomSeed);
618
619 const int64_t length = 100;
620
621 auto lhs = rand.Int64(length, 0, 100000000);
622 auto rhs = rand.Int64(length, 0, 100000000);
623 auto expected_int64 = (*Subtract(lhs, rhs)).make_array();
624
625 for (auto unit : TimeUnit::values()) {
626 auto timestamp_ty = timestamp(unit);
627 auto duration_ty = duration(unit);
628
629 auto lhs_timestamp = *lhs->View(timestamp_ty);
630 auto rhs_timestamp = *rhs->View(timestamp_ty);
631
632 auto result = (*Subtract(lhs_timestamp, rhs_timestamp)).make_array();
633 ASSERT_TRUE(result->type()->Equals(*duration_ty));
634 AssertArraysEqual(**result->View(int64()), *expected_int64);
635 }
636}
637
638TYPED_TEST(TestBinaryArithmeticIntegral, Mul) {
639 for (auto check_overflow : {false, true}) {

Callers

nothing calls this directly

Calls 15

AssertArraysEqualFunction · 0.85
CheckDispatchBestFunction · 0.85
AssertNullToNullFunction · 0.85
CheckScalarBinaryFunction · 0.85
ArrayFromJSONFunction · 0.85
CallFunctionFunction · 0.85
make_arrayMethod · 0.80
SubtractClass · 0.70
valuesFunction · 0.50
timestampFunction · 0.50
durationFunction · 0.50
dictionaryFunction · 0.50

Tested by

no test coverage detected