void T_MProfilesNamesArray::MdcaCountTestL() { __UHEAP_MARK; TInt expectedCount( 5 ); #ifdef __OFFLINE_MODE ++expectedCount; #endif #ifdef __DRIVE_MODE ++expectedCount; #endif EUNIT_ASSERT( iProfilesNames->MdcaCount() == expectedCount ); __UHEAP_MARKEND; }
void testCloneParticleFixedAttributes(Partio::ParticlesData* other, int& test) { Partio::ParticlesData* p=Partio::cloneSchema(*other); int numFixedAttributes = p->numFixedAttributes(); if (numFixedAttributes == 3) { std::cout << "ok " << test++ << " - Partio::cloneSchema() numFixedAttributes()" << std::endl; } else { std::cerr << "not ok " << test++ << " - Partio::cloneSchema() fixed attribute count is " << numFixedAttributes << ", expected 3" << std::endl; exit(EXIT_FAILURE); } std::vector<std::string> expectedName(numFixedAttributes); std::vector<Partio::ParticleAttributeType> expectedType(numFixedAttributes); std::vector<int> expectedCount(numFixedAttributes); expectedName[0] = "origin"; expectedType[0] = Partio::VECTOR; expectedCount[0] = 3; expectedName[1] = "uv"; expectedType[1] = Partio::FLOAT; expectedCount[1] = 2; expectedName[2] = "sid"; expectedType[2] = Partio::INT; expectedCount[2] = 1; // Test attributes for (int i=0;i<numFixedAttributes;++i) { Partio::FixedAttribute attr; p->fixedAttributeInfo(i,attr); if (attr.name == expectedName[i]) { std::cout << "ok " << test++ << " - Partio::cloneSchema() fixed attribute name for " << attr.name << std::endl; } else { std::cerr << "not ok " << test++ << " - Partio::cloneSchema() fixed attribute name is " << attr.name << ", expected " << expectedName[i] << std::endl; exit(EXIT_FAILURE); } if (attr.type == expectedType[i]) { std::cout << "ok " << test++ << " - Partio::cloneSchema() fixed attribute type for " << attr.name << std::endl; } else { std::cerr << "not ok " << test++ << " - Partio::cloneSchema() fixed attribute type for " << attr.name << ", expected " << expectedType[i] << ", got " << attr.type << std::endl; } if (attr.count == expectedCount[i]) { std::cout << "ok " << test++ << " - Partio::cloneSchema() fixed attribute count for " << attr.name << std::endl; } else { std::cerr << "not ok " << test++ << " - Partio::cloneSchema() fixed attribute count for " << attr.name << ", expected " << expectedCount[i] << ", got " << attr.count << std::endl; } } p->release(); }