#39559 [NEW]: Levenstein.c gives spurious additional warning if custom_levdist is called
| From: | zoe dot slattery at googlemail dot com | Date: | Mon, 20 Nov 2006 15:39:12 +0000 |
| Subject: | #39559 [NEW]: Levenstein.c gives spurious additional warning if custom_levdist is called | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-105235@lists.php.net to get a copy of this message | ||
From: zoe dot slattery at googlemail dot com
Operating system: Linux
PHP version: 5CVS-2006-11-20 (snap)
PHP Bug Type: Unknown/Other Function
Bug description: Levenstein.c gives spurious additional warning if custom_levdist is called
Description:
------------
I started by modifying the levenshtein test function
ext/standard/tests/general_functions/003.phpt to cover the case where
custom_levdist is called and to add some checks that the behviour is
correct if strings > 255 chars are passed to levenshtein.c
A patch to the test case is provided here:
http://pastebin.ca/253241
the new test case covers >90% of the code.
Unfortunately the new test case showed that when custom_levdist is called
two warnings are issued. The first of these warns correctly that "The
general Levenstein support is not there yet", the second warning
("Arguments strings(s) too long") is issued incorrectly.
I have attached a suggested patch to ext/standard/levenshtein.c here
(http://pastebin.ca/253242) which corrects this.
Reproduce code:
---------------
The way to reproduce is to use the modified testcase - linked above.
Note that I have also modified the tescase to expect a return code of -2
from custom_levdist (rather than -1)
Expected result:
----------------
Warning "The general Levenshtein support is not there yet"
Actual result:
--------------
Warning "The general Levenshtein support is not there yet"
Warning "Argument string(s) too long"
--
Edit bug report at http://bugs.php.net/?id=39559&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39559&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39559&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39559&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=39559&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=39559&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=39559&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=39559&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=39559&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=39559&r=support
Expected behavior: http://bugs.php.net/fix.php?id=39559&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=39559&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=39559&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=39559&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39559&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=39559&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=39559&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=39559&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=39559&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=39559&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=39559&r=mysqlcfg