Ticket #76: xapian-php5-smoketest.patch

File xapian-php5-smoketest.patch, 3.3 KB (added by Olly Betts, 19 years ago)

Patch which should fix smoketest on PHP5

  • smoketest.php

     
    108108    exit(1);
    109109}
    110110
    111 # Check PHP4 handling of Xapian::DocNotFoundError
    112 $old_error_reporting = error_reporting();
    113 if ($old_error_reporting & E_WARNING)
    114     error_reporting($old_error_reporting ^ E_WARNING);
    115 $doc2 = Database_get_document($db, 2);
    116 if ($doc2 != null) {
    117     print "Retrieved non-existent document\n";
    118     exit(1);
    119 }
    120 if ($old_error_reporting & E_WARNING)
    121     error_reporting($old_error_reporting);
     111include "smoketest".substr(PHP_VERSION, 0, 1).".php";
    122112
    123113# Regression test - overload resolution involving boolean types failed.
    124114Enquire_set_sort_by_value($enq, 1, TRUE);
  • smoketest4.php

     
     1<?php
     2/* PHP4 specific tests.
     3 *
     4 * Copyright (C) 2006 Olly Betts
     5 *
     6 * This program is free software; you can redistribute it and/or
     7 * modify it under the terms of the GNU General Public License as
     8 * published by the Free Software Foundation; either version 2 of the
     9 * License, or (at your option) any later version.
     10 *
     11 * This program is distributed in the hope that it will be useful,
     12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     14 * GNU General Public License for more details.
     15 *
     16 * You should have received a copy of the GNU General Public License
     17 * along with this program; if not, write to the Free Software
     18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
     19 * USA
     20 */
     21
     22# Check PHP4 handling of Xapian::DocNotFoundError
     23$old_error_reporting = error_reporting();
     24if ($old_error_reporting & E_WARNING)
     25    error_reporting($old_error_reporting ^ E_WARNING);
     26$doc2 = Database_get_document($db, 2);
     27if ($doc2 != null) {
     28    print "Retrieved non-existent document\n";
     29    exit(1);
     30}
     31if ($old_error_reporting & E_WARNING)
     32    error_reporting($old_error_reporting);
     33?>
  • smoketest5.php

     
     1<?php
     2/* PHP5 specific tests.
     3 *
     4 * Copyright (C) 2006 Olly Betts
     5 *
     6 * This program is free software; you can redistribute it and/or
     7 * modify it under the terms of the GNU General Public License as
     8 * published by the Free Software Foundation; either version 2 of the
     9 * License, or (at your option) any later version.
     10 *
     11 * This program is distributed in the hope that it will be useful,
     12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     14 * GNU General Public License for more details.
     15 *
     16 * You should have received a copy of the GNU General Public License
     17 * along with this program; if not, write to the Free Software
     18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
     19 * USA
     20 */
     21
     22# Check PHP5 handling of Xapian::DocNotFoundError
     23try {
     24    $doc2 = Database_get_document($db, 2);
     25    if ($doc2 != null) {
     26        print "Retrieved non-existent document\n";
     27        exit(1);
     28    }
     29} catch (e) {
     30}
     31?>