schmidmt / shunit2

Automatically exported from code.google.com/p/shunit2
1 stars 0 forks source link

error checking weak in assertTrue #30

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
assertTrue does not check for zero args.  It should use the same error checking 
as assertFalse:

*** shunit2     Thu Sep 15 10:35:01 2011
--- shunit2.patched       Thu Sep 15 10:38:25 2011
***************
*** 315,321 ****
  assertTrue()
  {
    ${_SHUNIT_LINENO_}
!   if [ $# -gt 2 ]; then
      _shunit_error "assertTrue() takes one two arguments; $# given"
      return ${SHUNIT_ERROR}
    fi
--- 315,321 ----
  assertTrue()
  {
    ${_SHUNIT_LINENO_}
!   if [ $# -lt 1 -o $# -gt 2 ]; then
      _shunit_error "assertTrue() takes one two arguments; $# given"
      return ${SHUNIT_ERROR}
    fi

URL: http://shunit2.googlecode.com/svn/trunk/source/2.1/src
Revision: 337

(Minor, I know, but I found it by making a mistake and diagnosing the problem.)

Original issue reported on code.google.com by sienkiew...@gtempaccount.com on 15 Sep 2011 at 2:45

GoogleCodeExporter commented 9 years ago
Fixed in r345.

Original comment by kate.w...@forestent.com on 16 Jan 2013 at 11:03