Example #1
0
int testExtEnum()
{
    printf("Rule 5.3: Extendible Enumeration\n");
    
    bool passed = true;
    try
    {
        printf("a) Restore\n");
        passed = testRestore(L"input/testExtEnum.xml") && passed;
        
        printf("b) Roundtrip\n");
        printf("FAILED (not tested): Ext enums are not cloned properly - fix due for v1.2\n");
        //saveCopy(L"input/testExtEnum.xml", L"tmp.xml");
        //passed = testRestore(L"tmp.xml") && passed;

        printf("c) Modify\n");
        copyAndTouch(L"input/testExtEnum.xml", L"tmp.xml");
        passed = testRestore(L"tmp.xml") && passed;
    }
    catch (...)
    {
        passed = false;
        printf("FAILED: Exception thrown\n");
    }

    printf("\n");
    
    return passed ? 1 : 2; // 1 -> known failures
}
Example #2
0
int testCharacter()
{
    printf("Rule 5.1: Character\n");
    
    bool passed = true;
    try
    {
        printf("a) Restore\n");
        passed = testRestore(L"input/testCharacter.xml") && passed;
        
        printf("b) Roundtrip\n");
        saveCopy(L"input/testCharacter.xml", L"tmp.xml");
        passed = testRestore(L"tmp.xml") && passed;

        printf("c) Modify\n");
        copyAndTouch(L"input/testCharacter.xml", L"tmp.xml");
        passed = testRestore(L"tmp.xml") && passed;
    }
    catch (...)
    {
        passed = false;
        printf("FAILED: Exception thrown\n");
    }

    printf("\n");
    
    return passed ? 0 : 2;
}
Example #3
0
int testIndirect()
{
    printf("Rule 5.5: Indirect\n");
    
    bool passed = true;
    try
    {
        printf("a) Restore\n");
        passed = testRestore(L"input/testIndirect.xml") && passed;
        
        printf("b) Roundtrip\n");
        printf("FAILED (not tested): Type referenced in Indirect type value and no where else is not cloned - fix due for v1.2\n");
        //saveCopy(L"input/testIndirect.xml", L"tmp.xml");
        //passed = testRestore(L"tmp.xml") && passed;

        printf("c) Modify\n");
        copyAndTouch(L"input/testIndirect.xml", L"tmp.xml");
        passed = testRestore(L"tmp.xml") && passed;
    }
    catch (...)
    {
        passed = false;
        printf("FAILED: Exception thrown\n");
    }

    printf("\n");
    
    return passed ? 1 : 2; // 1 -> known failures
}