| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| |
|
|
| #include <config.h> |
|
|
| #include "unicase.h" |
|
|
| #include "unistr.h" |
| #include "macros.h" |
|
|
| #define UNIT uint8_t |
| #include "test-is-uppercase.h" |
| #undef UNIT |
|
|
| static void |
| test_nonascii (int (*my_is) (const uint8_t *, size_t, const char *, bool *)) |
| { |
| |
| { |
| static const uint8_t input[] = { 0xE2, 0x93, 0x97 }; |
| bool result; |
|
|
| ASSERT (my_is (input, SIZEOF (input), NULL, &result) == 0); |
| ASSERT (result == false); |
| } |
| { |
| static const uint8_t input[] = { 0xE2, 0x92, 0xBD }; |
| bool result; |
|
|
| ASSERT (my_is (input, SIZEOF (input), NULL, &result) == 0); |
| ASSERT (result == true); |
| } |
| { |
| static const uint8_t input[] = { 0xCA, 0xB0 }; |
| bool result; |
|
|
| ASSERT (my_is (input, SIZEOF (input), NULL, &result) == 0); |
| ASSERT (result == true); |
| } |
| { |
| static const uint8_t input[] = { 0xE1, 0x80, 0xB4 }; |
| bool result; |
|
|
| ASSERT (my_is (input, SIZEOF (input), NULL, &result) == 0); |
| ASSERT (result == true); |
| } |
| { |
| static const uint8_t input[] = { 0xCA, 0xBD }; |
| bool result; |
|
|
| ASSERT (my_is (input, SIZEOF (input), NULL, &result) == 0); |
| ASSERT (result == true); |
| } |
| } |
|
|
| int |
| main () |
| { |
| test_ascii (u8_is_uppercase); |
| test_nonascii (u8_is_uppercase); |
|
|
| return test_exit_status; |
| } |
|
|