static TestData * _commonSetup(const char *name) { parcSecurity_Init(); TestData *data = parcMemory_AllocateAndClear(sizeof(TestData)); assertNotNull(data, "parcMemory_AllocateAndClear(%zu) returned NULL", sizeof(TestData)); sprintf(data->keystore_filename, "/tmp/keystore_%s_%d.p12", name, getpid()); sprintf(data->keystore_password, "12345"); unlink(data->keystore_filename); CCNxTransportConfig *config = createParams(data->keystore_filename, data->keystore_password); data->mock = mockFramework_Create(config); ccnxTransportConfig_Destroy(&config); return data; }
/** * Add model at scene. * @param kind kind of item (e.g. "fish_big", "item_light", ...) * @param loc placement location * @param shape see Shape for format * @return model * * @throws LogicException for unknown kind * @throws LayoutException when shape or location is bad */ Cube * ModelFactory::createModel(const std::string &kind, const V2 &loc, const std::string &shape) { if (StringTool::startsWith(kind, "output_")) { return createOutputItem(kind, loc, shape); } Cube::eWeight weight; Cube::eWeight power; bool alive; createParams(kind, &weight, &power, &alive); Shape *newShape = new Shape(shape); Cube *model = new Cube(loc, weight, power, alive, newShape); return model; }
void ovrJobThread::Init( int const threadNum ) { OVR_ASSERT( JobManager != nullptr ); OVR_ASSERT( MyThread == nullptr ); size_t const stackSize = 128 * 1024; int const processorAffinity = -1; OVR::Thread::ThreadState initialState = OVR::Thread::Running; OVR_ASSERT( Jni == nullptr ); // this will be attached when the thread executes Thread::CreateParams createParams( ovrJobThread::Fn, this, stackSize, processorAffinity, initialState, Thread::IdlePriority ); //MyThread = new OVR::Thread( ovrJobThread::Fn, this, stackSize, processorAffinity, initialState ); MyThread = new OVR::Thread( createParams ); }