Closed Bug 1236334 Opened 8 years ago Closed 8 years ago

server_test: should return != 0 in case of error

Categories

(NSPR :: NSPR, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: agx, Assigned: agx)

Details

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.5.0
Build ID: 20151216011944

Steps to reproduce:

Run ./server_test with address already in use


Actual results:

Test printed "FAIL" but exit status was 0.


Expected results:

Test should fail with exit status != 0 like the other tests. Patch attached.
Comment on attachment 8703413 [details] [diff] [review]
0002-Correctly-return-exit-status-on-failure.patch

Review of attachment 8703413 [details] [diff] [review]:
-----------------------------------------------------------------

Guido: thanks a lot for the patch. I suggest two small changes.

::: nspr/pr/tests/server_test.c
@@ +91,4 @@
>  			break;
>  		case FAIL:
>  			printf ("FAIL\n");
> +			failed_already=FAIL;

Please set failed_already to 1, for consistency with existing code
in other tests.

Also add spaces around the equal sign =:

    failed_already = 1;

Note: there are many other places where we should set failed_already
to 1, but you don't need to fix them exhaustively in this patch.
Attachment #8703413 - Flags: review?(ted)
Comments addressed. Thanks for the review.
Attachment #8703413 - Attachment is obsolete: true
Attachment #8703413 - Flags: review?(ted)
Comment on attachment 8704662 [details] [diff] [review]
0001-Bug-1236334-Correctly-return-exit-status-on-failure.patch

r=wtc. Thanks.
https://hg.mozilla.org/projects/nspr/rev/ca7ec69693dd
Attachment #8704662 - Flags: review+
Attachment #8704662 - Flags: checked-in+
Assignee: wtc → agx
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
OS: Unspecified → All
Priority: -- → P2
Hardware: Unspecified → All
Resolution: --- → FIXED
Target Milestone: --- → 4.12
Version: 4.13 → other
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: