TreeNodeTest::~TreeNodeTest() { tearDown(); }
/** * Destroy instance of an ConcurrentGCIncrementalUpdate object. * */ void MM_ConcurrentGCIncrementalUpdate::kill(MM_EnvironmentBase *env) { tearDown(env); env->getForge()->free(this); }
/** * Free the receiver and all associated resources. */ void MM_SweepSchemeSegregated::kill(MM_EnvironmentBase *env) { tearDown(env); env->getForge()->free(this); }
int main(){ fixtureSetup(); resetTestCount(); testStarted("test_1_create_a_new_int_type_Stack"); setup(); test_1_create_a_new_int_type_Stack(); tearDown(); testEnded(); testStarted("test_2_create_a_new_char_type_Stack"); setup(); test_2_create_a_new_char_type_Stack(); tearDown(); testEnded(); testStarted("test_3_create_a_new_string_type_Stack"); setup(); test_3_create_a_new_string_type_Stack(); tearDown(); testEnded(); testStarted("test_4_push_element_into_int_type_Stack"); setup(); test_4_push_element_into_int_type_Stack(); tearDown(); testEnded(); testStarted("test_5_push_element_into_string_type_Stack"); setup(); test_5_push_element_into_string_type_Stack(); tearDown(); testEnded(); testStarted("test_6_push_element_into_char_type_Stack"); setup(); test_6_push_element_into_char_type_Stack(); tearDown(); testEnded(); testStarted("test_7_push_element_into_int_type_Stack_when_stack_is_full"); setup(); test_7_push_element_into_int_type_Stack_when_stack_is_full(); tearDown(); testEnded(); testStarted("test_8_check_isStackFull_when_the_stack_is_full"); setup(); test_8_check_isStackFull_when_the_stack_is_full(); tearDown(); testEnded(); testStarted("test_9_check_isStackFull_when_the_stack_is_not_Full"); setup(); test_9_check_isStackFull_when_the_stack_is_not_Full(); tearDown(); testEnded(); testStarted("test_10_check_isStackEmpty_when_stack_is_empty"); setup(); test_10_check_isStackEmpty_when_stack_is_empty(); tearDown(); testEnded(); testStarted("test_11_check_isStackEmpty_when_stack_is_not_empty"); setup(); test_11_check_isStackEmpty_when_stack_is_not_empty(); tearDown(); testEnded(); testStarted("test_12_pop_element_from_int_type_stack"); setup(); test_12_pop_element_from_int_type_stack(); tearDown(); testEnded(); testStarted("test_13_pop_element_from_char_type_stack"); setup(); test_13_pop_element_from_char_type_stack(); tearDown(); testEnded(); testStarted("test_14_pop_element_from_STRING_type_stack"); setup(); test_14_pop_element_from_STRING_type_stack(); tearDown(); testEnded(); testStarted("test_15_check_top_in_int_type_stack"); setup(); test_15_check_top_in_int_type_stack(); tearDown(); testEnded(); testStarted("test_16_check_top_in_char_type_stack"); setup(); test_16_check_top_in_char_type_stack(); tearDown(); testEnded(); testStarted("test_17_check_all_the_brackets_when_match_found"); setup(); test_17_check_all_the_brackets_when_match_found(); tearDown(); testEnded(); testStarted("test_18_check_all_the_brackets_when_match_not_found"); setup(); test_18_check_all_the_brackets_when_match_not_found(); tearDown(); testEnded(); summarizeTestCount(); fixtureTearDown(); return 0; }
void testToneAuthenticity() { MprToneGen* pToneGen = NULL; OsStatus res; int framesToProcess = 3; // Create the Goertzel DTMF detector -- sample rate and goertzel_n doesn't // really matter here, since we'll be resetting it in the loop. // But to illustrate, here is what should be used for 8khz MpDtmfDetector dtmfDetector(8000, framesToProcess*80); size_t i; for(i = 0; i < sNumRates; i++) { //printf("Testing frequency authenticity at %d Hz\n", sSampleRates[i]); // For this test, we want to modify the sample rate and samples per frame // so we need to de-inititialize what has already been initialized for us // by cppunit, or by a previous loop. tearDown(); // Set the sample rates setSamplesPerSec(sSampleRates[i]); setSamplesPerFrame(sSampleRates[i]/100); dtmfDetector.setSamplesPerSec(sSampleRates[i]); dtmfDetector.setNumProcessSamples(framesToProcess*getSamplesPerFrame()); setUp(); pToneGen = new MprToneGen("MprToneGen", ""); CPPUNIT_ASSERT(pToneGen != NULL); // This sets up to have some input to our resource, and something to collect // output at the end. In case of tone gen, the input doesn't matter, // as it only uses the input when it is in a disabled state (passing // the input directly to output - no changes). setupFramework(pToneGen); // pToneGen enabled, there are buffers on the input 0 CPPUNIT_ASSERT(mpSourceResource->enable()); CPPUNIT_ASSERT(pToneGen->enable()); // Tell our MprToneGen to generate a '4' DTMF tone playing. MprToneGen::startTone("MprToneGen", *(mpFlowGraph->getMsgQ()), '4'); UtlBoolean dtmfDetected = FALSE; int j; for(j = 0; j < framesToProcess; j++) { // Process a frame. res = mpFlowGraph->processNextFrame(); CPPUNIT_ASSERT(res == OS_SUCCESS); // Now analyze the newly processed output. // A new buffer should be generated. CPPUNIT_ASSERT(mpSourceResource->mLastDoProcessArgs.outBufs[0] != mpSinkResource->mLastDoProcessArgs.inBufs[0]); MpAudioBufPtr paBuf = mpSinkResource->mLastDoProcessArgs.inBufs[0]; CPPUNIT_ASSERT(paBuf.isValid()); // SANITY CHECK: Make sure that the number of samples in the // tone gen output frame is equal to the samples per frame that // we set during this run. CPPUNIT_ASSERT_EQUAL(getSamplesPerFrame(), paBuf->getSamplesNumber()); UtlBoolean dtmfDetected = FALSE; // Now grab audio samples and run them through the dtmf detector. unsigned k; for(k = 0; k < paBuf->getSamplesNumber(); k++) { const MpAudioSample* pSamples = paBuf->getSamplesPtr(); dtmfDetected = dtmfDetector.processSample(pSamples[k]); // If we are at the last sample we will process, then, based on how // we configured the dtmf detector, a tone should have been detected. if( k == paBuf->getSamplesNumber()-1 && j == framesToProcess-1) { CPPUNIT_ASSERT_EQUAL(TRUE, dtmfDetected); } else { CPPUNIT_ASSERT_EQUAL(FALSE, dtmfDetected); } } // Free up buffers.. paBuf.release(); } // Now for the real test that we were building up for -- // the DTMF detector should have detected a '4' tone. // If it didn't then something went wrong -- one thing that could // have gone wrong in that case, is that the generation was assuming // a different sample rate than I. char detectedDTMF = dtmfDetector.getLastDetectedDTMF(); CPPUNIT_ASSERT_EQUAL('4', detectedDTMF); // Stop flowgraph haltFramework(); // No need to delete tone gen, as haltFramework deletes all resources // in the flowgraph. } }
~Process(){ tearDown(); }
int main(){ fixtureSetup(); resetTestCount(); testStarted("test_creates_a_stack_of_given_length"); setup(); test_creates_a_stack_of_given_length(); tearDown(); testEnded(); testStarted("test_adds_the_given_integerto_stack"); setup(); test_adds_the_given_integerto_stack(); tearDown(); testEnded(); testStarted("test_adds_the_doubles_to_stack"); setup(); test_adds_the_doubles_to_stack(); tearDown(); testEnded(); testStarted("test_adds_Strings_to_stack"); setup(); test_adds_Strings_to_stack(); tearDown(); testEnded(); testStarted("test_adds_structures_to_stacks"); setup(); test_adds_structures_to_stacks(); tearDown(); testEnded(); testStarted("test_doubles_the_length_of_stack_on_stack_full"); setup(); test_doubles_the_length_of_stack_on_stack_full(); tearDown(); testEnded(); testStarted("test_removes_the_top_element_from_the_stack_integers"); setup(); test_removes_the_top_element_from_the_stack_integers(); tearDown(); testEnded(); testStarted("test_removes_the_top_element_from_the_stack_Strings"); setup(); test_removes_the_top_element_from_the_stack_Strings(); tearDown(); testEnded(); testStarted("test_removes_structures_on_the_top_of_stacks"); setup(); test_removes_structures_on_the_top_of_stacks(); tearDown(); testEnded(); testStarted("test_remove_on_empty_stack"); setup(); test_remove_on_empty_stack(); tearDown(); testEnded(); testStarted("test_gives_top_element_integers"); setup(); test_gives_top_element_integers(); tearDown(); testEnded(); testStarted("test_gives_the_top_stack_character"); setup(); test_gives_the_top_stack_character(); tearDown(); testEnded(); testStarted("test_tells_the_stack_is_empty"); setup(); test_tells_the_stack_is_empty(); tearDown(); testEnded(); testStarted("test_tells_the_stack_is_not_empty"); setup(); test_tells_the_stack_is_not_empty(); tearDown(); testEnded(); testStarted("test_tells_the_stack_is_full"); setup(); test_tells_the_stack_is_full(); tearDown(); testEnded(); testStarted("test_tells_the_stack_is_not_full"); setup(); test_tells_the_stack_is_not_full(); tearDown(); testEnded(); summarizeTestCount(); fixtureTearDown(); return 0; }
int main(){ fixtureSetup(); resetTestCount(); setup(); test_should_should_allocate_and_initialize_memory_to_zero_for_stack_of_typeInt(); tearDown(); setup(); test_should_should_allocate_and_initialize_memory_to_zero_for_stack_of_typeChar(); tearDown(); setup(); test_should_should_allocate_and_initialize_memory_to_zero_for_stack_of_typeDouble(); tearDown(); setup(); test_should_allocate_and_initialize_memory_to_zero_for_stack_of_typeString(); tearDown(); setup(); test_should_not_push_return_zero_as_stack_is_full(); tearDown(); setup(); test_should_push_an_element_into_the_stack_for_intData(); tearDown(); setup(); test_should_pop_intElement_from_stack(); tearDown(); setup(); test_should_return_elment_pointed_by_top(); tearDown(); setup(); test_should_push_an_element_into_the_stack_for_type_DoubleData(); tearDown(); setup(); test_should_pop_doubleElement_from_stack(); tearDown(); setup(); test_should_return_zero_when_stack_isEmpty(); tearDown(); setup(); test_should_push_an_element_into_stack_for_stringData(); tearDown(); setup(); test_should_pop_an_element_from_stack_of_stringData(); tearDown(); setup(); test_should_return_double_type_element_pointed_by_top(); tearDown(); setup(); test_should_return_string_type_element_pointed_by_top(); tearDown(); summarizeTestCount(); fixtureTearDown(); return 0; }
/** * Free the receiver and all associated resources. */ void MM_ParallelSweepScheme::kill(MM_EnvironmentBase *env) { tearDown(env); env->getForge()->free(this); }
GPUImageBufferRepository::~GPUImageBufferRepository() { tearDown(); }
void GPUImageBufferRepository::clear() { tearDown(); mInternal = new GPUImageBufferRepositoryInternal(); }
status_t BnCameraDeviceUser::onTransact( uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags) { switch(code) { case DISCONNECT: { ALOGV("DISCONNECT"); CHECK_INTERFACE(ICameraDeviceUser, data, reply); disconnect(); reply->writeNoException(); return NO_ERROR; } break; case SUBMIT_REQUEST: { CHECK_INTERFACE(ICameraDeviceUser, data, reply); // arg0 = request sp<CaptureRequest> request; if (data.readInt32() != 0) { request = new CaptureRequest(); request->readFromParcel(const_cast<Parcel*>(&data)); } // arg1 = streaming (bool) bool repeating = data.readInt32(); // return code: requestId (int32) reply->writeNoException(); int64_t lastFrameNumber = -1; reply->writeInt32(submitRequest(request, repeating, &lastFrameNumber)); reply->writeInt32(1); reply->writeInt64(lastFrameNumber); return NO_ERROR; } break; case SUBMIT_REQUEST_LIST: { CHECK_INTERFACE(ICameraDeviceUser, data, reply); List<sp<CaptureRequest> > requestList; int requestListSize = data.readInt32(); for (int i = 0; i < requestListSize; i++) { if (data.readInt32() != 0) { sp<CaptureRequest> request = new CaptureRequest(); if (request->readFromParcel(const_cast<Parcel*>(&data)) != OK) { return BAD_VALUE; } requestList.push_back(request); } else { sp<CaptureRequest> request = 0; requestList.push_back(request); ALOGE("A request is missing. Sending in null request."); } } bool repeating = data.readInt32(); reply->writeNoException(); int64_t lastFrameNumber = -1; reply->writeInt32(submitRequestList(requestList, repeating, &lastFrameNumber)); reply->writeInt32(1); reply->writeInt64(lastFrameNumber); return NO_ERROR; } break; case CANCEL_REQUEST: { CHECK_INTERFACE(ICameraDeviceUser, data, reply); int requestId = data.readInt32(); reply->writeNoException(); int64_t lastFrameNumber = -1; reply->writeInt32(cancelRequest(requestId, &lastFrameNumber)); reply->writeInt32(1); reply->writeInt64(lastFrameNumber); return NO_ERROR; } break; case DELETE_STREAM: { CHECK_INTERFACE(ICameraDeviceUser, data, reply); int streamId = data.readInt32(); reply->writeNoException(); reply->writeInt32(deleteStream(streamId)); return NO_ERROR; } break; case CREATE_STREAM: { CHECK_INTERFACE(ICameraDeviceUser, data, reply); status_t ret = BAD_VALUE; if (data.readInt32() != 0) { OutputConfiguration outputConfiguration(data); ret = createStream(outputConfiguration); } else { ALOGE("%s: cannot take an empty OutputConfiguration", __FUNCTION__); } reply->writeNoException(); ALOGV("%s: CREATE_STREAM: write noException", __FUNCTION__); reply->writeInt32(ret); ALOGV("%s: CREATE_STREAM: write ret = %d", __FUNCTION__, ret); return NO_ERROR; } break; case CREATE_INPUT_STREAM: { CHECK_INTERFACE(ICameraDeviceUser, data, reply); int width, height, format; width = data.readInt32(); height = data.readInt32(); format = data.readInt32(); status_t ret = createInputStream(width, height, format); reply->writeNoException(); reply->writeInt32(ret); return NO_ERROR; } break; case GET_INPUT_SURFACE: { CHECK_INTERFACE(ICameraDeviceUser, data, reply); sp<IGraphicBufferProducer> bp; status_t ret = getInputBufferProducer(&bp); sp<IBinder> b(IInterface::asBinder(ret == OK ? bp : NULL)); reply->writeNoException(); reply->writeInt32(ret); reply->writeInt32(1); reply->writeString16(String16("camera input")); // name of surface reply->writeStrongBinder(b); return NO_ERROR; } break; case CREATE_DEFAULT_REQUEST: { CHECK_INTERFACE(ICameraDeviceUser, data, reply); int templateId = data.readInt32(); CameraMetadata request; status_t ret; ret = createDefaultRequest(templateId, &request); reply->writeNoException(); reply->writeInt32(ret); // out-variables are after exception and return value reply->writeInt32(1); // to mark presence of metadata object request.writeToParcel(const_cast<Parcel*>(reply)); return NO_ERROR; } break; case GET_CAMERA_INFO: { CHECK_INTERFACE(ICameraDeviceUser, data, reply); CameraMetadata info; status_t ret; ret = getCameraInfo(&info); reply->writeNoException(); reply->writeInt32(ret); // out-variables are after exception and return value reply->writeInt32(1); // to mark presence of metadata object info.writeToParcel(reply); return NO_ERROR; } break; case WAIT_UNTIL_IDLE: { CHECK_INTERFACE(ICameraDeviceUser, data, reply); reply->writeNoException(); reply->writeInt32(waitUntilIdle()); return NO_ERROR; } break; case FLUSH: { CHECK_INTERFACE(ICameraDeviceUser, data, reply); reply->writeNoException(); int64_t lastFrameNumber = -1; reply->writeInt32(flush(&lastFrameNumber)); reply->writeInt32(1); reply->writeInt64(lastFrameNumber); return NO_ERROR; } case BEGIN_CONFIGURE: { CHECK_INTERFACE(ICameraDeviceUser, data, reply); reply->writeNoException(); reply->writeInt32(beginConfigure()); return NO_ERROR; } break; case END_CONFIGURE: { CHECK_INTERFACE(ICameraDeviceUser, data, reply); bool isConstrainedHighSpeed = data.readInt32(); reply->writeNoException(); reply->writeInt32(endConfigure(isConstrainedHighSpeed)); return NO_ERROR; } break; case PREPARE: { CHECK_INTERFACE(ICameraDeviceUser, data, reply); int streamId = data.readInt32(); reply->writeNoException(); reply->writeInt32(prepare(streamId)); return NO_ERROR; } break; case TEAR_DOWN: { CHECK_INTERFACE(ICameraDeviceUser, data, reply); int streamId = data.readInt32(); reply->writeNoException(); reply->writeInt32(tearDown(streamId)); return NO_ERROR; } break; default: return BBinder::onTransact(code, data, reply, flags); } }
void ServiceSummaryTest::standaloneTest() { static const char * manifestJson = "{" " \"type\": \"standalone\"," " \"ServiceLibrary\": \"lib.dll\"," " \"strings\": { " " \"en\": { " " \"title\": \"Image Manipulation Plugin\", " " \"summary\": \"Allows authorized websites to manipulate images on your computer. This includes the ability to rotate, crop, and scale images on your computer from within a web browser.\"" " }," " \"bg\": { " " \"title\": \"Инструмент За Снимки\"," " \"summary\": \"С този инструмент можеш да манипулираш снимки.\"" " }" " }," " \"permissions\" : [" " \"foo\"," " \"bar\"," " \"baz\"" " ]" "}"; std::vector<boost::filesystem::path> filesToTouch; filesToTouch.push_back(boost::filesystem::path(("lib.dll"))); // now create it createService(manifestJson, filesToTouch); // now load it bp::service::Summary s; std::string error; CPPUNIT_ASSERT( s.detectService(m_testServiceDir, error) ); // --- now check everything is as expected --- CPPUNIT_ASSERT( s.type() == bp::service::Summary::Standalone ); CPPUNIT_ASSERT( !s.typeAsString().compare("standalone") ); // now check that shutdownDelaySecs is set properly CPPUNIT_ASSERT_EQUAL( s.shutdownDelaySecs(), -1 ); // instantiated from a non name/version dir. they should be left // empty CPPUNIT_ASSERT_MESSAGE( s.name().c_str(), s.name().empty() ); CPPUNIT_ASSERT_MESSAGE( s.version().c_str(), s.version().empty() ); // should NOT be out of date CPPUNIT_ASSERT( !s.outOfDate() ); // check localizations std::string title, summary; // first en should serve up ok CPPUNIT_ASSERT( s.localization("en", title, summary) ); CPPUNIT_ASSERT( !title.compare("Image Manipulation Plugin") ); // and bg should serve up ok CPPUNIT_ASSERT( s.localization("bg", title, summary) ); CPPUNIT_ASSERT( !title.compare("Инструмент За Снимки") ); // and german should default to english CPPUNIT_ASSERT( s.localization("de", title, summary) ); CPPUNIT_ASSERT( !title.compare("Image Manipulation Plugin") ); // empty dependent service stuff CPPUNIT_ASSERT_MESSAGE( s.usesService().c_str(), s.usesService().empty() ); CPPUNIT_ASSERT( s.isInitialized() ); // permissions load OK? std::set<std::string> wantPerms; wantPerms.insert("foo"); wantPerms.insert("bar"); wantPerms.insert("baz"); std::set<std::string> havePerms = s.permissions(); CPPUNIT_ASSERT( wantPerms == havePerms ); // now verify if we update the disk representation things are // considered "out of date" tearDown(); setUp(); createService(manifestJson, filesToTouch); CPPUNIT_ASSERT( s.outOfDate() ); }
int main(){ fixtureSetup(); resetTestCount(); testStarted("test_create_of_node"); setup(); test_create_of_node(); tearDown(); testEnded(); testStarted("test_create_double_linked_list"); setup(); test_create_double_linked_list(); tearDown(); testEnded(); testStarted("test_insert_element_to_empty_list"); setup(); test_insert_element_to_empty_list(); tearDown(); testEnded(); testStarted("test_insert_three_elements_and_check_the_next_of_each"); setup(); test_insert_three_elements_and_check_the_next_of_each(); tearDown(); testEnded(); testStarted("test_insert_elements_and_check_data_of_each"); setup(); test_insert_elements_and_check_data_of_each(); tearDown(); testEnded(); testStarted("test_insert_elements_of_different_data_types"); setup(); test_insert_elements_of_different_data_types(); tearDown(); testEnded(); testStarted("test_insert_element_gives_true_when_inerted"); setup(); test_insert_element_gives_true_when_inerted(); tearDown(); testEnded(); testStarted("test_insert_element_gives_false_when_not_succesfull"); setup(); test_insert_element_gives_false_when_not_succesfull(); tearDown(); testEnded(); testStarted("test_delete_2nd_element"); setup(); test_delete_2nd_element(); tearDown(); testEnded(); testStarted("test_delete_when_index_not_present"); setup(); test_delete_when_index_not_present(); tearDown(); testEnded(); testStarted("test_delete_when_list_is_empty"); setup(); test_delete_when_list_is_empty(); tearDown(); testEnded(); testStarted("test_delete_when_index_passed_is_negative"); setup(); test_delete_when_index_passed_is_negative(); tearDown(); testEnded(); summarizeTestCount(); fixtureTearDown(); return 0; }
void MM_VirtualMemory::kill(MM_EnvironmentBase* env) { tearDown(env); env->getForge()->free(this); }
int main(){ fixtureSetup(); resetTestCount(); testStarted("test_insert_data_at_index_which_not_exist_return_false"); setup(); test_insert_data_at_index_which_not_exist_return_false(); tearDown(); testEnded(); testStarted("test_insert_int_data_at_starting_of_linked_list"); setup(); test_insert_int_data_at_starting_of_linked_list(); tearDown(); testEnded(); testStarted("test_getElement_give_element_at_index"); setup(); test_getElement_give_element_at_index(); tearDown(); testEnded(); testStarted("test_insert_char_data_at_starting_of_linked_list"); setup(); test_insert_char_data_at_starting_of_linked_list(); tearDown(); testEnded(); testStarted("test_insert_string_data_at_starting_of_linked_list"); setup(); test_insert_string_data_at_starting_of_linked_list(); tearDown(); testEnded(); testStarted("test_insert_float_data_at_starting_of_linked_list"); setup(); test_insert_float_data_at_starting_of_linked_list(); tearDown(); testEnded(); testStarted("test_insert_node_with_int_data_in_linked_list"); setup(); test_insert_node_with_int_data_in_linked_list(); tearDown(); testEnded(); testStarted("test_insert_node_with_float_data_in_linked_list"); setup(); test_insert_node_with_float_data_in_linked_list(); tearDown(); testEnded(); testStarted("test_insert_node_with_string_data_in_linked_list"); setup(); test_insert_node_with_string_data_in_linked_list(); tearDown(); testEnded(); testStarted("test_insert_node_with_string_data_in_middle_of_linked_list"); setup(); test_insert_node_with_string_data_in_middle_of_linked_list(); tearDown(); testEnded(); testStarted("test_insert_node_with_integer_data_in_middle_of_linked_list"); setup(); test_insert_node_with_integer_data_in_middle_of_linked_list(); tearDown(); testEnded(); testStarted("test_delete_data_at_index_that_not_exist"); setup(); test_delete_data_at_index_that_not_exist(); tearDown(); testEnded(); testStarted("test_delete_data_at_given_index"); setup(); test_delete_data_at_given_index(); tearDown(); testEnded(); testStarted("test_search_data_in_given_list_return_index"); setup(); test_search_data_in_given_list_return_index(); tearDown(); testEnded(); testStarted("test_search_data_in_empty_list_return_minus_one"); setup(); test_search_data_in_empty_list_return_minus_one(); tearDown(); testEnded(); testStarted("test_search_gives_minus_one_if_data_not_found"); setup(); test_search_gives_minus_one_if_data_not_found(); tearDown(); testEnded(); summarizeTestCount(); fixtureTearDown(); return 0; }
int main(){ fixtureSetup(); resetTestCount(); testStarted("test_1_creates_queue_for_integers"); setup(); test_1_creates_queue_for_integers(); tearDown(); testEnded(); testStarted("test_2_creates_queue_for_floats"); setup(); test_2_creates_queue_for_floats(); tearDown(); testEnded(); testStarted("test_3_creates_queue_for_characters"); setup(); test_3_creates_queue_for_characters(); tearDown(); testEnded(); testStarted("test_4_creates_queue_for_String"); setup(); test_4_creates_queue_for_String(); tearDown(); testEnded(); testStarted("test_5_creates_queue_for_double"); setup(); test_5_creates_queue_for_double(); tearDown(); testEnded(); testStarted("test_6_for_enqueing_integer_element_in_queue"); setup(); test_6_for_enqueing_integer_element_in_queue(); tearDown(); testEnded(); testStarted("test_7_for_enqueing_float_element_in_queue"); setup(); test_7_for_enqueing_float_element_in_queue(); tearDown(); testEnded(); testStarted("test_8_for_enqueing_double_element_in_queue"); setup(); test_8_for_enqueing_double_element_in_queue(); tearDown(); testEnded(); testStarted("test_9_for_enqueing_string_element_in_queue"); setup(); test_9_for_enqueing_string_element_in_queue(); tearDown(); testEnded(); testStarted("test_10_for_enqueing_character_element_in_queue"); setup(); test_10_for_enqueing_character_element_in_queue(); tearDown(); testEnded(); testStarted("test_11_for_integer_element_into_queue_when_queue_is_full"); setup(); test_11_for_integer_element_into_queue_when_queue_is_full(); tearDown(); testEnded(); testStarted("test_12_for_float_element_into_queue_when_queue_is_full"); setup(); test_12_for_float_element_into_queue_when_queue_is_full(); tearDown(); testEnded(); testStarted("test_13_for_dequeueing_integer_element_from_queue"); setup(); test_13_for_dequeueing_integer_element_from_queue(); tearDown(); testEnded(); testStarted("test_14_for_dequeueing_float_element_from_queue"); setup(); test_14_for_dequeueing_float_element_from_queue(); tearDown(); testEnded(); testStarted("test_15_for_dequeueing_float_element_from_queue_when_queue_is_empty"); setup(); test_15_for_dequeueing_float_element_from_queue_when_queue_is_empty(); tearDown(); testEnded(); testStarted("test_16_for_enqueueing_new_integer_element_at_the_0_location_after_dequeueing"); setup(); test_16_for_enqueueing_new_integer_element_at_the_0_location_after_dequeueing(); tearDown(); testEnded(); testStarted("test_fail"); setup(); test_fail(); tearDown(); testEnded(); summarizeTestCount(); fixtureTearDown(); return 0; }
Status DatabasePlugin::reset() { // Keep this simple, scope the critical section to the broader methods. tearDown(); return setUp(); }
int main(){ fixtureSetup(); resetTestCount(); testStarted("test_1_insert_into_array_list"); setup(); test_1_insert_into_array_list(); tearDown(); testEnded(); testStarted("test_2_insert_multiple_element"); setup(); test_2_insert_multiple_element(); tearDown(); testEnded(); testStarted("test_3_insert_element_beyond_its_capacity"); setup(); test_3_insert_element_beyond_its_capacity(); tearDown(); testEnded(); testStarted("test_4_insert_element_in_between"); setup(); test_4_insert_element_in_between(); tearDown(); testEnded(); testStarted("test_5_remove_element_from_between"); setup(); test_5_remove_element_from_between(); tearDown(); testEnded(); testStarted("test_6_remove_element_from_beginning"); setup(); test_6_remove_element_from_beginning(); tearDown(); testEnded(); testStarted("test_7_remove_element_from_end"); setup(); test_7_remove_element_from_end(); tearDown(); testEnded(); testStarted("test_8_to_search_into_arrayList"); setup(); test_8_to_search_into_arrayList(); tearDown(); testEnded(); testStarted("test_9_insert_element_with_getiterator"); setup(); test_9_insert_element_with_getiterator(); tearDown(); testEnded(); testStarted("test_10_insert_element_at_negative_index"); setup(); test_10_insert_element_at_negative_index(); tearDown(); testEnded(); testStarted("test_11_to_check_empty_iterator"); setup(); test_11_to_check_empty_iterator(); tearDown(); testEnded(); summarizeTestCount(); fixtureTearDown(); return 0; }
/** * Free the receiver and all associated resources. */ void MM_SweepPoolManager::kill(MM_EnvironmentBase *env) { tearDown(env); env->getForge()->free(this); }
int main(){ fixtureSetup(); resetTestCount(); testStarted("test_1_create_should_give_max_size_5"); setup(); test_1_create_should_give_max_size_5(); tearDown(); testEnded(); testStarted("test_2_create_should_create_a_stack_integer_of_5_elements"); setup(); test_2_create_should_create_a_stack_integer_of_5_elements(); tearDown(); testEnded(); testStarted("test_3_push_the_item_into_stack"); setup(); test_3_push_the_item_into_stack(); tearDown(); testEnded(); testStarted("test_4_push_the_item_into_stack"); setup(); test_4_push_the_item_into_stack(); tearDown(); testEnded(); testStarted("test_5_push_the_item_into_stack"); setup(); test_5_push_the_item_into_stack(); tearDown(); testEnded(); testStarted("test_6_create_should_create_a_stack_doulbe_of_5_elements"); setup(); test_6_create_should_create_a_stack_doulbe_of_5_elements(); tearDown(); testEnded(); testStarted("test_7_push_the_double_type_item_into_stack"); setup(); test_7_push_the_double_type_item_into_stack(); tearDown(); testEnded(); testStarted("test_8_push_the_double_type_item_into_stack"); setup(); test_8_push_the_double_type_item_into_stack(); tearDown(); testEnded(); testStarted("test_9_push_character_type_value_into_stack"); setup(); test_9_push_character_type_value_into_stack(); tearDown(); testEnded(); testStarted("test_10_pop_integer_type_element_from_stack"); setup(); test_10_pop_integer_type_element_from_stack(); tearDown(); testEnded(); testStarted("test_11_pop_double_type_element_from_stack"); setup(); test_11_pop_double_type_element_from_stack(); tearDown(); testEnded(); testStarted("test_12_pop_char_type_element_from_stack"); setup(); test_12_pop_char_type_element_from_stack(); tearDown(); testEnded(); testStarted("test_13_pop_string_type_element_from_stack"); setup(); test_13_pop_string_type_element_from_stack(); tearDown(); testEnded(); testStarted("test_14_push_string_type_element_into_stack"); setup(); test_14_push_string_type_element_into_stack(); tearDown(); testEnded(); testStarted("test_15_resize_should_allocate_double_memory_when_stack_is_ful"); setup(); test_15_resize_should_allocate_double_memory_when_stack_is_ful(); tearDown(); testEnded(); testStarted("test_16_push_the_item_into_stack"); setup(); test_16_push_the_item_into_stack(); tearDown(); testEnded(); summarizeTestCount(); fixtureTearDown(); return 0; }
int main(){ fixtureSetup(); resetTestCount(); testStarted("test_1_create_integer_creates_with_zeroes"); setup(); test_1_create_integer_creates_with_zeroes(); tearDown(); testEnded(); testStarted("test_2_create_float_creates_with_zeroes"); setup(); test_2_create_float_creates_with_zeroes(); tearDown(); testEnded(); testStarted("test_3_create_character_creates_with_null"); setup(); test_3_create_character_creates_with_null(); tearDown(); testEnded(); testStarted("test_4_create_double_creates_with_zeroes"); setup(); test_4_create_double_creates_with_zeroes(); tearDown(); testEnded(); testStarted("test_5_creates_string_stack"); setup(); test_5_creates_string_stack(); tearDown(); testEnded(); testStarted("test_6_push_integer_element_in_stack"); setup(); test_6_push_integer_element_in_stack(); tearDown(); testEnded(); testStarted("test_7_push_float_element_in_stack"); setup(); test_7_push_float_element_in_stack(); tearDown(); testEnded(); testStarted("test_8_push_double_element_in_stack"); setup(); test_8_push_double_element_in_stack(); tearDown(); testEnded(); testStarted("test_9_push_character_element_in_stack"); setup(); test_9_push_character_element_in_stack(); tearDown(); testEnded(); testStarted("test_10_push_string_element_in_stack"); setup(); test_10_push_string_element_in_stack(); tearDown(); testEnded(); testStarted("test_11_pop_integer_element_from_stack"); setup(); test_11_pop_integer_element_from_stack(); tearDown(); testEnded(); testStarted("test_12_pop_float_element_from_stack"); setup(); test_12_pop_float_element_from_stack(); tearDown(); testEnded(); testStarted("test_13_pop_double_element_from_stack"); setup(); test_13_pop_double_element_from_stack(); tearDown(); testEnded(); testStarted("test_14_pop_character_element_from_stack"); setup(); test_14_pop_character_element_from_stack(); tearDown(); testEnded(); testStarted("test_15_pop_string_element_from_stack"); setup(); test_15_pop_string_element_from_stack(); tearDown(); testEnded(); testStarted("test_16_gives_top_element_in_stack"); setup(); test_16_gives_top_element_in_stack(); tearDown(); testEnded(); testStarted("test_fail"); setup(); test_fail(); tearDown(); testEnded(); summarizeTestCount(); fixtureTearDown(); return 0; }
int main(){ fixtureSetup(); resetTestCount(); testStarted("test_insert_element"); setup(); test_insert_element(); tearDown(); testEnded(); testStarted("test_insert_multiple_elements"); setup(); test_insert_multiple_elements(); tearDown(); testEnded(); testStarted("test_interns_grows_beyond_capacity"); setup(); test_interns_grows_beyond_capacity(); tearDown(); testEnded(); testStarted("test_should_not_insert_at_index_beyond_length"); setup(); test_should_not_insert_at_index_beyond_length(); tearDown(); testEnded(); testStarted("test_should_not_insert_at_negative_index"); setup(); test_should_not_insert_at_negative_index(); tearDown(); testEnded(); testStarted("test_insert_at_middle_should_shift_the_elements"); setup(); test_insert_at_middle_should_shift_the_elements(); tearDown(); testEnded(); testStarted("test_should_not_insert_when_list_is_null"); setup(); test_should_not_insert_when_list_is_null(); tearDown(); testEnded(); testStarted("test_should_ArrayList_get_index_of_search_element"); setup(); test_should_ArrayList_get_index_of_search_element(); tearDown(); testEnded(); testStarted("test_should_ArrayList_get_minus_1_if_element_not_found"); setup(); test_should_ArrayList_get_minus_1_if_element_not_found(); tearDown(); testEnded(); testStarted("test_iterator_hasNext_should_give_TRUE_when_element_is_present"); setup(); test_iterator_hasNext_should_give_TRUE_when_element_is_present(); tearDown(); testEnded(); testStarted("test_iterator_hasNext_should_give_FALSE_when_element_is_not_present"); setup(); test_iterator_hasNext_should_give_FALSE_when_element_is_not_present(); tearDown(); testEnded(); testStarted("test_iterator_next_should_give_next_element"); setup(); test_iterator_next_should_give_next_element(); tearDown(); testEnded(); testStarted("test_iterator_next_should_give_NULL_in_empty_ArrayList"); setup(); test_iterator_next_should_give_NULL_in_empty_ArrayList(); tearDown(); testEnded(); testStarted("test_deletes_single_element_from_list"); setup(); test_deletes_single_element_from_list(); tearDown(); testEnded(); testStarted("test_deletes_and_shifts_elements_left"); setup(); test_deletes_and_shifts_elements_left(); tearDown(); testEnded(); testStarted("test_add_adds_to_end_of_list"); setup(); test_add_adds_to_end_of_list(); tearDown(); testEnded(); testStarted("test_add_adds_multiple_data_to_end_of_list"); setup(); test_add_adds_multiple_data_to_end_of_list(); tearDown(); testEnded(); testStarted("test_iterate_visits_each_element_of_list"); setup(); test_iterate_visits_each_element_of_list(); tearDown(); testEnded(); summarizeTestCount(); fixtureTearDown(); return 0; }
int main(){ fixtureSetup(); resetTestCount(); testStarted("test_should_push_a_int_element_in_the_stack"); setup(); test_should_push_a_int_element_in_the_stack(); tearDown(); testEnded(); testStarted("test_should_push_two_float_element_in_the_stack"); setup(); test_should_push_two_float_element_in_the_stack(); tearDown(); testEnded(); testStarted("test_should_push_two_double_element_in_the_stack"); setup(); test_should_push_two_double_element_in_the_stack(); tearDown(); testEnded(); testStarted("test_should_push_two_char_element_in_the_stack"); setup(); test_should_push_two_char_element_in_the_stack(); tearDown(); testEnded(); testStarted("test_should_push_two_string_element_in_the_stack"); setup(); test_should_push_two_string_element_in_the_stack(); tearDown(); testEnded(); testStarted("test_should_pop_int_element_from_stack"); setup(); test_should_pop_int_element_from_stack(); tearDown(); testEnded(); testStarted("test_should_pop_float_element_from_stack"); setup(); test_should_pop_float_element_from_stack(); tearDown(); testEnded(); testStarted("test_should_pop_double_element_from_stack"); setup(); test_should_pop_double_element_from_stack(); tearDown(); testEnded(); testStarted("test_should_pop_char_element_from_stack"); setup(); test_should_pop_char_element_from_stack(); tearDown(); testEnded(); testStarted("test_should_pop_string_element_from_stack"); setup(); test_should_pop_string_element_from_stack(); tearDown(); testEnded(); testStarted("test_should_return_top_int_element_from_stack"); setup(); test_should_return_top_int_element_from_stack(); tearDown(); testEnded(); testStarted("test_should_return_top_float_element_from_stack"); setup(); test_should_return_top_float_element_from_stack(); tearDown(); testEnded(); testStarted("test_should_return_top_char_element_from_stack"); setup(); test_should_return_top_char_element_from_stack(); tearDown(); testEnded(); testStarted("test_should_return_top_string_element_from_stack"); setup(); test_should_return_top_string_element_from_stack(); tearDown(); testEnded(); summarizeTestCount(); fixtureTearDown(); return 0; }
MediaPacketTest::~MediaPacketTest() { tearDown(); }
EventTappingEventPublisher::~EventTappingEventPublisher() { tearDown(); }
void kill(MM_EnvironmentBase *env) { tearDown(env); env->getForge()->free(this); }
/** * @todo Provide function documentation */ void MM_MemorySpace::kill(MM_EnvironmentBase *env) { tearDown(env); env->getForge()->free(this); }
void resetTest(void) { tearDown(); setUp(); }
void keyvalInterpreter(int key_val, list_attribs* p_LA, Dynamic_File_List* p_DFL, std::stack<Operation> * undo_stack, std::stack<Operation> * redo_stack){ switch(key_val){ case ESC: clearStack(undo_stack); clearStack(redo_stack); clear_screen(); //CONSOLE printf("\n"); //CONSOLE break; case UP: if(p_LA->cur_state != MAIN_MENU && p_LA->cur_state != INIT){ if(p_LA->r_first > 1) p_LA->r_first--; } break; case DOWN: if(p_LA->cur_state != MAIN_MENU && p_LA->cur_state != INIT){ if(p_LA->r_first < p_LA->num_rows){ if(p_LA->r_first < p_LA->r_last) p_LA->r_first++; else {p_LA->r_first++; p_LA->r_last++;} } } break; case LEFT: if(p_LA->cur_state == INSERT || p_LA->cur_state == REPLACE || p_LA->cur_state == SPLIT_COLUMNS || p_LA->cur_state == ERASE){ if(p_LA->c_first > 1) p_LA->c_first--; } else if(p_LA->cur_state == MOVE_ROWS){ if(p_LA->move_rows_target > 1) p_LA->move_rows_target--; } break; case RIGHT: if(p_LA->cur_state == INSERT || p_LA->cur_state == REPLACE || p_LA->cur_state == ERASE){ if(p_LA->c_first < p_LA->num_cols){ if(p_LA->c_first < p_LA->c_last) p_LA->c_first++; else {p_LA->c_first++; p_LA->c_last++;} } } else if(p_LA->cur_state == MOVE_ROWS){ if(p_LA->move_rows_target < p_LA->num_rows) p_LA->move_rows_target++; } else if(p_LA->cur_state == SPLIT_COLUMNS){ if(p_LA->c_first < p_LA->num_cols) p_LA->c_first++; } break; case SHIFT_UP: if(p_LA->cur_state != MAIN_MENU && p_LA->cur_state != INIT){ if(p_LA->r_last > 1){ if(p_LA->r_last > p_LA->r_first) p_LA->r_last--; else {p_LA->r_first--; p_LA->r_last--;} } } break; case SHIFT_DOWN: if(p_LA->cur_state != MAIN_MENU && p_LA->cur_state != INIT){ if(p_LA->r_last < p_LA->num_rows) p_LA->r_last++; } break; case SHIFT_LEFT: if( (p_LA->cur_state != MAIN_MENU && p_LA->cur_state != INIT) && p_LA->cur_state != SPLIT_COLUMNS){ if(p_LA->c_last > 1){ if(p_LA->c_last > p_LA->c_first) p_LA->c_last--; else {p_LA->c_last--; p_LA->c_first--;} } } else if(p_LA->cur_state == SPLIT_COLUMNS){ if(p_LA->c_last > 1) p_LA->c_last--; } break; case SHIFT_RIGHT: if( (p_LA->cur_state != MAIN_MENU && p_LA->cur_state != INIT) && p_LA->cur_state != SPLIT_COLUMNS){ if(p_LA->c_last < p_LA->num_cols) p_LA->c_last++; } else if(p_LA->cur_state == SPLIT_COLUMNS){ if(p_LA->c_last < 260) p_LA->c_last++; //soft limit, will revert to size of entry if larger than } break; case B: //Back if(p_LA->cur_state != MAIN_MENU && p_LA->cur_state != INIT){ p_LA->last_state = p_LA->cur_state; p_LA->cur_state = MAIN_MENU; console_clearAndPrint(p_LA, p_DFL); } break; case C: //Confirm for various states if(confirmOperationSwitch(p_LA, p_DFL, undo_stack)){ //clear redo stack here clearStack(redo_stack); p_LA->last_state = p_LA->cur_state; p_LA->cur_state = MAIN_MENU; console_clearAndPrint(p_LA, p_DFL); } break; case D: //set state to delete rows if(p_LA->cur_state == MAIN_MENU){ p_LA->last_state = MAIN_MENU; p_LA->cur_state = DELETE_ROWS; console_clearAndPrint(p_LA, p_DFL); } break; case E: if(p_LA->cur_state == MAIN_MENU){ p_LA->last_state = MAIN_MENU; p_LA->cur_state = ERASE; console_clearAndPrint(p_LA, p_DFL); } break; case I: //Insert/Iterator //SOME OF THIS SHOULD BE IN confirm FUNCTION if(p_LA->cur_state == MAIN_MENU) { //move to insert p_LA->last_state = MAIN_MENU; p_LA->cur_state = INSERT; console_clearAndPrint(p_LA, p_DFL); } else if(p_LA->cur_state == INSERT) { //move to iterator p_LA->last_state = INSERT; p_LA->cur_state = MAIN_MENU; insertIterator(p_DFL, p_LA, undo_stack); clearStack(redo_stack); console_clearAndPrint(p_LA, p_DFL); } else if(p_LA->cur_state == REPLACE){ p_LA->last_state = REPLACE; p_LA->cur_state = MAIN_MENU; //UNDO/REDO Operation input_op; setOperationAttribs(&input_op, REPLACE, -1, -1, -1, -1, false); undo_stack->push(input_op); //END UNDO/REDO deleteRowItems(p_DFL, p_LA, undo_stack); insertIterator(p_DFL, p_LA, undo_stack); //UNDO/REDO setOperationAttribs(&input_op, REPLACE, 0, 0, 0, 0, true); undo_stack->push(input_op); //END UNDO/REDO clearStack(redo_stack); resetListAttribs(p_LA, p_DFL); console_clearAndPrint(p_LA, p_DFL); } break; case L: //For loading new file data if(p_LA->cur_state == MAIN_MENU) { p_LA->last_state = MAIN_MENU; p_LA->cur_state = EXIT_RELOAD; clearStack(undo_stack); clearStack(redo_stack); tearDown(p_DFL); init(); } break; case M: //mode if(p_LA->cur_state == MAIN_MENU){ p_LA->last_state = p_LA->cur_state; p_LA->cur_state = MOVE_ROWS; console_clearAndPrint(p_LA, p_DFL); } break; case N: //deprecated, get rid of if(redo_stack->size() > 0){ Operation input_op; setOperationAttribs(&input_op, REDO, -1, -1, -1, -1, false); undo_stack->push(input_op); undo_StackHandler(redo_stack, undo_stack, p_DFL, p_LA); setOperationAttribs(&input_op, REDO, 0, 0, 0, 0, true); undo_stack->push(input_op); console_clearAndPrint(p_LA, p_DFL); } break; case R: if(p_LA->cur_state == MAIN_MENU){ p_LA->last_state = MAIN_MENU; p_LA->cur_state = REPLACE; console_clearAndPrint(p_LA, p_DFL); } break; case S: //save/set if(p_LA->cur_state == MAIN_MENU){ p_LA->last_state = p_LA->cur_state; p_LA->cur_state = SAVE_CHANGES; console_clearAndPrint(p_LA, p_DFL); } else if(p_LA->cur_state == INSERT || p_LA->cur_state == REPLACE){ p_LA->last_state = p_LA->cur_state; p_LA->cur_state = SET_PHRASE; console_clearAndPrint(p_LA, p_DFL); p_LA->cur_state = p_LA->last_state; p_LA->last_state = SET_PHRASE; console_clearAndPrint(p_LA, p_DFL); } break; case U: //Pop undo if able if(undo_stack->size() > 0){ Operation input_op; setOperationAttribs(&input_op, UNDO, -1, -1, -1, -1, false); redo_stack->push(input_op); undo_StackHandler(undo_stack, redo_stack, p_DFL, p_LA); setOperationAttribs(&input_op, UNDO, 0, 0, 0, 0, true); redo_stack->push(input_op); console_clearAndPrint(p_LA, p_DFL); } break; case W: //DEBUG KEY TO FLUSH STACKS TO SCREEN { #ifdef DEBUG printf("###UNDO STACK CONTENTS###\n"); int stack_size = undo_stack->size(); for(int i = 0; i < stack_size; i++){ Operation top_op = undo_stack->top(); debugPrintAllParams(&top_op); undo_stack->pop(); } #endif //DEBUG #ifdef DEBUG printf("###REDO STACK CONTENTS###\n"); stack_size = redo_stack->size(); for(int i = 0; i < stack_size; i++){ Operation top_op = redo_stack->top(); debugPrintAllParams(&top_op); redo_stack->pop(); } #endif //DEBUG } break; case X: //Split columns state if(p_LA->cur_state == MAIN_MENU){ p_LA->last_state = p_LA->cur_state; p_LA->cur_state = SPLIT_COLUMNS; console_clearAndPrint(p_LA, p_DFL); } break; } }