/* Test the Unicode character type functions.
- Copyright (C) 2007-2008 Free Software Foundation, Inc.
+ Copyright (C) 2007-2009, 2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "unictype.h"
-#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
-#define ASSERT(expr) \
- do \
- { \
- if (!(expr)) \
- { \
- fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
- fflush (stderr); \
- abort (); \
- } \
- } \
- while (0)
+#include "macros.h"
int
main ()
{
- ASSERT (uc_is_bidi_category ('x', UC_BIDI_L));
- ASSERT (!uc_is_bidi_category ('x', UC_BIDI_R));
- ASSERT (!uc_is_bidi_category ('x', UC_BIDI_EN));
+ ASSERT (uc_is_bidi_class ('x', UC_BIDI_L));
+ ASSERT (!uc_is_bidi_class ('x', UC_BIDI_R));
+ ASSERT (!uc_is_bidi_class ('x', UC_BIDI_EN));
- ASSERT (uc_is_bidi_category (0x05D7, UC_BIDI_R));
- ASSERT (!uc_is_bidi_category (0x05D7, UC_BIDI_L));
- ASSERT (!uc_is_bidi_category (0x05D7, UC_BIDI_EN));
+ ASSERT (uc_is_bidi_class (0x05D7, UC_BIDI_R));
+ ASSERT (!uc_is_bidi_class (0x05D7, UC_BIDI_L));
+ ASSERT (!uc_is_bidi_class (0x05D7, UC_BIDI_EN));
- ASSERT (uc_is_bidi_category ('7', UC_BIDI_EN));
- ASSERT (!uc_is_bidi_category ('7', UC_BIDI_L));
- ASSERT (!uc_is_bidi_category ('7', UC_BIDI_R));
+ ASSERT (uc_is_bidi_class ('7', UC_BIDI_EN));
+ ASSERT (!uc_is_bidi_class ('7', UC_BIDI_L));
+ ASSERT (!uc_is_bidi_class ('7', UC_BIDI_R));
{
unsigned int c;
for (c = 0; c < 0x110000; c++)
- ASSERT (uc_is_bidi_category (c, uc_bidi_category (c)));
+ ASSERT (uc_is_bidi_class (c, uc_bidi_class (c)));
}
return 0;