I bumped into this problem when patching for #480424: Update locale module to use drupal_static(). The patch creates 13 fail/exceptions in distinct tests in the testing server. When I test it locally, simpletest returns 1 fail and 1 exception, but themes the page as if nothing failed.

When I expand the list of messages, there is no fail or exception message (i.e. everything is green). In fact, I can't find any asserts that haven't passed. Often, the last green message in the list corresponds to the last assert (and often last line) of the test function. So where is the fail/exception coming from?

CommentFileSizeAuthor
#1 483486-1.png24.01 KBJamesAn

Comments

JamesAn’s picture

StatusFileSize
new24.01 KB

Here's a screenshot for one of the test runs.

I've postponed #480424: Update locale module to use drupal_static() until I know (or someone can figure out) what's going on here.

damien tournoud’s picture

Status: Active » Closed (duplicate)

That's a bug in your patched locale_get_plural():

  $locale_formula = &drupal_static(__FUNCTION__, array());
  $plurals = &drupal_static(__FUNCTION__, array());

Erm. Those are overwriting one another.

Why are you seeing those strange numbers? Because the test summary line in a context in which the locale module is enabled, so function_exists('locale_get_plural') is TRUE. locale_get_plural() is being called, but because of the flaw above it doesn't returns -1 as it is supposed to, but 0.

Marking as a duplicate of #480424: Update locale module to use drupal_static(), where the bug really is.

JamesAn’s picture

Thanks for catching and explaining this! Much appreciated. =)