Skip to content

Commit

Permalink
GH-44483: [GLib] Don't check invalid decimal precision message in test (
Browse files Browse the repository at this point in the history
#44484)

### Rationale for this change

Two tests failed if `-DARROW_EXTRA_ERROR_CONTEXT=ON` in the C++ build.

### What changes are included in this PR?

Don't check invalid decimal precision message in test. Because it depends on `-DARROW_EXTRA_ERROR_CONTEXT={ON,OFF}`. Our tests should be stable whether the option value. 

Before this change: compare the exception class and message.
After this change: compare the exception class only.

### Are these changes tested?

YES

Before this change

```
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1962 tests, 2148 assertions, 2 failures, 0 errors, 0 pendings, 14 omissions, 0 notifications
99.8973% passed
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
23.71 tests/s, 25.95 assertions/s
```

After this change

```
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1962 tests, 2148 assertions, 0 failures, 0 errors, 0 pendings, 14 omissions, 0 notifications
100% passed
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
23.75 tests/s, 26.00 assertions/s
```

### Are there any user-facing changes?

No.
* GitHub Issue: #44483

Co-Authored-by: Sutou Kouhei <kou@ clear-code.com>

Authored-by: Hiroyuki Sato <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
  • Loading branch information
hiroyuki-sato authored Oct 21, 2024
1 parent 54697ea commit 375b21f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions c_glib/test/test-decimal128-data-type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ def test_decimal_data_type_new
end

def test_invalid_precision
message =
"[decimal128-data-type][new]: Invalid: Decimal precision out of range [1, 38]: 39"
assert_raise(Arrow::Error::Invalid.new(message)) do
assert_raise(Arrow::Error::Invalid) do
Arrow::Decimal128DataType.new(39, 1)
end
end
Expand Down
4 changes: 1 addition & 3 deletions c_glib/test/test-decimal256-data-type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ def test_decimal_data_type_new
end

def test_invalid_precision
message =
"[decimal256-data-type][new]: Invalid: Decimal precision out of range [1, 76]: 77"
assert_raise(Arrow::Error::Invalid.new(message)) do
assert_raise(Arrow::Error::Invalid) do
Arrow::Decimal256DataType.new(77, 1)
end
end
Expand Down

0 comments on commit 375b21f

Please sign in to comment.