Download & Extend

DatabaseLog->findCaller() fails on Windows

Project:Drupal core
Version:7.x-dev
Component:database system
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

When running the test Database › Query logging on Windows, I get the two failed tests:

Correct function in query log.   Other   database_test.test   1718   DatabaseLoggingTestCase->testEnableLogging()
Correct function in query log.   Other   database_test.test   1718   DatabaseLoggingTestCase->testEnableLogging()

This is because the filenames returned by debug_backtrace() contain backslashes, e.g.
D:\Program Files\Apache Software Foundation\Apache2.2\htdocs\drupal\includes\database\log.inc.

The attached patch fixes the problem. I chose this solution because of its readability.

AttachmentSizeStatusTest resultOperations
findCaller.patch1.14 KBIgnored: Check issue status.NoneNone

Comments

#1

Status:needs review» needs work

Well bah. Wouldn't it be better to use DIRECTORY_SEPARATOR instead, though, to be properly cross-platform?

#2

Yes, that is better.

AttachmentSizeStatusTest resultOperations
findCaller-2.patch1.23 KBIgnored: Check issue status.NoneNone

#3

Status:needs work» needs review

Code looks good visually. I've not tested it yet, but it's simple enough that it hardly needs extensive testing.

#4

Status:needs review» reviewed & tested by the community

Patch applies and tests still run properly under Linux. I have no Windows box to test on, but I see no way in which it would fail there with this patch. Thanks, c!

#5

Status:reviewed & tested by the community» fixed

Committed to CVS HEAD. Thanks!

#6

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

nobody click here