Ejemplo n.º 1
0
/**
 * Remove a specified field value.
 * @param fieldID One of the MA_PIM_FIELD_CONTACT constants.
 * @param index Value's index in the given field.
 */
void PIMContact::removeFieldValue(const int fieldID, const int index)
{
    checkResultCode(maPimItemRemoveValue(
                        mItemHandle,
                        fieldID,
                        index));
    waitForClick();
}
Ejemplo n.º 2
0
/**
 * Test maPimItemRemoveValue syscall.
 */
void AppMoblet::testMaPimItemRemoveValue()
{
    printf("\n=========Test maPimItemRemoveValue syscall=======");
    MAHandle list = maPimListOpen(MA_PIM_CONTACTS);
    printResultCode(list);
    MAHandle item = maPimItemCreate(list);
    printResultCode(item);
    PIMContact* contact = new PIMContact(item);

    printf("\nTest syscalls with invalid item handle");
    printResultCode(maPimItemRemoveValue(555, 0, 0));

    printf("\nTest syscalls with invalid field id");
    printResultCode(maPimItemRemoveValue(item, 19191, 0));

    printf("\nTest syscall with unsupported field id");
    printResultCode(maPimItemRemoveValue(item, MA_PIM_FIELD_CONTACT_CLASS, 0));

    printf("\nTest syscall with invalid value index - empty field");
    printResultCode(maPimItemRemoveValue(item, MA_PIM_FIELD_CONTACT_ADDR, 0));
    waitForClick();

    printf("\nTest syscall with invalid value index - field not empty");
    contact->addAddress();
    printResultCode(maPimItemRemoveValue(item, MA_PIM_FIELD_CONTACT_ADDR, 100));
    waitForClick();

    printf("\nTest syscall with valid parameters");
    printResultCode(maPimItemRemoveValue(item, MA_PIM_FIELD_CONTACT_ADDR, 1));

    delete contact;
    maPimItemRemove(list, item);
    maPimListClose(list);
    waitForClick();
}