Example #1
0
static void CheckMobsByUsageCode( IAAFHeader* pHeader,
				  aafSearchCrit_t& usageCrit,
				  int expectedCount,
				  bool checkIID,
				  const IID& expectedIID )
{
  IAAFSmartPointer<IEnumAAFMobs> pEnumByUsage;
  checkResult( pHeader->GetMobs( &usageCrit, &pEnumByUsage ) );

  // Should get one back, and it should be a composition mob.
  IAAFSmartPointer<IAAFMob> pNextMob;
  HRESULT nextHr;
  int count;
  for( count = 0, nextHr = pEnumByUsage->NextOne( &pNextMob );
       AAFRESULT_SUCCESS == nextHr;
       count++, nextHr = pEnumByUsage->NextOne( &pNextMob ) ) {
    if ( checkIID ) {
      // Quering for one interface but passing a pointer to another
      // interface is not a right thing to do but since it's a pointer
      // to IUnknown, the parent of them all, and all we do is call
      // Release() on it, it's OK.
      IAAFSmartPointer<IUnknown> pUnused;
      checkResult( pNextMob->QueryInterface( expectedIID, (void**)&pUnused ) );
    }
  }
    
  checkExpression( AAFRESULT_NO_MORE_OBJECTS == nextHr,
		   AAFRESULT_TEST_FAILED );
  
  checkExpression( expectedCount == count, AAFRESULT_TEST_FAILED );
}
Example #2
0
aafUInt32 GetNextUInt32( IAAFSmartPointer<IEnumAAFPropertyValues> pEnumSetValues )
{
  using namespace mtc;

  IAAFSmartPointer<IAAFPropertyValue> pPropVal;
  CheckResult( pEnumSetValues->NextOne( &pPropVal ) );

  IAAFSmartPointer<IAAFTypeDef> pElemType;
  CheckResult( pPropVal->GetType( &pElemType ) );

  IAAFSmartPointer<IAAFTypeDefInt> pIntTypeDef;
  CheckResult( pElemType->QueryInterface( IID_IAAFTypeDefInt, (void**)&pIntTypeDef ) );

  aafUInt32 val;
  CheckResult( pIntTypeDef->GetInteger( pPropVal, (aafMemPtr_t)&val, sizeof(val) ) );

  return val;
}