/*************************************************************************\ * Copyright (c) 2020 Michael Davidsaver * EPICS BASE is distributed subject to a Software License Agreement found * in file LICENSE that is included with this distribution. \*************************************************************************/ #include #include #include "epicsUnitTest.h" #include "testMain.h" #include "envDefs.h" #include "epicsFindSymbol.h" #include "epicsThread.h" namespace { void loadBad() { testOk1(!epicsFindSymbol("noSuchFunction")); } // lookup a symbol from libCom // which this executable is linked against (maybe statically) // Doesn't work for static builds on windows void loadCom() { testDiag("Lookup symbol from Com"); #if defined (_WIN32) && defined(LINKING_STATIC) testTodoBegin("windows static build"); #endif void* ptr = epicsFindSymbol("epicsThreadGetCPUs"); testOk(ptr==(void*)&epicsThreadGetCPUs, "%p == %p (epicsThreadGetCPUs) : %s", ptr, (void*)&epicsThreadGetCPUs, epicsLoadError()); testTodoEnd(); } void loadCA() { testDiag("Load and lookup symbol from libca"); std::string libname; { std::ostringstream strm; // running in eg. modules/libcom/test/O.linux-x86_64-debug #ifdef _WIN32 strm<<"..\\..\\..\\..\\bin\\"<