Esempio n. 1
0
void test_one_buffer()
{
  GstElement *identity;
  GstBuffer *buffer;
  
  xmlfile = "identity_test_one_buffer";
  std_log(LOG_FILENAME_LINE, "Test Started test_one_buffer");

  identity = setup_identity ();
  fail_unless (gst_element_set_state (identity,
          GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
      "could not set to playing");

  
  buffer = gst_buffer_new_and_alloc (4);
  ASSERT_BUFFER_REFCOUNT (buffer, "buffer", 1);
  memcpy (GST_BUFFER_DATA (buffer), "data", 4);

  /* pushing gives away my reference ... */
  fail_unless (gst_pad_push (mysrcpad, buffer) == GST_FLOW_OK,
      "Failed pushing buffer to identity");
  

  /* ... but it should end up being collected on the global buffer list */
  fail_unless (g_list_length (buffers) == 1);
  
  fail_unless ((GstBuffer *) (g_list_first (buffers)->data) == buffer);
  
  ASSERT_BUFFER_REFCOUNT (buffer, "buffer", 1);

  /* cleanup */
  cleanup_identity (identity);
  std_log(LOG_FILENAME_LINE, "Test Successful");
  create_xml(0); 
}
Esempio n. 2
0
void *setup_mmu(phys_addr_t phys_end){
	pgd_t *page_root;

	/* allocate a region-1 table */
	page_root = pgd_alloc_one();

	/* map all physical memory 1:1 */
	setup_identity(page_root, 0, phys_end);

	/* generate 128MB of invalid adresses at the end (for testing PGM) */
	init_alloc_vpage((void *) -(1UL << 27));
	setup_identity(page_root, -(1UL << 27), 0);

	/* finally enable DAT with the new table */
	mmu_enable(page_root);
	table_root = page_root;
	return page_root;
}