int main(int argc, char **argv) { int i, j; #define MAX_FRAME_SIZE 16384 #define MESSAGES_PER_FRAME (MAX_FRAME_SIZE / 5) #define FRAME_SIZE (MESSAGES_PER_FRAME * 5) #define SEND_SIZE (100 * 1024) #define NUM_FRAMES (SEND_SIZE / FRAME_SIZE + 1) grpc_test_init(argc, argv); addbuf(PFX_STR, sizeof(PFX_STR) - 1); for (i = 0; i < NUM_FRAMES; i++) { uint8_t hdr[9] = {(uint8_t)(FRAME_SIZE >> 16), (uint8_t)(FRAME_SIZE >> 8), (uint8_t)FRAME_SIZE, 0, 0, 0, 0, 0, 1}; addbuf(hdr, sizeof(hdr)); for (j = 0; j < MESSAGES_PER_FRAME; j++) { uint8_t message[5] = {0, 0, 0, 0, 0}; addbuf(message, sizeof(message)); } } grpc_run_bad_client_test(verifier, g_buffer, g_count, 0); gpr_free(g_buffer); return 0; }
int main(int argc, char **argv) { int i; grpc_test_init(argc, argv); #define NUM_FRAMES 10 #define FRAME_SIZE 1000 addbuf(prefix, sizeof(prefix) - 1); for (i = 0; i < NUM_FRAMES; i++) { uint8_t hdr[9] = {(uint8_t)(FRAME_SIZE >> 16), (uint8_t)(FRAME_SIZE >> 8), (uint8_t)FRAME_SIZE, 0, 0, 0, 0, 0, 3}; uint8_t msg[FRAME_SIZE]; memset(msg, 'a', sizeof(msg)); addbuf(hdr, sizeof(hdr)); addbuf(msg, FRAME_SIZE); } grpc_run_bad_client_test(verifier, NULL, g_buffer, g_count, 0); gpr_free(g_buffer); return 0; }