int ACE_TMAIN(int argc, ACE_TCHAR *argv[]) { ACE_DEBUG ((LM_DEBUG, "---------------------------------------------\n")); ACE_DEBUG ((LM_DEBUG, "Running the Stub Tests.\n")); try { // Retrieve the ORB. CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); test_forward (orb.in()); test_forward_permanent (orb.in()); test_forward_permanent_mix (orb.in()); } catch (const CORBA::SystemException& sysex) { sysex._tao_print_exception ("Unexpected system Exception!!\n"); return -1; } catch (const CORBA::Exception& ex) { ex._tao_print_exception ("Unexpected CORBA Exception!\n"); return -1; } ACE_DEBUG ((LM_DEBUG, "Stub Tests Successfully Completed!\n")); ACE_DEBUG ((LM_DEBUG, "---------------------------------------------\n")); return 0; }
void test_geometry(std::string const& wkt) { G geo; bg::read_wkt(wkt, geo); typedef typename boost::range_const_iterator<G>::type normal_iterator; typedef bg::circular_iterator<normal_iterator> circular_iterator; circular_iterator end(boost::end(geo)); // 2: start somewhere in the middle (first == test before) test_forward(geo, end, 0, "12345"); test_forward(geo, end, 1, "23451"); test_forward(geo, end, 2, "34512"); test_forward(geo, end, 3, "45123"); test_forward(geo, end, 4, "51234"); test_backward(geo, end, 0, "15432"); test_backward(geo, end, 1, "21543"); test_backward(geo, end, 2, "32154"); test_backward(geo, end, 3, "43215"); test_backward(geo, end, 4, "54321"); // 4: check copy behaviour G copy; normal_iterator start = boost::begin(geo) + 2; circular_iterator it(boost::begin(geo), boost::end(geo), start); std::copy<circular_iterator>(it, end, std::back_inserter(copy)); std::ostringstream out; for (normal_iterator cit = boost::begin(copy); cit != boost::end(copy); ++cit) { out << bg::get<0>(*cit); } BOOST_CHECK_EQUAL(out.str(), "34512"); }
static int run_test (int /*unused*/, char* /*unused*/ []) { test_identity (); #if !defined _RWSTD_NO_RVALUE_REFERENCES test_forward (); test_move (); #else // no rvalue references rw_warn (0, 0, __LINE__, "No compiler support for rvalue references; tests disabled."); #endif // !defined _RWSTD_NO_RVALUE_REFERENCES return 0; }
void receive_task(){ if(Receive_String_Ready){ //forward step by step if(received_string[0] == '+'){ SpeedValue_left += inc; SpeedValue_right += inc; mMove(SpeedValue_left,SpeedValue_right); USART_puts(USART3, "left:"); USART_putd(USART3, SpeedValue_left); USART_puts(USART3, " right:"); USART_putd(USART3, SpeedValue_right); USART_puts(USART3, "\r\n"); } //backward step by step else if(received_string[0] == '-'){ SpeedValue_left -= inc; SpeedValue_right -= inc; mMove(SpeedValue_left, SpeedValue_right); USART_puts(USART3, "left:"); USART_putd(USART3, SpeedValue_left); USART_puts(USART3, " right:"); USART_putd(USART3, SpeedValue_right); USART_puts(USART3, "\r\n"); } //forward else if(received_string[0] == 'p'){ forward(); } //PID else if(received_string[0] == 'f'){ test_PID_forward(); } //backward else if(received_string[0] == 'b'){ test_PID_backward(); } //left else if(received_string[0] == 'l'){ test_PID_left(); } //right else if(received_string[0] == 'r'){ test_PID_right(); } //stop else if(received_string[0] == 's'){ stop(); } //Linear Acturator else if(received_string[0] == 'a'){ USART_puts(USART3, "Actu_A_up"); set_linearActuator_A_cmd(LINEAR_ACTU_CW); USART_puts(USART3, "\r\n"); } else if(received_string[0] == 'n'){ USART_puts(USART3, "Actu_A_down"); //set_linearActuator_A_cmd(LINEAR_ACTU_CCW); USART_puts(USART3, "\r\n"); set_linearActuator_A_cmd(LINEAR_ACTU_CCW); } else if(received_string[0] == 'd'){ USART_puts(USART3, "Actu_A_stop"); //set_linearActuator_A_cmd(LINEAR_ACTU_CCW); USART_puts(USART3, "\r\n"); set_linearActuator_A_cmd(LINEAR_ACTU_STOP); } else if(received_string[0] == 'u'){ USART_puts(USART3, "Actu_B_up"); set_linearActuator_B_cmd(LINEAR_ACTU_CW); USART_puts(USART3, "\r\n"); } else if(received_string[0] == 'k'){ USART_puts(USART3, "Actu_B_down"); //set_linearActuator_B_cmd(LINEAR_ACTU_CCW); USART_puts(USART3, "\r\n"); set_linearActuator_B_cmd(LINEAR_ACTU_CCW); } else if(received_string[0] == 'w'){ USART_puts(USART3, "Actu_B_stop"); //set_linearActuator_B_cmd(LINEAR_ACTU_CCW); USART_puts(USART3, "\r\n"); set_linearActuator_B_cmd(LINEAR_ACTU_STOP); } //get encoder else if(received_string[0] == 'e'){ getEncoder(); } //test else if(received_string[0] == 't'){ test_forward(); } } }
void test_NumericalDiff() { CALL_SUBTEST(test_forward()); CALL_SUBTEST(test_central()); }