Scene* TestController::createScene() { Scene* scene = Scene::create(); TestController* la = new TestController; la->autorelease(); la->init(); scene->addChild(la); return scene; }
static void* OperatorNew( size_t s ) { if ( !using_alloc_set ) { simulate_possible_failure(); alloc_count++; } char *p = AllocateBlock(s); if ( gTestController.TrackingEnabled() && gTestController.LeakDetectionEnabled() && !using_alloc_set ) { using_alloc_set = true; EH_ASSERT( alloc_set().find( p ) == alloc_set().end() ); alloc_set().insert( p ); using_alloc_set = false; } return p; }
void _STLP_CALL operator delete(void* s) # endif { if ( s != 0 ) { if ( !using_alloc_set ) { alloc_count--; if ( gTestController.TrackingEnabled() && gTestController.LeakDetectionEnabled() ) { using_alloc_set = true; allocation_set::iterator p = alloc_set().find( (char*)s ); EH_ASSERT( p != alloc_set().end() ); alloc_set().erase( p ); using_alloc_set = false; } } # if ! defined (NO_FAST_ALLOCATOR) if ( !gFastAllocator.Free( s ) ) # endif EH_CSTD::free(s); } }
#include "core/Core.h" #include "HTTPClient.h" #include "InvokeHTTP.h" #include "processors/ListenHTTP.h" #include "core/FlowFile.h" #include "unit/ProvenanceTestHelper.h" #include "core/Processor.h" #include "core/ProcessContext.h" #include "core/ProcessSession.h" #include "core/ProcessorNode.h" #include "processors/InvokeHTTP.h" #include "processors/ListenHTTP.h" #include "processors/LogAttribute.h" TEST_CASE("HTTPTestsWithNoResourceClaimPOST", "[httptest1]") { TestController testController; std::shared_ptr<core::ContentRepository> content_repo = std::make_shared<core::repository::VolatileContentRepository>(); LogTestController::getInstance().setInfo<org::apache::nifi::minifi::processors::InvokeHTTP>(); std::shared_ptr<TestRepository> repo = std::make_shared<TestRepository>(); std::shared_ptr<core::Processor> getfileprocessor = std::make_shared<org::apache::nifi::minifi::processors::GetFile>("getfileCreate2"); std::shared_ptr<core::Processor> logAttribute = std::make_shared<org::apache::nifi::minifi::processors::LogAttribute>("logattribute"); char format[] = "/tmp/gt.XXXXXX"; char *dir = testController.createTempDirectory(format); std::shared_ptr<core::Processor> listenhttp = std::make_shared<org::apache::nifi::minifi::processors::ListenHTTP>("listenhttp"); std::shared_ptr<core::Processor> invokehttp = std::make_shared<org::apache::nifi::minifi::processors::InvokeHTTP>("invokehttp");
void BaseLayer::switchToScene(int SceneId){ TestController *controller = new TestController(); controller->menuCallback(SceneId); }
* limitations under the License. */ #include <utility> #include <memory> #include <string> #include <vector> #include <set> #include <fstream> #include "TestBase.h" #include "LogAttribute.h" #include "GetFile.h" TEST_CASE("GetFile: FIFO", "[getFileFifo]") { // NOLINT TestController testController; LogTestController::getInstance().setTrace<TestPlan>(); LogTestController::getInstance().setTrace<processors::GetFile>(); LogTestController::getInstance().setTrace<processors::LogAttribute>(); auto plan = testController.createPlan(); auto repo = std::make_shared<TestRepository>(); // Define directory for input std::string in_dir("/tmp/gt.XXXXXX"); REQUIRE(testController.createTempDirectory(&in_dir[0]) != nullptr); // Define test input file std::string in_file(in_dir); in_file.append("/testfifo");
static bool runBeforeUnloadConfirmPanel(WKPageRef page, WKStringRef message, WKFrameRef frame, const void *clientInfo) { TestController* testController = static_cast<TestController*>(const_cast<void*>(clientInfo)); printf("CONFIRM NAVIGATION: %s\n", toSTD(message).c_str()); return testController->beforeUnloadReturnValue(); }
void handler_all() { TestController m; m.handleAll(); }
void handler_test() { TestController m; m.handleRequest(); }
#include <iostream> static const char *NEWLINE_FILE = "" "one,two,three\n" "four,five,six, seven"; static const char *TMP_FILE = "/tmp/minifi-tmpfile.txt"; static const char *STATE_FILE = "/tmp/minifi-state-file.txt"; TEST_CASE("TailFileWithDelimiter", "[tailfiletest1]") { // Create and write to the test file std::ofstream tmpfile; tmpfile.open(TMP_FILE); tmpfile << NEWLINE_FILE; tmpfile.close(); TestController testController; LogTestController::getInstance().setTrace<minifi::processors::TailFile>(); LogTestController::getInstance().setDebug<core::ProcessSession>(); LogTestController::getInstance().setDebug<minifi::processors::LogAttribute>(); std::shared_ptr<TestPlan> plan = testController.createPlan(); std::shared_ptr<core::Processor> tailfile = plan->addProcessor("TailFile", "tailfileProc"); plan->addProcessor("LogAttribute", "logattribute", core::Relationship("success", "description"), true); char format[] = "/tmp/gt.XXXXXX"; char *dir = testController.createTempDirectory(format); plan->setProperty(tailfile, org::apache::nifi::minifi::processors::TailFile::FileName.getName(), TMP_FILE); plan->setProperty(tailfile, org::apache::nifi::minifi::processors::TailFile::StateFile.getName(), STATE_FILE); plan->setProperty(tailfile, org::apache::nifi::minifi::processors::TailFile::Delimiter.getName(), "\n");