For scalar casting tests we use CheckCastZeroCopy [1] which you could reuse.
[1] https://github.com/apache/arrow/blob/e7d6c13d4ae3d8df0e9b668468b990f35c8a9556/cpp/src/arrow/compute/kernels/scalar_cast_test.cc#L128-L138 Rok
For scalar casting tests we use CheckCastZeroCopy [1] which you could reuse.
[1] https://github.com/apache/arrow/blob/e7d6c13d4ae3d8df0e9b668468b990f35c8a9556/cpp/src/arrow/compute/kernels/scalar_cast_test.cc#L128-L138 Rok