static void startup(void)
{
        tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ ");

	Elm_Calendar_Mark *mark;
	struct tm selected_time;
	time_t current_time;

        elm_init(0, NULL);
        main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
        evas_object_show(main_win);

        test_eo = elm_calendar_add(main_win);

	current_time = time(NULL) + 1 * 84600;
	localtime_r(&current_time, &selected_time);
	mark = elm_calendar_mark_add(test_eo, "checked", &selected_time, ELM_CALENDAR_UNIQUE);
}
/**
 * @brief Positive test case of elm_segment_control_item_del()
 */
static void utc_UIFW_elm_segment_control_item_del_func_01(void)
{
   Elm_Object_Item *item = NULL;
   Elm_Object_Item *it = NULL;
   Evas_Object *segment = NULL;

   segment = elm_segment_control_add(main_win);
   evas_object_show(segment);
   item = elm_segment_control_item_add(segment, NULL, "All");
   elm_segment_control_item_del(item);
   it = elm_segment_control_item_get(segment,0);
   if (it) {
      tet_infoline("elm_segment_control_item_del() failed in positive test case");
      tet_result(TET_FAIL);
      return;
   }
   tet_result(TET_PASS);
}
Example #3
0
static void
tp1()         /* successful uname: return 0 */
{
    int ret, err;
    struct utsname name;

    tet_infoline("UNAME OUTPUT FOR MANUAL CHECK");

    /* The test cannot determine automatically whether the information
       returned by uname() is correct.  It therefore outputs the
       information with an INSPECT result code for checking manually. */

    errno = 0;
    if ((ret=uname(&name)) != 0)
    {
        err = errno;
        (void) sprintf(msg, "uname() returned %d, expected 0", ret);
        tet_infoline(msg);
        if (err != 0)
        {
            (void) sprintf(msg, "errno was set to %d", err);
            tet_infoline(msg);
        }
        tet_result(TET_FAIL);
    }
    else
    {
	(void) sprintf(msg, "System Name:  \"%s\"", name.sysname);
	tet_infoline(msg);
	(void) sprintf(msg, "Node Name:    \"%s\"", name.nodename);
	tet_infoline(msg);
	(void) sprintf(msg, "Release:      \"%s\"", name.release);
	tet_infoline(msg);
	(void) sprintf(msg, "Version:      \"%s\"", name.version);
	tet_infoline(msg);
	(void) sprintf(msg, "Machine Type: \"%s\"", name.machine);
	tet_infoline(msg);

        tet_result(TET_INSPECT);
    }
}
/**
 * @brief Positive test case of elm_radio_label_get()
 */
static void utc_UIFW_elm_radio_label_get_func_01(void)
{
   Evas_Object *radio = NULL;
   char *buffer;
   radio = elm_radio_add(main_win);
   radio = elm_radio_add(main_win);
   elm_radio_label_set(radio, "label");
   buffer = elm_radio_label_get(radio);
   if(!buffer)
      {
         tet_infoline("elm_radio_label_get() failed in positive test case");
         tet_result(TET_FAIL);
         return;
      }
   evas_object_show(radio);
   evas_object_del(radio);
   radio = NULL;
   tet_result(TET_PASS);
}
/**
 * @brief Positive test case of elm_genlist_item_data_get()
 */
static void utc_UIFW_elm_genlist_item_data_get_func_01(void)
{
	Elm_Object_Item *it = NULL;
	char *my_data = NULL, *data = "123", *get_data = NULL;

	it = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);

	my_data = (char *)calloc(sizeof(char), 10);
	strcpy(my_data, data);
	elm_genlist_item_data_set(it, my_data);
	get_data = (char *)elm_genlist_item_data_get(it);

	if (get_data != my_data) {
		tet_infoline("elm_genlist_add() failed in positive test case");
		tet_result(TET_FAIL);
		return;
	}
	tet_result(TET_PASS);
}
/**
 * @brief Positive test case of elm_bubble_info_get()
 */
static void utc_UIFW_elm_bubble_info_get_func_01(void)
{
	const char *info = NULL;

	bubble = elm_bubble_add(main_win);
	elm_bubble_info_set(bubble, "09:42 AM");
	info = elm_bubble_info_get(bubble);

	if (!info || strcmp(info, "09:42 AM")) {
		tet_infoline("elm_bubble_info_get() failed in positive test case");
		tet_result(TET_FAIL);
		return;
	}

	evas_object_resize(bubble, 480, 0);
	evas_object_move(bubble, 0, 40);
	evas_object_show(bubble);

	tet_result(TET_PASS);
}
Example #7
0
void
tcData_tpElf(void)
{
	Elf *e;

	TP_CHECK_INITIALIZATION();

	tet_infoline("assertion: " TS_ICNAME "(E) for non-ELF (E) fails with "
	    "ELF_E_ARGUMENT.");

	TS_OPEN_MEMORY(e, data);

	if (TS_ICFUNC(e) != NULL ||
	    elf_errno() != ELF_E_ARGUMENT)
		tet_result(TET_FAIL);
	else
		tet_result(TET_PASS);

	(void) elf_end(e);
}
/**
 * @brief Positive test case of elm_check_state_get()
 */
