summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 60cbffb)
raw | patch | inline | side by side (parent: 60cbffb)
author | Justin Sobota <jsobota@ti.com> | |
Wed, 3 Dec 2014 22:35:15 +0000 (17:35 -0500) | ||
committer | Justin Sobota <jsobota@ti.com> | |
Wed, 3 Dec 2014 22:35:15 +0000 (17:35 -0500) |
test/armv7/linux/rm_linux_mt_client_test.c | patch | blob | history |
diff --git a/test/armv7/linux/rm_linux_mt_client_test.c b/test/armv7/linux/rm_linux_mt_client_test.c
index 7eb65c368f5cf64df5475313ce5e0f344bf95656..47b34d281132ea8b3f73c7833ad9bb8fa659d4ae 100644 (file)
rm_pkt = calloc(1, sizeof(*rm_pkt));
if (!rm_pkt) {
- printf("Error: Can't malloc for RM send message (err: %s)\n", strerror(errno));
+ printf("Error : Can't malloc for RM send message (err: %s)\n", strerror(errno));
+ test_errors++;
return (NULL);
}
rm_pkt->pktLenBytes = pktSize;
}
else if (retval < 0) {
printf("Error in reading from socket, error %d\n", retval);
+ test_errors++;
return;
}
if (length < sizeof(*rm_pkt)) {
printf("invalid RM message length %d\n", length);
+ test_errors++;
return;
}
rm_pkt = calloc(1, length);
if (!rm_pkt) {
printf("can't malloc for recv'd RM message (err: %s)\n",
strerror(errno));
+ test_errors++;
return;
}
service_handle->Rm_serviceHandler(service_handle->rmHandle, &request, &response);
if (response.serviceState != RM_SERVICE_APPROVED) {
- printf("Error: Free request was not approved for resource %d - Exiting...\n",
+ printf("Error : Free request was not approved for resource %d - Exiting...\n",
request.resourceBase);
test_errors++;
}
if (pthread_result = pthread_mutex_destroy(&client_mutex_lock)) {
printf("Error : Failed to destroy client pthread mutex with error code: \n", pthread_result);
+ test_errors++;
}
}
printf("Creating first allocate_test thread\n");
if ((status = task_create(allocate_test, (void *)&thread_num_one, &first_th))) {
- printf("ERROR: 1st \"Allocate Test\" task-create failed (%d)\n", status);
+ printf("ERROR : 1st \"Allocate Test\" task-create failed (%d)\n", status);
+ test_errors++;
goto cleanup_test;
}
printf("Creating second allocate_test thread\n");
if ((status = task_create(allocate_test, (void *)&thread_num_two, &second_th))) {
- printf("ERROR: 2nd \"Allocate Test\" task-create failed (%d)\n", status);
+ printf("ERROR : 2nd \"Allocate Test\" task-create failed (%d)\n", status);
+ test_errors++;
goto cleanup_test;
}
printf("Threads complete - Checking for allocation errors\n");
for (i = 0; i < REQUEST_ITERATIONS; i++) {
if (allocs[i] != 1) {
- printf ("FAILED: Resource %d not allocated exactly once\n", i);
+ printf ("FAILED : Resource %d not allocated exactly once\n", i);
test_errors++;
}
}
if (!test_errors) {
- printf("PASSED: All Resources allocated once\n");
+ printf("PASSED : All Resources allocated once\n");
}
}
malloc_free_diff = rmMallocCounter - rmFreeCounter;
byte_free_diff = rmByteAlloc - rmByteFree;
if (malloc_free_diff > 0) {
- printf ("- FAILED - %6d unfreed mallocs -\n", malloc_free_diff);
+ printf ("- FAILED : %6d unfreed mallocs -\n", malloc_free_diff);
test_errors++;
}
else if (byte_free_diff > 0) {
- printf ("- FAILED - %6d unfreed bytes -\n", byte_free_diff);
+ printf ("- FAILED : %6d unfreed bytes -\n", byte_free_diff);
test_errors++;
}
else if (malloc_free_diff < 0) {
- printf ("- FAILED - %6d more frees than mallocs -\n", -malloc_free_diff);
+ printf ("- FAILED : %6d more frees than mallocs -\n", -malloc_free_diff);
test_errors++;
}
else if (byte_free_diff < 0) {
- printf ("- FAILED - %6d more bytes freed than malloc'd -\n", -byte_free_diff);
+ printf ("- FAILED : %6d more bytes freed than malloc'd -\n", -byte_free_diff);
test_errors++;
}
else {
printf ("---------------------------------------------------------\n");
printf ("------------------ Example Completion -------------------\n");
if (test_errors) {
- printf ("- Test Errors: %-32d -\n", test_errors);
+ printf ("- FAILED : Test Errors: %-23d -\n", test_errors);
}
printf ("---------------------------------------------------------\n");
printf ("\n");