diff --git a/src/hb-ot-os2-table.hh b/src/hb-ot-os2-table.hh index 18dc4ab07..5f4e2db0d 100644 --- a/src/hb-ot-os2-table.hh +++ b/src/hb-ot-os2-table.hh @@ -78,7 +78,7 @@ struct os2 { hb_codepoint_t min = -1, max = 0; - for (int i = 0; i < codepoints.len; i++) + for (unsigned int i = 0; i < codepoints.len; i++) { hb_codepoint_t cp = codepoints[i]; if (cp < min) diff --git a/test/api/hb-subset-test.h b/test/api/hb-subset-test.h index 12d402d33..49e5db480 100644 --- a/test/api/hb-subset-test.h +++ b/test/api/hb-subset-test.h @@ -86,6 +86,7 @@ hb_subset_test_open_font (const char *font_path) return face; } g_assert (false); + return NULL; /* Shut up, compiler! */ } static inline hb_face_t * @@ -114,7 +115,7 @@ hb_subset_test_check (hb_face_t *expected, { hb_blob_t *expected_blob = hb_face_reference_table (expected, table); hb_blob_t *actual_blob = hb_face_reference_table (actual, table); - hb_test_assert_blob_eq(expected_blob, actual_blob); + hb_test_assert_blobs_equal (expected_blob, actual_blob); hb_blob_destroy (expected_blob); hb_blob_destroy (actual_blob); } diff --git a/test/api/hb-test.h b/test/api/hb-test.h index 48ccc3b28..a88b00c48 100644 --- a/test/api/hb-test.h +++ b/test/api/hb-test.h @@ -160,8 +160,14 @@ typedef void (*hb_test_fixture_func_t) (void); #if !GLIB_CHECK_VERSION(2,30,0) #define g_test_fail() g_error("Test failed") #endif +#ifndef g_assert_true +#define g_assert_true g_assert +#endif +#ifndef g_assert_cmpmem +#define g_assert_cmpmem(m1, l1, m2, l2) g_assert_true (l1 == l2 && memcmp (m1, m2, l1) == 0) +#endif -static inline void hb_test_assert_blob_eq(hb_blob_t *expected_blob, hb_blob_t *actual_blob) +static inline void hb_test_assert_blobs_equal (hb_blob_t *expected_blob, hb_blob_t *actual_blob) { unsigned int expected_length, actual_length; const char *raw_expected = hb_blob_get_data (expected_blob, &expected_length); @@ -170,7 +176,6 @@ static inline void hb_test_assert_blob_eq(hb_blob_t *expected_blob, hb_blob_t *a g_assert_cmpint(0, ==, memcmp(raw_expected, raw_actual, expected_length)); } - static inline void hb_test_add_func (const char *test_path, hb_test_func_t test_func)