host/test_stream.c
/** Tests the response of processPacket() for a set of test streams
  */
Tests the response of processPacket() for a set of test streams
Tests the response of processPacket () for a set of test streams
void TestStreams(statistics * stats)
{
	int i;
	int j;
	initialiseTestsStreams();
	for (i = 0; i < TOTAL_NUMBER_OF_TESTS; i++)
	{
		size = 0;
		response_size = strlen(expected_responses[i]);
		pos = test_responses[i];
		printf("TEST STREAM: %d\n", i);
		printf("Message sent to device: %s\n", test_streams_description[i]);
		if (i == 6)
		{
			for (j = 0; j < 4; j++)
			{
				printf("Creating a new address [%d]\n", j+1);
				SEND_ONE_TEST_STREAM(test_streams[i], test_streams_size[i]);
			}
		}
		else
			SEND_ONE_TEST_STREAM(test_streams[i], test_streams_size[i]);
		checkResponseValidity(i);
		printf("=====================================================================================================================================================\n");
	}
	tests_total = i;
	finaliseTestsStreams();
	(stats->passed) += tests_passed;
	(stats->failed) += tests_failed;
	(stats->total) += tests_total;
	(stats->time) += time_spent;
}
void TestStreams ( statistics * stats ) { int i ; int j ; initialiseTestsStreams ( ) ; for ( i = 0 ; i < TOTAL_NUMBER_OF_TESTS ; i ++ ) { size = 0 ; response_size = strlen ( expected_responses [ i ] ) ; pos = test_responses [ i ] ; printf ( " \n " , i ) ; printf ( " \n " , test_streams_description [ i ] ) ; if ( i == 6 ) { for ( j = 0 ; j < 4 ; j ++ ) { printf ( " \n " , j + 1 ) ; SEND_ONE_TEST_STREAM ( test_streams [ i ] , test_streams_size [ i ] ) ; } } else SEND_ONE_TEST_STREAM ( test_streams [ i ] , test_streams_size [ i ] ) ; checkResponseValidity ( i ) ; printf ( " \n " ) ; } tests_total = i ; finaliseTestsStreams ( ) ; ( stats -> passed ) += tests_passed ; ( stats -> failed ) += tests_failed ; ( stats -> total ) += tests_total ; ( stats -> time ) += time_spent ; }
Tests the response of processPacket() for a set of test streams
Tests the response of processPacket () for a set of test streams