$(NULL)
if HAVE_PTHREAD
+if HAVE_FREETYPE
TEST_PROGS += test-multithread
-test_multithread_CFLAGS = $(CFLAGS) $(PTHREAD_CFLAGS)
-test_multithread_LDADD = $(LDADD) $(PTHREAD_LIBS)
+test_multithread_CFLAGS = $(CFLAGS) $(PTHREAD_CFLAGS) $(FREETYPE_CFLAGS)
+test_multithread_LDADD = $(LDADD) $(PTHREAD_LIBS) $(FREETYPE_LIBS)
+endif
endif
if HAVE_FREETYPE
#include <pthread.h>
#include <hb.h>
+#include <hb-ft.h>
#include <hb-ot.h>
const char *text = "طرحنَما";
return 0;
}
-int
-main (int argc, char **argv)
+void
+test_body ()
{
int i;
int num_threads = 30;
pthread_mutex_lock (&mutex);
- hb_blob_t *blob = hb_blob_create_from_file (path);
- hb_face_t *face = hb_face_create (blob, 0);
- font = hb_font_create (face);
- hb_ot_font_set_funcs (font);
-
for (i = 0; i < num_threads; i++)
{
hb_buffer_t *buffer = hb_buffer_create ();
HB_BUFFER_SERIALIZE_FLAG_DEFAULT);
fprintf (stderr, "Expected: %s\n", out);
- return 1;
+ exit (1);
}
hb_buffer_destroy (buffer);
}
free (buffers);
free (threads);
+}
+
+int
+main (int argc, char **argv)
+{
+ hb_blob_t *blob = hb_blob_create_from_file (path);
+ hb_face_t *face = hb_face_create (blob, 0);
+ font = hb_font_create (face);
+
+ hb_ft_font_set_funcs (font);
+ test_body ();
+ hb_ot_font_set_funcs (font);
+ test_body ();
hb_font_destroy (font);
hb_face_destroy (face);