void LibraryLoaderTest::lookupFailureTest() { vpr::Debug::instance()->disableOutput(); try { vpr::LibraryPtr dso(new vpr::Library(mModules[0].first)); vpr::LibraryLoader::callEntryPoint(dso, "lookupFailureTest", (bool(*)(void*)) rawCallback); // Execution should not reach this point. CPPUNIT_ASSERT(false); } // This is the exception type that we are expecting. catch (vpr::SymbolLookupException&) { CPPUNIT_ASSERT(true); } catch (vpr::LibraryException&) { CPPUNIT_ASSERT(false); } catch (vpr::Exception&) { CPPUNIT_ASSERT(false); } vpr::Debug::instance()->enableOutput(); }
FarEditor::FarEditor(PluginStartupInfo *info, ParserFactory *pf) { parserFactory = pf; baseEditor = new BaseEditor(parserFactory, this); this->info = info; info->EditorControl(ECTL_GETINFO, &ei); cursorRegion = nullptr; prevLinePosition = 0; blockTopPosition = -1; inRedraw = false; idleCount = 0; ret_str = nullptr; ret_strNumber = -1; maxLineLength = 0; fullBackground = true; drawCross = 2; showHorizontalCross = showVerticalCross = false; crossZOrder = 0; horzCrossColor = color(); //0x0E; vertCrossColor = color(); //0x0E; drawPairs = drawSyntax = true; oldOutline = false; newback = newfore = -1; rdBackground = nullptr; visibleLevel = 100; DString dso("def:Outlined"); DString dse("def:Error"); const Region *def_Outlined = pf->getHRCParser()->getRegion(&dso); const Region *def_Error = pf->getHRCParser()->getRegion(&dse); structOutliner = new Outliner(baseEditor, def_Outlined); errorOutliner = new Outliner(baseEditor, def_Error); TrueMod=true; }
void LibraryLoaderTest::callEntryPointTestRaw() { vpr::LibraryPtr dso(new vpr::Library(mModules[0].first)); try { vpr::LibraryLoader::callEntryPoint(dso, mModules[0].second, (bool(*)(void*)) rawCallback); } catch (vpr::Exception&) { CPPUNIT_ASSERT(false); } }
void LibraryLoaderTest::callEntryPointTestFunctor() { LoaderFunctor functor; vpr::LibraryPtr dso(new vpr::Library(mModules[1].first)); try { vpr::LibraryLoader::callEntryPoint(dso, mModules[1].second, functor); } catch (vpr::Exception&) { CPPUNIT_ASSERT(false); } }
void LibraryLoaderTest::multiLoadTest() { try { vpr::LibraryPtr dso(new vpr::Library(mModules[0].first)); vpr::LibraryLoader::callEntryPoint(dso, mModules[0].second, (bool(*)(void*)) rawCallback); } catch (vpr::Exception&) { CPPUNIT_ASSERT(false); } try { LoaderFunctor functor; vpr::LibraryPtr dso(new vpr::Library(mModules[1].first)); vpr::LibraryLoader::callEntryPoint(dso, mModules[1].second, functor); } catch (vpr::Exception&) { CPPUNIT_ASSERT(false); } }
void ClientEnvironment::getActiveObjects(v3f origin, f32 max_d, std::vector<DistanceSortedActiveObject> &dest) { for (UNORDERED_MAP<u16, ClientActiveObject*>::iterator i = m_active_objects.begin(); i != m_active_objects.end(); ++i) { ClientActiveObject* obj = i->second; f32 d = (obj->getPosition() - origin).getLength(); if(d > max_d) continue; DistanceSortedActiveObject dso(obj, d); dest.push_back(dso); } }
void ClientEnvironment::getActiveObjects(v3f origin, f32 max_d, core::array<DistanceSortedActiveObject> &dest) { for(core::map<u16, ClientActiveObject*>::Iterator i = m_active_objects.getIterator(); i.atEnd()==false; i++) { ClientActiveObject* obj = i.getNode()->getValue(); f32 d = (obj->getPosition() - origin).getLength(); if(d > max_d) continue; DistanceSortedActiveObject dso(obj, d); dest.push_back(dso); } }
void MapBlockObjectList::getObjects(v3f origin, f32 max_d, core::array<DistanceSortedObject> &dest) { for(core::map<s16, MapBlockObject*>::Iterator i = m_objects.getIterator(); i.atEnd() == false; i++) { MapBlockObject *obj = i.getNode()->getValue(); f32 d = (obj->getRelativeShowPos() - origin).getLength(); if(d > max_d) continue; DistanceSortedObject dso(obj, d); dest.push_back(dso); } }