static void utc_UIFW_elm_check_state_get_func_01(void)
{
   Evas_Object *check = NULL;
   Eina_Bool state;

   check = elm_check_add(main_win);
   elm_check_state_set(check, EINA_TRUE);
   state = elm_check_state_get(check);
   if(state == EINA_FALSE)
      {
         evas_object_del(check);
         tet_infoline("elm_check_state_get() failed in positive test case");
         tet_result(TET_FAIL);
         return;
      }
   evas_object_show(check);
   evas_object_del(check);
   check = NULL;
   tet_result(TET_PASS);
}
/**
 * @brief Positive test case of elm_segment_control_item_label_set()
 */
static void utc_UIFW_elm_segment_control_item_label_set_func_01(void)
{
   Elm_Object_Item *item = NULL;
   const char *label = NULL;
   Evas_Object *segment = NULL;
   int index;

   segment = elm_segment_control_add(main_win);
   evas_object_show(segment);
   item = elm_segment_control_item_add(segment, NULL, "test");
   elm_segment_control_item_label_set(item, "All");
   index = elm_segment_control_item_index_get(item);
   label = elm_segment_control_item_label_get(segment, index);
   if (!(strcmp(label,"All"))) {
      tet_result(TET_PASS);
      return;
   }
   tet_infoline("elm_segment_control_item_label_set() failed in positive test case");
   tet_result(TET_FAIL);
}
/**
 * @brief Negative test case of ug_init elm_button_icon_get()
 */
