/**
 * @brief Negative test case of ug_init elm_label_line_wrap_get()
 */
static void utc_UIFW_elm_label_line_wrap_get_func_02(void)
{
   test_eo = elm_label_add(test_win);
   elm_label_line_wrap_set(test_eo, 0);
   int ret = 0;
   ret = elm_label_line_wrap_get(test_eo);

   if(ret) {
        tet_result(TET_FAIL);
        tet_infoline("elm_label_line_wrap_get() failed in negative test case");
        return;
   }
   tet_result(TET_PASS);
}
/**
 * @brief Negative test case of ug_init elm_ctxpopup_horizontal_get()
 */
static void utc_UIFW_elm_ctxpopup_horizontal_get_func_02(void)
{
	int r = 0;

	r = elm_ctxpopup_horizontal_get(NULL);

	if (r)
	{
		tet_infoline("elm_ctxpopup_horizontal_get() failed in negative test case");
		tet_result(TET_FAIL);
		return;
	}
	tet_result(TET_PASS);
}
/**
 * @brief Positive test case of elm_genlist_item_expanded_depth_get()
 */
static void utc_UIFW_elm_genlist_item_expanded_depth_get_func_01(void)
{
	Elm_Object_Item *it1 = NULL, *it2 = NULL;
	int depth = 0;

	it1 = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
	it2 = elm_genlist_item_append(genlist, &itc, NULL, it1, ELM_GENLIST_ITEM_SUBITEMS, NULL, NULL);
	depth = elm_genlist_item_expanded_depth_get(it2);
	if (!depth) {
		tet_infoline("elm_genlist_item_expanded_depth_get() failed in positive test case");
		tet_result(TET_FAIL);
		return;
	}
	tet_result(TET_PASS);
}
/**
 * @brief Negative test case of ug_init elm_stackedicon_add()
 */
static void utc_UIFW_elm_stackedicon_add_func_02(void)
{
	Evas_Object* r = NULL;

	tet_infoline("[[ DEBUG:: Negative ]]");

	r = elm_stackedicon_add(NULL);
	if (r) {
		tet_infoline("elm_stackedicon_add() failed in negative test case");
		tet_result(TET_FAIL);
		return;
	}
	tet_result(TET_PASS);
	tet_infoline("[[ TET_MSG ]]::[ID]:TC_02, [TYPE]: Negative, [RESULT]:PASS, elm_stackedicon_add().");
}
/**
 * @brief Negative test case of ug_init elm_transit_event_block_disabled_get()
 */
