php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59804 Failed Tests due to new databases & changes in the timeZone.c api
Submitted: 2011-06-06 10:33 UTC Modified: 2011-10-24 00:25 UTC
From: mike at digitalstruct dot com Assigned: ohill (profile)
Status: Closed Package: geoip (PECL)
PHP Version: 5.3.6 OS: Ubuntu 10.10
Private report: No CVE-ID: None
 [2011-06-06 10:33 UTC] mike at digitalstruct dot com
Description:
------------
The latest GeoIP contains many new files; by changing the 
tests for 2 of the files it fixes 2 tests.  There is also a 
change in how the timeZone.c does "CA" which failed another 
test. 

I have updated the tests to pass for the current SVN.

Reproduce code:
---------------
Patch file: http://blog.digitalstruct.com/patches/geoip-svn-tests.patch.txt

Expected result:
----------------
Tests pass.

Actual result:
--------------
============================================================
=========
TEST RESULT SUMMARY
------------------------------------------------------------
---------
Exts skipped    :    0
Exts tested     :   45
------------------------------------------------------------
---------

Number of tests :   15                15
Tests skipped   :    0 (  0.0%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :    3 ( 20.0%) ( 20.0%)
Expected fail   :    0 (  0.0%) (  0.0%)
Tests passed    :   12 ( 80.0%) ( 80.0%)
------------------------------------------------------------
---------
Time taken      :    0 seconds
============================================================
=========

============================================================
=========
FAILED TEST SUMMARY
------------------------------------------------------------
---------
Calling geoip_db_filename() with a non-existant database 
type within bound. [tests/008.phpt]
Calling geoip_database_info() with a non-existant database 
type within bound. [tests/011.phpt]
Checking timezone info with (some) empty fields 
[tests/014.phpt]
============================================================
=========


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-06-06 10:45 UTC] ohill@php.net
Your patch works, but will fail with old library installed.

If some values have changed in the lib, perhaps we should not use those tests at all.
 [2011-06-06 10:54 UTC] mike at digitalstruct dot com
Well; the library changed for timeZone.c for the values in 
test 014.  I can DL some older versions of the library and 
run some tests against those.

In tests 008 and 011 those are values that are now never 
going to be utilized. I could update it based on the version 
of the GeoIP library for the tests to function correctly for 
older editions.  If you look at the GeoIP.h header for the 
library it states:
GEOIP_CITYCONFIDENCEDIST_ISP_ORG_EDITION = 19, /* unsued, 
but gaps are not allowed */
GEOIP_CCM_COUNTRY_EDITION =20,  /* unsued, but gaps are not 
allowed */
which is probably the safest directory as they are the only 
ones that are not looking for a file in any location.

The largest issue I see here is that the tests fail on the 
newer versions of the library which are now becoming 
standard in most of the distributions.
 [2011-10-24 00:25 UTC] ohill@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: ohill
 [2011-10-24 00:25 UTC] ohill@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

Except #14, which I will have to change completely.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 15:01:32 2024 UTC