testsuite/tests/iconv/bad_charset/test.adb
raw| 1 | with GNATCOLL.Iconv; |
| 2 | with Test_Assert; |
| 3 | |
| 4 | function Test return Integer is |
| 5 | package Iconv renames GNATCOLL.Iconv; |
| 6 | package A renames Test_Assert; |
| 7 | |
| 8 | St : Iconv.Iconv_T; |
| 9 | Success : Boolean := False; |
| 10 | begin |
| 11 | begin |
| 12 | St := Iconv.Iconv_Open ("nonexistent", "nonexistent"); |
| 13 | exception |
| 14 | when Iconv.Unsupported_Conversion => |
| 15 | Success := True; |
| 16 | end; |
| 17 | |
| 18 | A.Assert (Success, Msg => "handling of bad charset"); |
| 19 | return A.Report; |
| 20 | end Test; |