// open a new substorage
XStorage xTempSubStorage = m_aTestHelper.openSubStorage( xTempStorage, "SubStorage1",
ElementModes.WRITE ); if ( xTempSubStorage == null )
{
m_aTestHelper.Error( "Can't create substorage!" ); returnfalse;
}
// open a new substorage
XStorage xTempSubSubStorage = m_aTestHelper.openSubStorage( xTempSubStorage, "SubSubStorage1",
ElementModes.WRITE ); if ( xTempSubSubStorage == null )
{
m_aTestHelper.Error( "Can't create substorage!" ); returnfalse;
}
byte pBytes1[] = { 1, 1, 1, 1, 1 };
// open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes if ( !m_aTestHelper.WriteBytesToSubstream( xTempStorage, "Stream1", "MediaType1", true, pBytes1 ) ) returnfalse;
// open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes if ( !m_aTestHelper.WriteBytesToSubstream( xTempSubStorage, "SubStream1", "MediaType2", true, pBytes1 ) ) returnfalse;
// open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes if ( !m_aTestHelper.WriteBytesToSubstream( xTempSubSubStorage, "SubSubStream1", "MediaType3", true, pBytes1 ) ) returnfalse;
// set "MediaType" property for storages and check that "IsRoot" and "OpenMode" properties are set correctly if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempStorage, "MediaType4", true,
ElementModes.WRITE ) ) returnfalse;
// set "MediaType" property for storages and check that "IsRoot" and "OpenMode" properties are set correctly if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempSubStorage, "MediaType5", false,
ElementModes.WRITE ) ) returnfalse;
// set "MediaType" property for storages and check that "IsRoot" and "OpenMode" properties are set correctly if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempSubSubStorage, "MediaType6", false,
ElementModes.WRITE ) ) returnfalse;
// commit the storages twice to test the bug scenario
// commit lowlevel substorage first if ( !m_aTestHelper.commitStorage( xTempSubSubStorage ) ) returnfalse;
// commit substorage if ( !m_aTestHelper.commitStorage( xTempSubStorage ) ) returnfalse;
// commit substorage to let the renaming take place if ( !m_aTestHelper.commitStorage( xTempStorage ) ) returnfalse;
// commit lowlevel substorage first if ( !m_aTestHelper.commitStorage( xTempSubSubStorage ) ) returnfalse;
// commit substorage if ( !m_aTestHelper.commitStorage( xTempSubStorage ) ) returnfalse;
// commit substorage to let the renaming take place if ( !m_aTestHelper.commitStorage( xTempStorage ) ) returnfalse;
// check the storages and streams without closing
if ( !m_aTestHelper.checkStorageProperties( xTempSubSubStorage, "MediaType6", false, ElementModes.WRITE ) ) returnfalse;
if ( !m_aTestHelper.checkStorageProperties( xTempSubStorage, "MediaType5", false, ElementModes.WRITE ) ) returnfalse;
if ( !m_aTestHelper.checkStorageProperties( xTempStorage, "MediaType4", true, ElementModes.WRITE ) ) returnfalse;
// the root storage is based on the temporary stream so it can be left undisposed, since it does not lock // any resource, later the garbage collector will release the object and it must die by refcount
returntrue;
} catch( Exception e )
{
m_aTestHelper.Error( "Exception: " + e ); returnfalse;
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-09-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.