static void utc_UIFW_elm_button_icon_get_func_02(void)
{
   Evas_Object *button = NULL;
   Evas_Object *icon = NULL;
   char buff[PATH_MAX];
   button = elm_button_add(main_win);
   icon = elm_icon_add(main_win);
   snprintf(buff, sizeof(buff), "%s/images/logo_small.png", "/usr/share/elementary");
   elm_icon_file_set(icon, buff, NULL);
   evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
   elm_icon_scale_set(icon, EINA_TRUE, EINA_TRUE);
   elm_button_icon_set(button, icon);
   if(elm_button_icon_get(NULL) != NULL)
      {
        evas_object_del(button);
        button = NULL;
        tet_infoline("elm_button_icon_get() failed in negative test case");
        tet_result(TET_FAIL);
        return;
      }
   tet_result(TET_PASS);
}
/* Allocates Semaphores*/
int avs_alloc_sem()
{
	vsw_debug_enter("libXtTest/event.c:avs_alloc_sem()",0);

	if (semid != -1) {
		vsw_debug_exit("libXtTest/event.c:avs_alloc_sem()",0);
		return(0);
	}

	semid = semget(IPC_PRIVATE, NUM_EVENTS, IPC_CREAT | SEM_PERM);
	if (semid == -1) {
		trace("Allocating semaphores");
		sprintf(ebuf, "ERROR: semget failed, errno = %s", err_lookup(errno));
		tet_infoline(ebuf);
		tet_result(TET_UNRESOLVED);
		vsw_debug_exit("libXtTest/event.c:avs_alloc_sem()",0);
		return(-1);
	}

	vsw_debug_exit("libXtTest/event.c:avs_alloc_sem()",0);
	return(0);
}
static void startup(void)
{
	Elm_Object_Item *item = NULL;
	int index = 0;
	tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ ");
	elm_init(0, NULL);
	main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
	evas_object_show(main_win);
	genlist = elm_genlist_add(main_win);
	evas_object_show(genlist);
	elm_win_resize_object_add(main_win, genlist);
	evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
	evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
	itc.item_style = "1line_textonly";
	itc.func.text_get = _gl_text_get;
	itc.func.content_get = NULL;
	itc.func.state_get = NULL;
	itc.func.del = NULL;
	for (index = 0; index < 5; index++) {
		item = elm_genlist_item_append(genlist, &itc, (void *) index, NULL,
				ELM_GENLIST_ITEM_NONE, NULL, NULL);
	}
}
Example #13
0
static void
tp_dwarf_init(void)
{
	Dwarf_Debug dbg;
	Dwarf_Error de;
	int fd, result;

	result = TET_UNRESOLVED;

	assert(_cur_file != NULL);
	dbg = NULL;
	if ((fd = open(_cur_file, O_RDONLY)) < 0) {
		tet_printf("open %s failed: %s", _cur_file, strerror(errno));
		result = TET_FAIL;
		goto done;
	}

	if (dwarf_init(fd, DW_DLC_READ, NULL, NULL, &dbg, &de) != DW_DLV_OK) {
		tet_printf("dwarf_init failed: %s", dwarf_errmsg(de));
		result = TET_FAIL;
		goto done;
	}

	if (dwarf_init(-1, DW_DLC_READ, NULL, NULL, &dbg, &de) != DW_DLV_ERROR) {
		tet_infoline("dwarf_init didn't return DW_DLV_ERROR when"
		    " called with fd(-1)");
		result = TET_FAIL;
		goto done;
	}

	if (result == TET_UNRESOLVED)
		result = TET_PASS;

done:
	TS_DWARF_FINISH(dbg, de);
	TS_RESULT(result);
}
static void startup(void)
{
	tet_infoline("drm_get_content_info:Test started");
}
static void cleanup(void)
{
	tet_infoline("drm_get_license_status:Test completed");
}
Example #16
0
static void
_frame3_test(Dwarf_Debug dbg, Dwarf_Fde fde, Dwarf_Addr pc,
    Dwarf_Unsigned func_len, Dwarf_Unsigned caf)
{
	Dwarf_Signed offset_relevant, register_num, offset_or_block_len;
	Dwarf_Addr pc_end, row_pc;
	Dwarf_Ptr block_ptr;
	Dwarf_Regtable3 reg_table3;
	Dwarf_Small value_type;
	Dwarf_Error de;
	int i, cnt;

	/* Initialise regster table (DWARF3). */
	reg_table3.rt3_reg_table_size = DW_REG_TABLE_SIZE;
	reg_table3.rt3_rules = calloc(reg_table3.rt3_reg_table_size,
	    sizeof(Dwarf_Regtable_Entry3));
	if (reg_table3.rt3_rules == NULL) {
		tet_infoline("calloc failed when initialising reg_table3");
		result = TET_FAIL;
		return;
	}

	/* Sanity check for invalid table_column. */
	if (dwarf_get_fde_info_for_reg3(fde, 9999, 0, &value_type,
	    &offset_relevant, &register_num, &offset_or_block_len, &block_ptr,
	    &row_pc, &de) != DW_DLV_ERROR) {
		tet_infoline("dwarf_get_fde_info_for_reg3 didn't return"
		    " DW_DLV_ERROR when called with invalid table_column"
		    " value");
		result = TET_FAIL;
		return;
	}

	cnt = 0;
	pc_end = pc + func_len;
	while (pc < pc_end && cnt < 16) {
		tet_printf("query CFA(3) register pc %#jx\n", (uintmax_t) pc);
		if (dwarf_get_fde_info_for_cfa_reg3(fde, pc, &value_type,
		    &offset_relevant, &register_num, &offset_or_block_len,
		    &block_ptr, &row_pc, &de) != DW_DLV_OK) {
			tet_printf("dwarf_get_fde_info_for_reg3(cfa) failed: %s",
			    dwarf_errmsg(de));
			result = TET_FAIL;
			return;
		}
		TS_CHECK_INT(value_type);
		TS_CHECK_INT(offset_relevant);
		TS_CHECK_INT(offset_or_block_len);
		TS_CHECK_INT(register_num);
		TS_CHECK_UINT(row_pc);
		if (value_type == DW_EXPR_EXPRESSION ||
		    value_type == DW_EXPR_VAL_EXPRESSION)
			TS_CHECK_BLOCK(block_ptr, offset_or_block_len);
		for (i = 1; i < _MAX_REG_NUM; i++) {
			tet_printf("query register(3) %d\n", i);
			if (dwarf_get_fde_info_for_reg3(fde, i, pc, &value_type,
			    &offset_relevant, &register_num,
			    &offset_or_block_len, &block_ptr,
			    &row_pc, &de) != DW_DLV_OK) {
				tet_printf("dwarf_get_fde_info_for_reg3(%d)"
				    " failed: %s", i, dwarf_errmsg(de));
				result = TET_FAIL;
				goto next;
			}
			TS_CHECK_INT(value_type);
			TS_CHECK_INT(offset_relevant);
			TS_CHECK_INT(offset_or_block_len);
			TS_CHECK_INT(register_num);
			TS_CHECK_UINT(row_pc);
			if (value_type == DW_EXPR_EXPRESSION ||
			    value_type == DW_EXPR_VAL_EXPRESSION)
				TS_CHECK_BLOCK(block_ptr, offset_or_block_len);
		}
		tet_infoline("query all register(3)");
		if (dwarf_get_fde_info_for_all_regs3(fde, pc, &reg_table3,
		    &row_pc, &de) != DW_DLV_OK) {
			tet_printf("dwarf_get_fde_info_for_all_regs failed: %s",
			    dwarf_errmsg(de));
			result = TET_FAIL;
			goto next;
		}
		TS_CHECK_UINT(row_pc);

#define	CFA3	reg_table3.rt3_cfa_rule
#define	RT3	reg_table3.rt3_rules
		TS_CHECK_UINT(CFA3.dw_offset_relevant);
		TS_CHECK_UINT(CFA3.dw_value_type);
		TS_CHECK_UINT(CFA3.dw_regnum);
		TS_CHECK_UINT(CFA3.dw_offset_or_block_len);
		if (CFA3.dw_value_type == DW_EXPR_EXPRESSION ||
		    CFA3.dw_value_type == DW_EXPR_VAL_EXPRESSION)
			TS_CHECK_BLOCK(CFA3.dw_block_ptr,
			    CFA3.dw_offset_or_block_len);
		for (i = 0; i < _MAX_REG_NUM; i++) {
			tet_printf("check reg_table3[%d]\n", i);
			TS_CHECK_UINT(RT3[i].dw_offset_relevant);
			TS_CHECK_UINT(RT3[i].dw_value_type);
			TS_CHECK_UINT(RT3[i].dw_regnum);
			TS_CHECK_UINT(RT3[i].dw_offset_or_block_len);
			if (RT3[i].dw_value_type == DW_EXPR_EXPRESSION ||
			    RT3[i].dw_value_type == DW_EXPR_VAL_EXPRESSION)
				TS_CHECK_BLOCK(RT3[i].dw_block_ptr,
				    RT3[i].dw_offset_or_block_len);
		}
#undef CFA3
#undef RT3
		
	next:
		pc += caf;
		cnt++;
	}
}
/**
 * @brief Positive test case of drm_get_constraint_info()
 */
static void utc_drmclient_drm_get_constraint_info_func_01(void)
{
	int ret = DRM_RETURN_INTERNAL_ERROR ;
	drm_constraint_info_s constraint_info;
	drm_permission_type_e perm_type = DRM_PERMISSION_TYPE_PLAY;
	char file_path[FILE_PATH_MAX_SIZE] = {0,};
	snprintf(file_path,FILE_PATH_MAX_SIZE, "%s",FILE_PATH_VALID_FILE_OMA_1);

	ret = drm_get_constraint_info(file_path,perm_type,&constraint_info);
	if(DRM_RETURN_SUCCESS == ret ){
			tet_infoline("drm_get_constraint_info PASS!!!");
			tet_printf ("file_path checked is %s",FILE_PATH_VALID_FILE_OMA_1);
			tet_printf ("ret = 0x%x",ret);
			if(constraint_info.const_type.is_unlimited){
				tet_printf("Unlimited:for permission=%d",perm_type);
			}

			if(constraint_info.const_type.is_accumulated){
				tet_printf("Accumulated Constraint is present");
				tet_printf("accumulated_original_seconds=%d",
						constraint_info.accumulated_original_seconds);
				tet_printf("accumulated_remaining_seconds=%d",
						constraint_info.accumulated_remaining_seconds);
			}

			if(constraint_info.const_type.is_count){
				tet_printf("Count Constraint is present");
				tet_printf("original_count=%d",
						constraint_info.original_count);
				tet_printf("remaining_count=%d",
						constraint_info.remaining_count);
			}

			if(constraint_info.const_type.is_datetime){
				tet_printf("DATETIME Constraint is present");
				tet_printf("start_time:"
						"Year=%d,Month=%d,Day=%d,Hour=%d, minute=%d, Second=%d",
					constraint_info.start_time.tm_year,
					constraint_info.start_time.tm_mon,
					constraint_info.start_time.tm_mday,
					constraint_info.start_time.tm_hour,
					constraint_info.start_time.tm_min,
					constraint_info.start_time.tm_sec);

				tet_printf("end_time:"
						"Year=%d,Month=%d,Day=%d,Hour=%d, minute=%d, Second=%d",
					constraint_info.end_time.tm_year,
					constraint_info.end_time.tm_mon,
					constraint_info.end_time.tm_mday,
					constraint_info.end_time.tm_hour,
					constraint_info.end_time.tm_min,
					constraint_info.end_time.tm_sec);
			}

			if(constraint_info.const_type.is_individual){
				tet_printf("INDIVIDUAL Constraint is present");
				tet_printf("individual_identity_type=%d "
						"individual_id=%s",
						constraint_info.individual_identity_type,
						constraint_info.individual_id);

			}

			if(constraint_info.const_type.is_interval){
				tet_printf("INTERVAL Constraint is present");
				tet_printf("interval_time:"
						"Year=%d,Month=%d,Day=%d,Hour=%d, minute=%d, Second=%d",
					constraint_info.interval_time.tm_year,
					constraint_info.interval_time.tm_mon,
					constraint_info.interval_time.tm_mday,
					constraint_info.interval_time.tm_hour,
					constraint_info.interval_time.tm_min,
					constraint_info.interval_time.tm_sec);
			}

			if(constraint_info.const_type.is_system){
				tet_printf("SYSTEM Constraint is present");
				tet_printf("system_identity_type=%d "
						"system_id=%s",
						constraint_info.system_identity_type,
						constraint_info.system_id);
			}

			if(constraint_info.const_type.is_timedcount){
				tet_printf("TIMED-COUNT Constraint is present");
				tet_printf("timed_original_count=%d",
						constraint_info.timed_original_count);

				tet_printf("timed_remaining_count=%d",
						constraint_info.timed_remaining_count);

				tet_printf("timed_count_timer=%d",
										constraint_info.timed_count_timer);
			}

			tet_result(TET_PASS);
	}else{
			tet_infoline("drm_get_constraint_info");
			tet_printf ("file_path checked is %s",FILE_PATH_VALID_FILE_OMA_1);
			tet_printf ("ret = 0x%x",ret);
			tet_result(TET_FAIL);
	}
}
static void startup(void)
{
	tet_infoline("drm_get_license_status:Test started");
	tet_infoline("OMA DRM Content should be registered");
	tet_infoline("RO must be installed to get valid License status");
}
Example #19
0
void cleanup(){
	printf("ctest1: cleanup\n");
	tet_infoline("ctest1: cleanup");
}
void tet_mds_cleanup()
{
  tet_infoline(" Ending the agony.. ");
}
Example #21
0
File: tc1.c Project: npe9/tet3.8
void tp1()
{
	tet_infoline("This is the first test case (tc1)");
	tet_result(TET_PASS);
}
Example #22
0
static void
_dwarf_attr(Dwarf_Die die)
{
	Dwarf_Attribute at;
	Dwarf_Bool has_attr;
	Dwarf_Half attr;
	Dwarf_Error de;
	const char *attr_name;
	int i, r;

	for (i = 0; i < attr_array_size; i++) {
		if (dwarf_hasattr(die, attr_array[i], &has_attr, &de) !=
		    DW_DLV_OK) {
			tet_printf("dwarf_hasattr failed: %s\n",
			    dwarf_errmsg(de));
			result = TET_FAIL;
		}
		TS_CHECK_INT(has_attr);

		if (has_attr) {
			if (dwarf_get_AT_name(attr_array[i], &attr_name) !=
			    DW_DLV_OK) {
				tet_printf("dwarf_get_AT_name failed: %s\n",
				    dwarf_errmsg(de));
				result = TET_FAIL;
				continue;
			}
			if (attr_name == NULL) {
				tet_infoline("dwarf_get_AT_name returned "
				    "DW_DLV_OK but didn't return string");
				result = TET_FAIL;
				continue;
			}
			TS_CHECK_STRING(attr_name);

			tet_printf("DIE #%d has attribute '%s'\n", die_cnt,
			    attr_name);

			r = dwarf_attr(die, attr_array[i], &at, &de);
			if (r == DW_DLV_ERROR) {
				tet_printf("dwarf_attr failed: %s",
				    dwarf_errmsg(de));
				result = TET_FAIL;
				continue;
			} else if (r == DW_DLV_NO_ENTRY) {
				tet_infoline("dwarf_hasattr returned true for "
				    "attribute '%s', while dwarf_attr returned"
				    " DW_DLV_NO_ENTRY for the same attr");
				result = TET_FAIL;
				continue;
			}
			if (dwarf_whatattr(at, &attr, &de) != DW_DLV_OK) {
				tet_printf("dwarf_whatattr failed: %s",
				    dwarf_errmsg(de));
				result = TET_FAIL;
				continue;
			}
			if (attr != attr_array[i]) {
				tet_infoline("attr returned by dwarf_whatattr"
				    " != attr_array[i]");
				result = TET_FAIL;
				continue;
			}
		}
	}
}
Example #23
0
static void
_frame2_test(Dwarf_Debug dbg, Dwarf_Fde fde, Dwarf_Addr pc,
    Dwarf_Unsigned func_len, Dwarf_Unsigned caf)
{
	Dwarf_Signed offset_relevant, register_num, offset;
	Dwarf_Addr pc_end, row_pc;
	Dwarf_Regtable reg_table;
	Dwarf_Error de;
	int i, cnt;

	(void) dwarf_set_frame_cfa_value(dbg, DW_FRAME_CFA_COL);

	/* Sanity check for invalid table_column. */
	if (dwarf_get_fde_info_for_reg(fde, 9999, 0, &offset_relevant,
	    &register_num, &offset, &row_pc, &de) != DW_DLV_ERROR) {
		tet_infoline("dwarf_get_fde_info_for_reg didn't return"
		    " DW_DLV_ERROR when called with invalid table_column"
		    " value");
		result = TET_FAIL;
		return;
	}

	cnt = 0;
	pc_end = pc + func_len;
	while (pc < pc_end && cnt < 16) {
		tet_printf("query CFA register pc %#jx\n", (uintmax_t) pc);
		/*
		 * XXX If application want to use DW_FRAME_CFA_COL for CFA,
		 * it should call dwarf_set_frame_cfa_value() to set that
		 * explicitly. So here DW_FRAME_CFA_COL might not be refering
		 * to the CFA at all, depends on whether CFA(0) is set by
		 * dwarf_set_frame_cfa_value.
		 */
		if (dwarf_get_fde_info_for_reg(fde, DW_FRAME_CFA_COL,
		    pc, &offset_relevant, &register_num, &offset,
		    &row_pc, &de) != DW_DLV_OK) {
			tet_printf("dwarf_get_fde_info_for_reg(cfa) failed: %s",
			    dwarf_errmsg(de));
			result = TET_FAIL;
			return;
		}
		TS_CHECK_INT(offset_relevant);
		TS_CHECK_INT(offset);
		TS_CHECK_INT(register_num);
		TS_CHECK_UINT(row_pc);
		for (i = 1; i < _MAX_REG_NUM; i++) {
			tet_printf("query register %d\n", i);
			if (dwarf_get_fde_info_for_reg(fde, i, pc,
			    &offset_relevant, &register_num, &offset,
			    &row_pc, &de) != DW_DLV_OK) {
				tet_printf("dwarf_get_fde_info_for_reg(%d)"
				    " failed: %s", i, dwarf_errmsg(de));
				result = TET_FAIL;
				goto next;
			}
			TS_CHECK_INT(offset_relevant);
			TS_CHECK_INT(offset);
			TS_CHECK_INT(register_num);
			TS_CHECK_UINT(row_pc);
		}
		tet_infoline("query all register");
		if (dwarf_get_fde_info_for_all_regs(fde, pc, &reg_table,
		    &row_pc, &de) != DW_DLV_OK) {
			tet_printf("dwarf_get_fde_info_for_all_regs failed: %s",
			    dwarf_errmsg(de));
			result = TET_FAIL;
			goto next;
		}
		TS_CHECK_UINT(row_pc);
		for (i = 0; i < _MAX_REG_NUM; i++) {
			tet_printf("check reg_table[%d]\n", i);
			TS_CHECK_UINT(reg_table.rules[i].dw_offset_relevant);
			TS_CHECK_UINT(reg_table.rules[i].dw_regnum);
			TS_CHECK_UINT(reg_table.rules[i].dw_offset);
		}
		
	next:
		pc += caf;
		cnt++;
	}
}
Example #24
0
static void
_dwarf_cie_fde_test(Dwarf_Debug dbg, int eh, void (*_frame_test)(Dwarf_Debug,
    Dwarf_Fde, Dwarf_Addr, Dwarf_Unsigned, Dwarf_Unsigned))
{
	Dwarf_Cie *cielist, cie;
	Dwarf_Fde *fdelist, fde;
	Dwarf_Frame_Op *oplist;
	Dwarf_Signed ciecnt, fdecnt;
	Dwarf_Addr low_pc, high_pc;
	Dwarf_Unsigned func_len, fde_byte_len, fde_inst_len, bytes_in_cie;
	Dwarf_Unsigned cie_caf, cie_daf, cie_inst_len;
	Dwarf_Signed cie_index, opcnt;
	Dwarf_Off cie_offset, fde_offset;
	Dwarf_Ptr fde_bytes, fde_inst, cie_initinst;
	Dwarf_Half cie_ra;
	Dwarf_Small cie_version;
	Dwarf_Error de;
	const char *cfa_str;
	char *cie_augmenter;
	int i, j, r_fde_at_pc;

	if (eh) {
		if (dwarf_get_fde_list_eh(dbg, &cielist, &ciecnt, &fdelist,
		    &fdecnt, &de) != DW_DLV_OK) {
			tet_printf("dwarf_get_fde_list_eh failed: %s\n",
			    dwarf_errmsg(de));
			result = TET_FAIL;
			goto done;
		}
	} else {
		if (dwarf_get_fde_list(dbg, &cielist, &ciecnt, &fdelist,
		    &fdecnt, &de) != DW_DLV_OK) {
			tet_printf("dwarf_get_fde_list failed: %s\n",
			    dwarf_errmsg(de));
			result = TET_FAIL;
			goto done;
		}
	}
	TS_CHECK_INT(ciecnt);
	TS_CHECK_INT(fdecnt);

	/*
	 * Test dwarf_get_fde_at_pc using hard-coded PC values.
	 */

	tet_infoline("attempt to get fde at 0x08082a30");
	r_fde_at_pc = dwarf_get_fde_at_pc(fdelist, 0x08082a30, &fde, &low_pc,
	    &high_pc, &de);
	TS_CHECK_INT(r_fde_at_pc);
	if (r_fde_at_pc == DW_DLV_OK) {
		TS_CHECK_UINT(low_pc);
		TS_CHECK_UINT(high_pc);
	}

	tet_infoline("attempt to get fde at 0x08083087");
	r_fde_at_pc = dwarf_get_fde_at_pc(fdelist, 0x08083087, &fde, &low_pc,
	    &high_pc, &de);
	TS_CHECK_INT(r_fde_at_pc);
	if (r_fde_at_pc == DW_DLV_OK) {
		TS_CHECK_UINT(low_pc);
		TS_CHECK_UINT(high_pc);
	}

	tet_infoline("attempt to get fde at 0x080481f0");
	r_fde_at_pc = dwarf_get_fde_at_pc(fdelist, 0x080481f0, &fde, &low_pc,
	    &high_pc, &de);
	TS_CHECK_INT(r_fde_at_pc);
	if (r_fde_at_pc == DW_DLV_OK) {
		TS_CHECK_UINT(low_pc);
		TS_CHECK_UINT(high_pc);
	}

	tet_infoline("attempt to get fde at 0x08048564");
	r_fde_at_pc = dwarf_get_fde_at_pc(fdelist, 0x08048564, &fde, &low_pc,
	    &high_pc, &de);
	TS_CHECK_INT(r_fde_at_pc);
	if (r_fde_at_pc == DW_DLV_OK) {
		TS_CHECK_UINT(low_pc);
		TS_CHECK_UINT(high_pc);
	}

	tet_infoline("attempt to get fde at 0x00401280");
	r_fde_at_pc = dwarf_get_fde_at_pc(fdelist, 0x00401280, &fde, &low_pc,
	    &high_pc, &de);
	TS_CHECK_INT(r_fde_at_pc);
	if (r_fde_at_pc == DW_DLV_OK) {
		TS_CHECK_UINT(low_pc);
		TS_CHECK_UINT(high_pc);
	}

	tet_infoline("attempt to get fde at 0x004012b1");
	r_fde_at_pc = dwarf_get_fde_at_pc(fdelist, 0x004012b1, &fde, &low_pc,
	    &high_pc, &de);
	TS_CHECK_INT(r_fde_at_pc);
	if (r_fde_at_pc == DW_DLV_OK) {
		TS_CHECK_UINT(low_pc);
		TS_CHECK_UINT(high_pc);
	}

	/*
	 * Test each FDE contained in the FDE list.
	 */

	for (i = 0; i < fdecnt; i++) {
		if (dwarf_get_fde_n(fdelist, i, &fde, &de) != DW_DLV_OK) {
			tet_printf("dwarf_get_fde_n(%d) failed: %s\n", i,
			    dwarf_errmsg(de));
			result = TET_FAIL;
			continue;
		}
		if (dwarf_get_fde_range(fde, &low_pc, &func_len, &fde_bytes,
		    &fde_byte_len, &cie_offset, &cie_index, &fde_offset,
		    &de) == DW_DLV_ERROR) {
			tet_printf("dwarf_get_fde_range(%d) failed: %s\n", i,
			    dwarf_errmsg(de));
			result = TET_FAIL;
			continue;
		}
		TS_CHECK_UINT(low_pc);
		TS_CHECK_UINT(func_len);
		TS_CHECK_UINT(fde_byte_len);
		if (fde_byte_len > 0)
			TS_CHECK_BLOCK(fde_bytes, fde_byte_len);
		TS_CHECK_INT(cie_offset);
		TS_CHECK_INT(cie_index);
		TS_CHECK_INT(fde_offset);
		if (dwarf_get_cie_of_fde(fde, &cie, &de) != DW_DLV_OK) {
			tet_printf("dwarf_get_cie_of_fde(%d) failed: %s\n", i,
			    dwarf_errmsg(de));
			result = TET_FAIL;
			continue;
		}
		if (dwarf_get_cie_index(cie, &cie_index, &de) != DW_DLV_OK) {
			tet_printf("dwarf_get_cie_index(%d) failed: %s\n", i,
			    dwarf_errmsg(de));
			result = TET_FAIL;
			continue;
		}
		TS_CHECK_INT(cie_index);
		if (dwarf_get_cie_info(cie, &bytes_in_cie, &cie_version,
		    &cie_augmenter, &cie_caf, &cie_daf, &cie_ra, &cie_initinst,
		    &cie_inst_len, &de) != DW_DLV_OK) {
			tet_printf("dwarf_get_cie_info(%d) failed: %s\n", i,
			    dwarf_errmsg(de));
			result = TET_FAIL;
			continue;
		}
		TS_CHECK_UINT(bytes_in_cie);
		TS_CHECK_UINT(cie_version);
		TS_CHECK_STRING(cie_augmenter);
		TS_CHECK_UINT(cie_caf);
		TS_CHECK_UINT(cie_daf);
		TS_CHECK_UINT(cie_ra);
		TS_CHECK_UINT(cie_inst_len);
		if (cie_inst_len > 0)
			TS_CHECK_BLOCK(cie_initinst, cie_inst_len);
		if (dwarf_get_fde_instr_bytes(fde, &fde_inst, &fde_inst_len,
		    &de) != DW_DLV_OK) {
			tet_printf("dwarf_get_fde_instr_bytes(%d) failed: %s\n",
			    i, dwarf_errmsg(de));
			result = TET_FAIL;
			continue;
		}
		TS_CHECK_UINT(fde_inst_len);
		if (fde_inst_len > 0) {
			TS_CHECK_BLOCK(fde_inst, fde_inst_len);
			if (dwarf_expand_frame_instructions(cie, fde_inst,
			    fde_inst_len, &oplist, &opcnt, &de) != DW_DLV_OK) {
				tet_printf("dwarf_expand_frame_instructions(%d)"
				    " failed: %s\n", i, dwarf_errmsg(de));
				result = TET_FAIL;
				continue;
			}
			TS_CHECK_INT(opcnt);
			for (j = 0; j < opcnt; j++) {
				TS_CHECK_UINT(oplist[j].fp_base_op);
				if (oplist[j].fp_base_op != 0) {
					if (dwarf_get_CFA_name(
					    oplist[j].fp_base_op << 6,
					    &cfa_str) != DW_DLV_OK) {
						tet_printf("dwarf_get_CFA_name"
						    " failed\n");
						continue;
					}
					TS_CHECK_STRING(cfa_str);
				}
				TS_CHECK_UINT(oplist[j].fp_extended_op);
				if (oplist[j].fp_extended_op != 0) {
					if (dwarf_get_CFA_name(
					    oplist[j].fp_extended_op,
					    &cfa_str) != DW_DLV_OK) {
						tet_printf("dwarf_get_CFA_name"
						    " failed\n");
						continue;
					}
					TS_CHECK_STRING(cfa_str);
				}
				TS_CHECK_UINT(oplist[j].fp_register);
				TS_CHECK_INT(oplist[j].fp_offset);
				TS_CHECK_INT(oplist[j].fp_instr_offset);
			}
		}
		_frame_test(dbg, fde, low_pc, func_len, cie_caf);
	}

done:
	return;
}
/*************************************
TETWARE RELATED : ACTUAL INVOCATION
**************************************/
void tet_mds_tds_startup(void)
{
#if (TET_PATCH==1)

  int no_iterations=1,test_case,i;

  
    int SERV_SUIT=0;
    
  char *tmpprt=NULL;
  tmpprt= (char *) getenv("TET_ITERATION");
  if(tmpprt)
    no_iterations= atoi(tmpprt);
  else
    no_iterations=0;
  
  tmpprt= (char *) getenv("TET_SERV_SUITE");
  if(tmpprt)
    SERV_SUIT= atoi(tmpprt);
  else
    SERV_SUIT=0; 
  tmpprt= (char *) getenv("TET_CASE");
  if(tmpprt)
    test_case = atoi(tmpprt);
  else
    test_case =0; 


  tet_infoline("MDS_Startup : Starting");

    {  
      for(i=1;i<=no_iterations;i++)
        {
          if(i!=1)
            {
              if(ncs_agents_shutdown()!=NCSCC_RC_SUCCESS)
                {
                  perror("\n\n ----- NCS AGENTS SHUTDOWN FAILED ----- \n\n");
                  tet_printf("\n ----- NCS AGENTS SHUTDOWN FAILED ----- \n");
                  break;
                }
              sleep(5);
              if(ncs_agents_startup()!=NCSCC_RC_SUCCESS)
                {
                  perror("\n\n ----- NCS AGENTS START UP FAILED ------- \n\n");
                  tet_printf("\n ----- NCS AGENTS START UP FAILED ------- \n");
                  break;
                }
            }         
          tet_printf("\n--------------  ITERATION %d -----------\n",i);
          
          if(SERV_SUIT)
            {
              /*Starting Service related test cases*/
              tet_test_start(test_case,svc_testlist);
              sleep(1);
              ncs_tmr_whatsout();
            }
        }
    }
  tet_mds_tds_cleanup();
  
  return;
}
void tp1()
{
	tet_infoline("This is the second test case (tc2, slave)");

	tet_result(TET_FAIL);
}
Example #27
0
void startup(){
	printf("ctest1: startup\n");
	tet_infoline("ctest1: startup");
}
static void startup(void)
{
	tet_infoline("drm_get_constraint_info:Test started");
	tet_infoline("OMA DRM Content should be registered");
	tet_infoline("RO must be installed to get valid constraint information");
}
void tet_edsv_end()
{
  tet_infoline(" Ending the agony.. ");
}
static void cleanup(void)
{
	tet_infoline("drm_get_constraint_info:Test completed");
}