Lines Matching refs:fixture
101 free_up (fixture_t *fixture) in free_up() argument
103 g_assert_cmpint (fixture->freed, ==, 0); in free_up()
104 fixture->freed++; in free_up()
108 free_up_free (fixture_t *fixture) in free_up_free() argument
110 free_up (fixture); in free_up_free()
111 free (fixture->data); in free_up_free()
135 free_up_munmap (fixture_t *fixture) in free_up_munmap() argument
137 free_up (fixture); in free_up_munmap()
138 munmap (fixture->data, get_pagesize ()); in free_up_munmap()
144 fixture_init (fixture_t *fixture, gconstpointer user_data) in fixture_init() argument
191 fixture->freed = 0; in fixture_init()
192 fixture->data = (char *) data; in fixture_init()
193 fixture->len = len; in fixture_init()
194 fixture->blob = hb_blob_create (data, len, mm, fixture, free_func); in fixture_init()
198 fixture_finish (fixture_t *fixture, gconstpointer user_data HB_UNUSED) in fixture_finish() argument
200 hb_blob_destroy (fixture->blob); in fixture_finish()
201 g_assert_cmpint (fixture->freed, ==, 1); in fixture_finish()
206 test_blob (fixture_t *fixture, gconstpointer user_data) in test_blob() argument
208 hb_blob_t *b = fixture->blob; in test_blob()
218 g_assert_cmpint (len, ==, fixture->len); in test_blob()
221 g_assert_cmpint (len, ==, fixture->len); in test_blob()
223 g_assert (data != fixture->data); in test_blob()
224 g_assert_cmpint (fixture->freed, ==, 1); in test_blob()
227 g_assert (data == fixture->data); in test_blob()
228 g_assert_cmpint (fixture->freed, ==, 0); in test_blob()
232 g_assert_cmpint (len, ==, fixture->len); in test_blob()
234 g_assert (0 == memcmp (data_writable, fixture->data, fixture->len)); in test_blob()
237 g_assert_cmpint (fixture->freed, ==, 1); in test_blob()
243 g_assert_cmpint (len, ==, fixture->len); in test_blob()
246 memset (data_writable, 0, fixture->len); in test_blob()
259 g_assert_cmpint (len, ==, fixture->len); in test_blob()
265 test_blob_subblob (fixture_t *fixture, gconstpointer user_data) in test_blob_subblob() argument
267 hb_blob_t *b = fixture->blob; in test_blob_subblob()
275 g_assert_cmpint (fixture->freed, ==, 1); in test_blob_subblob()
276 fixture->data = (char *) hb_blob_get_data (b, NULL); in test_blob_subblob()
278 g_assert_cmpint (fixture->freed, ==, 0); in test_blob_subblob()
280 fixture->blob = hb_blob_create_sub_blob (b, 1, fixture->len - 2); in test_blob_subblob()
282 b = fixture->blob; in test_blob_subblob()
289 g_assert_cmpint (len, ==, fixture->len - 2); in test_blob_subblob()
292 g_assert_cmpint (len, ==, fixture->len - 2); in test_blob_subblob()
293 g_assert (data == fixture->data + 1); in test_blob_subblob()
296 g_assert_cmpint (len, ==, fixture->len - 2); in test_blob_subblob()
299 g_assert (0 == memcmp (data_writable, fixture->data + 1, fixture->len - 2)); in test_blob_subblob()
301 g_assert_cmpint (fixture->freed, ==, 1); in test_blob_subblob()
304 g_assert_cmpint (len, ==, fixture->len - 2); in test_blob_subblob()
307 memset (data_writable, 0, fixture->len - 2); in test_blob_subblob()
320 g_assert_cmpint (len, ==, fixture->len - 2); in test_blob_subblob()
340 hb_test_add_fixture_flavor (fixture, blob_type, blob_name, test_blob); in main()
341 hb_test_add_fixture_flavor (fixture, blob_type, blob_name, test_blob_subblob); in main()