unictype/bidi*: Rename functions.
[pspp] / tests / unictype / test-bidi_test.c
index 468a4021f5ed2f22a445d94b6a01fc8412cd0ac1..908d1b7e199c4ee04a9de10d8688a64bd08279e6 100644 (file)
@@ -1,5 +1,5 @@
 /* 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;