Bugs item #1847981, was opened at 2007-12-10 16:30
Message generated for change (Settings changed) made by subrata_modak
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=103382&aid=1847981&group_id=3382

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Testcases
Group: None
>Status: Closed
>Resolution: Later
Priority: 5
Private: No
Submitted By: George Kraft IV (gk4)
Assigned to: Nobody/Anonymous (nobody)
Summary: 559 tests incorrectly exit with negative number

Initial Comment:
599 LTP tests found to incorrectly exit with a negative number.  All C code 
should exit with 0 (success), 1 (failure), or some positive integer 
(undefined); however, a negative number should never be used because it gets 
masked and therefore is unpredictable.

http://www.opengroup.org/onlinepubs/000095399/functions/exit.html




----------------------------------------------------------------------

Comment By: Mike Frysinger (vapier)
Date: 2007-12-13 20:23

Message:
Logged In: YES 
user_id=114429
Originator: NO

the actual value is irrelevant.  all that matters is the test passed (exit
== 0) or it failed (exit != 0).  attempting to interpret anything else is a
waste of time since LTP has no standard other than that.

if there's a test case that exits with non-zero but is actually 0 when
masked, then great, that's a bug that needs to get fixed.  otherwise, it
doesnt matter.  post a patch if you care that much.  propose a standardized
system.  having a developer go through and make useless changes is a waste
of their time.

----------------------------------------------------------------------

Comment By: George Kraft IV (gk4)
Date: 2007-12-13 15:30

Message:
Logged In: YES 
user_id=4500
Originator: YES

In general, reasonable values for exit are 0 to 255.  Why on earth would I
exit with -1, -257, or 511 and expect the shell (or test system) to
understand 255!  Since LTP's usctest.h does not define a set of exit
values, then EXIT_SUCCESS and EXIT_FAILURE from stdlib.h are the two
reasonable values which are specified by ISO C, IEEE Std 1003.1-2001, and
the LSB.  If you are trying to convey more information of why the test
exited, then before exiting one should properly use tst_resm() with values
of TPASS, TFAIL, TBROK, TWARN, TRETR, TINFO, TCONF.

----------------------------------------------------------------------

Comment By: Mike Frysinger (vapier)
Date: 2007-12-12 21:07

Message:
Logged In: YES 
user_id=114429
Originator: NO

in other words, unless the negative numbers you quote are "large", i dont
think there's anything to fix here

you could even state that "too large positive numbers" are also invalid. 
for example, returning 0x10000 is a positive number, but it is too large so
the exit status is actually "0".

----------------------------------------------------------------------

Comment By: Mike Frysinger (vapier)
Date: 2007-12-12 16:43

Message:
Logged In: YES 
user_id=114429
Originator: NO

actually, it's the exact opposite of unpredictable ... the mask is
specifically known, so as long as the negative number is small, the value
returned to the shell will always be usable as non-zero

(status & 0377)

----------------------------------------------------------------------

Comment By: Subrata (subrata_modak)
Date: 2007-12-12 10:53

Message:
Logged In: YES 
user_id=1737361
Originator: NO

Will look in to this. Thanks.

--Subrata

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=103382&aid=1847981&group_id=3382

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to