static void utc_UIFW_elm_transit_event_enabled_get_func_02(void)
{
	Eina_Bool r = EINA_FALSE;

	transit = elm_transit_add();
	elm_transit_event_enabled_set(transit, EINA_TRUE);
	r = elm_transit_event_enabled_get(NULL);

	if (r == EINA_TRUE) {
		tet_infoline("elm_transit_event_enabled_get() failed in negative test case");
		tet_result(TET_FAIL);
		return;
	}
	tet_result(TET_PASS);
}
static void utc_emotion_shutdown_p(void)
{
	signal(SIGSEGV, sigprocess);
	
    Eina_Bool res = emotion_shutdown();

	if (EINA_FALSE == res) {
		tet_printf("[TET_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
		tet_result(TET_FAIL);
		return;
	}

	tet_printf("[TET_PASS]:: %s[%d] : Test has passed..", __FILE__, __LINE__);
	tet_result(TET_PASS);
}
static gboolean
exit_loop_fail (gpointer data)
{
	g_main_loop_quit (loop);
	tet_result(TET_FAIL);
	return FALSE;
}
static void
utc_location_search_poi_04()
{
	guint req_id = 0;
	int ret = 0;
	tet_printf("POIName-restaurant, Max - 50 and sort by Distance");
	LocationPOIFilter *filter = location_poi_filter_new();
	gchar *key = g_strdup("POIName");
	gchar *value = g_strdup("restaurant");
	location_poi_filter_set(filter, key, value);

	LocationPOIPreference *pref = location_poi_pref_new();
	location_poi_pref_set_max_result(pref, 50);
	gchar *item = g_strdup("Distance");
	location_poi_pref_set_sort_by(pref, item);
	location_poi_pref_set_sort_order(pref, LOCATION_POI_PREF_SO_ASC);

	LocationPosition *position = location_position_new(0, 37.336723, -121.889555, 0, LOCATION_STATUS_2D_FIX);

	ret = location_search_poi(loc, filter, position, pref, __location_POI_cb, NULL, &req_id);
	if(ret != LOCATION_ERROR_NONE) {
			tet_result(TET_FAIL);
			tet_printf("Fail to search POI. Error[%d]\n", ret);
	} else {
			g_timeout_add_seconds(60, exit_loop_fail, NULL);
			tet_printf("Seach POI sucess, req_id %d\n", req_id);
	}
	location_poi_filter_free(filter);
	location_poi_pref_free(pref);
	location_position_free(position);
}
/**
 * @brief Negative test case of cert_svc_load_PFX_file_to_context()
 */
static void utc_SecurityFW_cert_svc_load_PFX_file_to_context_func_02(void)
{
	int tetResult = TET_FAIL;
	int ret = CERT_SVC_ERR_NO_ERROR;
	CERT_CONTEXT* ctx = NULL;
	unsigned char* prikey = NULL;
	int prikeyLen = 0;
	char* passphrase = NULL;

	ctx = cert_svc_cert_context_init();

	ret = cert_svc_load_PFX_file_to_context(ctx, &prikey, &prikeyLen, NULL, passphrase);
	if(ret != CERT_SVC_ERR_INVALID_PARAMETER) {
		tetResult = TET_FAIL;
		printf("[ERR] ret = [%d]\n", ret);
	}
	else
		tetResult = TET_PASS;

	if(prikey != NULL)
		free(prikey);
	cert_svc_cert_context_final(ctx);
	printf("[%d] [%s]\n", tetResult, __FILE__);
	tet_result(tetResult);
}
/**
 * @brief Positive test case of elm_multibuttonentry_last_item_get()
 */
static void utc_UIFW_elm_multibuttonentry_last_item_get_func_01(void)
{
	Elm_Object_Item *added_item1 = NULL, *added_item2 = NULL, *last_item = NULL;

	test_eo = elm_multibuttonentry_add(test_win);
	added_item1 = elm_multibuttonentry_item_append(test_eo, "item1", NULL);
	added_item2 = elm_multibuttonentry_item_append(test_eo, "item2", NULL);
	last_item = elm_multibuttonentry_last_item_get(test_eo);
	if (last_item != added_item2) {
		tet_infoline("elm_multibuttonentry_last_item_get() failed in positive test case");
		tet_result(TET_FAIL);
		return;
	}
	tet_result(TET_PASS);
	tet_infoline("[[ TET_MSG ]]::[ID]:TC_01, [TYPE]: Positive, [RESULT]:PASS, elm_multibuttonentry_last_item_get().");
}
/**
 * @brief Negative test case of ug_init elm_slider_horizontal_get()
 */
static void utc_UIFW_elm_slider_horizontal_get_func_02(void)
{
        Evas_Object *slider;
        Eina_Bool ret = EINA_FALSE;

        slider = elm_slider_add(main_win);
        elm_slider_horizontal_set(slider, EINA_TRUE);
        ret = elm_slider_horizontal_get(NULL);

         if (ret) {
		tet_infoline("elm_slider_horizontal_get() failed in negative test case");
		tet_result(TET_FAIL);
		return;
	}
	tet_result(TET_PASS);
}
/**
 * @brief Negative test case of ug_init elm_slider_indicator_format_set()
 */
static void utc_UIFW_elm_slider_indicator_format_set_func_02(void)
{
        Evas_Object *slider;
        const char *ret_for = NULL;

        slider = elm_slider_add(main_win);

        elm_slider_indicator_format_set(NULL, "%1.0f");
        ret_for = elm_slider_indicator_format_get(slider);

        if (ret_for) {
		tet_infoline("elm_slider_indicator_format_set() failed in negative test case");
		tet_result(TET_FAIL);
		return;
	}
	tet_result(TET_PASS);
}
Exemple #13
0
void tp1()
{
 	(void) tet_printf("test case: %s, TP number: %d ",
                tet_pname, tet_thistest);
	tet_result(TET_PASS);

/*	tet_result(TET_FAIL);*/
}
// Negative test case.
void uts_elm_imageslider_add_test_002()
{
	test_eo = elm_imageslider_add(NULL);
	TET_CHECK_FAIL(NULL, test_eo);

	tet_result(TET_PASS);
	tet_infoline("[[ TET_MSG ]]::[ID]:TC_02, [TYPE]: Negative, [RESULT]:PASS, Adding an Image Slider has failed.");
}
static void utc_emotion_frame_resize_p(void)
{
    Evas_Object *object = init();
    _emotion_frame_resize(object, 100, 200, 0.5);

	tet_printf("[TET_PASS]:: %s[%d] : Test has passed..", __FILE__, __LINE__);
	tet_result(TET_PASS);
}
/**
 * @brief Negative test case of ug_init elm_radio_label_set()
 */
static void utc_UIFW_elm_radio_label_set_func_02(void)
{
   Evas_Object *radio = NULL;

   radio = elm_radio_add(main_win);
   elm_radio_label_set(NULL, "label");
   tet_result(TET_PASS);
}
/**
 * @brief Negative test case of ug_init __dlog_vprint()
 */
void utc_ApplicationFW___dlog_vprint_func_02(void)
{
	int r = 0;
	char buf[LOG_BUF_SIZE];
	va_list ap;
//	va_start(ap, fmt);

   	r = __dlog_vprint(LOG_ID_MAX, DLOG_DEBUG,"DLOG_TEST", fmt, ap );
//	va_end(ap);

	if (r>=0) {
		tet_printf("__dlog_vprint() failed in negative test case");
		tet_result(TET_FAIL);
		return;
	}
	tet_result(TET_PASS);
}
/**
 * @brief Negative test case of ug_init elm_label_fontsize_set()
 */
static void utc_UIFW_elm_label_fontsize_set_func_02(void)
{
	test_eo = elm_label_add(NULL);
	elm_label_fontsize_set(test_eo, 10);

	tet_result(TET_PASS);
	tet_infoline("[[ TET_MSG ]]::[ID]:TC_02, [TYPE]: Negative, [RESULT]:PASS, A label fontsize set is failed.");
}
/**
 * @brief Positive test case of elm_label_fontsize_set()
 */
static void utc_UIFW_elm_label_fontsize_set_func_01(void)
{
	test_eo = elm_label_add(test_win);
	elm_label_fontsize_set(test_eo, 10);

	tet_result(TET_PASS);
	tet_infoline("[[ TET_MSG ]]::[ID]:TC_01, [TYPE]: Positive, [RESULT]:PASS, A label fontsize set is success.");
}
void
tcElf_tpCorruptEhdr(void)
{
	int err, fd, result;
	char *fn;
	Elf *e;
	TS_PHDR *ph;

	TP_CHECK_INITIALIZATION();

	tet_infoline("assertion: " TS_ICNAME "(E) with corrupt phdr values "
	    "the header returns E_HEADER.");

	fn = "ehdr.msb" __XSTRING(TS_PHDRSZ);
	TS_OPEN_FILE(e, fn, ELF_C_READ, fd);

	result = TET_PASS;

	if ((ph = TS_ICFUNC(e)) != NULL ||
	    (err = (elf_errno() != ELF_E_HEADER))) {
		tet_printf("fail: \"%s\" (ph %p, error %d)", fn, (void *) ph,
		    err);
		result = TET_FAIL;
	}
	(void) elf_end(e);
	(void) close(fd);

	if (result != TET_PASS) {
		tet_result(result);
		return;
	}

	fn = "ehdr.lsb" __XSTRING(TS_PHDRSZ);
	TS_OPEN_FILE(e, fn, ELF_C_READ, fd);

	if ((ph = TS_ICFUNC(e)) != NULL ||
	    (err = (elf_errno() != ELF_E_HEADER))) {
		tet_printf("fail: \"%s\" (ph %p, error %d)", fn, (void *) ph,
		    err);
		result = TET_FAIL;
	}
	(void) elf_end(e);
	(void) close(fd);

	tet_result(result);
}
/**
 * @brief Negative test case of ug_init elm_bubble_label_set()
 */
static void utc_UIFW_elm_bubble_label_set_func_02(void)
{
	bubble = elm_bubble_add(main_win);
	elm_bubble_label_set(bubble, NULL);

	if (elm_bubble_label_get(bubble)) {
		tet_infoline("elm_bubble_label_set() failed in negative 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);
}
/**
 * @brief Negative test case of ug_init elm_genlist_item_show()
 */
static void utc_UIFW_elm_genlist_item_show_func_02(void)
{
	Elm_Object_Item *it = NULL;

	it = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
	elm_genlist_item_show(NULL);
	tet_result(TET_PASS);
}
Exemple #23
0
void tp1()
{
// this is a c++ comment

	cout << "This output comes from test purpose tp1\n";
	tet_infoline("This is the first test case (tc1)");
	tet_result(TET_PASS);
}
/**
 * @brief Negative test case of ug_init elm_radio_state_value_set()
 */
static void utc_UIFW_elm_radio_state_value_set_func_02(void)
{
   Evas_Object *radio = NULL;

   radio = elm_radio_add(main_win);
   elm_radio_state_value_set(NULL, 0);
   tet_result(TET_PASS);
}
/**
 * @brief Positive test case of elm_genlist_item_disabled_set()
 */
static void utc_UIFW_elm_genlist_item_disabled_set_func_01(void)
{
	Elm_Object_Item *item = NULL;
	Eina_Bool ret = EINA_FALSE;

	item = elm_genlist_item_append(genlist, &itc, (void *) 0, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
	elm_genlist_item_disabled_set(item, EINA_TRUE);

	ret = elm_genlist_item_disabled_get(item);

	if (!ret) {
		tet_infoline("elm_genlist_item_disabled_set() failed in positive test case");
		tet_result(TET_FAIL);
		return;
	}
	tet_result(TET_PASS);
}
/**
 * @brief Positive test case of ssm_write_file()
 */
static void utc_SecurityFW_ssm_write_file_func_01(void)
{
	int tetResult = TET_FAIL;
	/* variables for ssm_write_file */
	int ret = -1;
	char* filepath = "/opt/secure-storage/test/input.txt";
	ssm_flag flag = SSM_FLAG_DATA;
	char* group_id = NULL;

	/* variables for ssm_read */
	FILE* fp_original = NULL;
	char buf[20];
	char* retbuf = NULL;
	int readlen = 0;
	ssm_file_info_t sfi;

	/* get original file content. after encrypting, original file will be deleted */
	memset(buf, 0x00, 20);
	fp_original = fopen(filepath, "r");
	fgets(buf, 20, fp_original);
	fclose(fp_original);

	/* write file to secure-storage */
	ret = ssm_write_file(filepath, flag, group_id);
	if(ret != 0) {	// if fail,
		tetResult = TET_UNINITIATED;
		goto error;
	}

	/* read and compare */
	ssm_getinfo(filepath, &sfi, flag, group_id);
	retbuf = (char*)malloc(sizeof(char) * (sfi.originSize + 1));
	memset(retbuf, 0x00, (sfi.originSize + 1));
	ret = ssm_read(filepath, retbuf, sfi.originSize, &readlen, flag, group_id);
	if(ret != 0) {	// if fail,
		tetResult = TET_UNINITIATED;
		goto free_error;
	}

	if(tetResult != TET_UNINITIATED)
	{
		if(!memcmp(buf, retbuf, strlen(retbuf)))	// if same
			tetResult = TET_PASS;
		else
			tetResult = TET_FAIL;
	}

	/* delete encrypted file */
	ret = ssm_delete_file(filepath, flag, group_id);
	if(ret != 0)
		tetResult = TET_UNINITIATED;

free_error:
	free(retbuf);
error:
	printf("[%d] [%s]\n", tetResult, __FILE__);
	tet_result(tetResult);
}
void
tcElf_tpElfWrongSize(void)
{
	int error, fd, result;
	Elf *e;
	char *fn;
	TS_PHDR *ph;

	TP_CHECK_INITIALIZATION();

	tet_infoline("assertion: a call to " TS_ICNAME "() and a mismatched "
	    "ELF class fails with ELF_E_CLASS.");

	result = TET_PASS;

	fn = "phdr.msb" __XSTRING(TS_OTHERSIZE);
	TS_OPEN_FILE(e,fn,ELF_C_READ,fd);

	if ((ph = TS_ICFUNC(e)) != NULL ||
	    (error = elf_errno()) != ELF_E_CLASS) {
		tet_printf("fail: \"%s\" opened (error %d).", fn, error);
		result = TET_FAIL;
	}

	(void) elf_end(e);
	(void) close(fd);

	if (result != TET_PASS) {
		tet_result(result);
		return;
	}

	fn = "phdr.lsb" __XSTRING(TS_OTHERSIZE);
	TS_OPEN_FILE(e,fn,ELF_C_READ,fd);
	if ((ph = TS_ICFUNC(e)) != NULL ||
	    (error = elf_errno()) != ELF_E_CLASS) {
		tet_printf("fail: \"%s\" opened (error %d).", fn, error);
		result = TET_FAIL;
	}

	(void) elf_end(e);
	(void) close(fd);

	tet_result(result);
}
/**
 * @brief Negative test case of ug_init elm_check_state_get()
 */
static void utc_UIFW_elm_check_state_get_func_02(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(NULL);
   tet_result(TET_PASS);
}
static void utc_emotion_object_smooth_scale_set_null(void)
{
	signal(SIGSEGV, sigprocess);
	
    emotion_object_smooth_scale_set(NULL, EINA_TRUE);

    tet_printf("[TET_PASS]:: %s[%d] : Test has passed..", __FILE__, __LINE__);
	tet_result(TET_PASS);
}
static void utc_emotion_object_event_simple_send_null(void)
{
	signal(SIGSEGV, sigprocess);
	
    emotion_object_vis_set(NULL, EMOTION_EVENT_10 + 1);

	tet_printf("[TET_PASS]:: %s[%d] : Test has passed..", __FILE__, __LINE__);
	tet_result(TET_PASS);
}