chrislim2888 / IP2Location-C-Library

IP2Location C library enables the user to find the country, region, city, coordinates, zip code, time zone, ISP, domain name, connection type, area code, weather station code, weather station name, mobile, usage types, etc that any IP address or hostname originates from.
https://www.ip2location.com
MIT License
61 stars 30 forks source link

[8.4.0] failed test #47

Closed remicollet closed 3 years ago

remicollet commented 3 years ago
   IP2Loc 8.4.0: test/test-suite.log
=======================================

# TOTAL: 1
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: test-IP2Location
======================

Incorrect IP2Location BIN file format. Please make sure that you are using the latest IP2Location BIN file.IP2Location API version: 8.4.0 (80400)
Please install the database in correct path.
FAIL test-IP2Location (exit status: 255)
remicollet commented 3 years ago

Work in git

But ip-country.pl rely on file time, which may be 2021, from official archive (2020 expected by code)

A simple touch -d 20200925 data/*CSV allow to fix this issue. But of course this is only a workaround / ugly hack

remicollet commented 3 years ago

$ tar tvf IP2Location-8.4.0.tar.gz | grep CSV
-rw-rw-r-- root/root  12534930 2021-05-20 03:48 IP2Location-C-Library-8.4.0/data/IP-COUNTRY.6.CSV
-rw-rw-r-- root/root   4841937 2021-05-20 03:48 IP2Location-C-Library-8.4.0/data/IP-COUNTRY.CSV
ip2location commented 3 years ago

It's due to the old Perl script generated the old version of BIN. Already uploaded to latest Perl script.

jorjick commented 2 years ago

8.4.0 Still failed tests. ip-country.pl set 29,30 byte to 0 therefore this test fail

if (handler->product_code == 1) {
} else {
    if (handler->database_year <= 20 && handler->product_code == 0) {
    } else {
        printf(INVALID_BIN_DATABASE);
        return NULL;
    }
}

IP2Loc 8.4.0: test/test-suite.log \=======================================

# TOTAL: 1 # PASS: 0 # SKIP: 0 # XFAIL: 0 # FAIL: 1 # XPASS: 0 # ERROR: 0

.. contents:: :depth: 2

FAIL: test-IP2Location \======================

IP2Location library error in opening database ../data/IP-COUNTRY.BIN. IP2Location API version: 8.4.0 (80400) Please install the database in correct path. FAIL test-IP2Location (exit status: 255)