Opened 14 years ago

Closed 14 years ago

#458 closed defect (fixed)

Xapian test suite failures on openbsd.

Reported by: Daniel Dickman Owned by: Olly Betts
Priority: normal Milestone: 1.0.19
Component: Test Suite Version: 1.0.18
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Operating System: OpenBSD

Description (last modified by Olly Betts)

The Xapian regression suite fails on OpenBSD. First, the patch below is needed. And after applying this patch the test suite still fails with the output below the patch.

--- tests/api_none.cc.orig      Sun Mar 21 05:32:04 2010
+++ tests/api_none.cc   Sun Mar 21 05:32:23 2010
@@ -36,7 +36,7 @@ using namespace std;
 // division by 0.  Fixed in 1.1.4 and 1.0.18.  Ticket#415.
 DEFINE_TESTCASE(nosubdatabases1, !backend) {
     Xapian::Database db;
-    TEST_EQUAL(db.get_metadata("foo"), std::string());
+    TEST_EQUAL(db.get_metadata("foo"), new std::string());
     TEST_EQUAL(db.metadata_keys_begin(), db.metadata_keys_end());
     TEST_EXCEPTION(Xapian::DocNotFoundError, db.termlist_begin(1));
     TEST_EQUAL(db.allterms_begin(), db.allterms_end());
make  btreetest  quartztest apitest  internaltest stemtest  queryparsertest termgentest runtest
`btreetest' is up to date.
`quartztest' is up to date.
depbase=`echo api_none.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; c++ -DHAVE_CONFIG_H -I. -I.. -I../common -I../include  -I../include -I./harness -I../backends/quartz    -Wall -W -Wredundant-decls -Wpointer-arith -Wcast-qual -Wcast-align -Wno-long-long -Wformat-security -fno-gnu-keywords -Woverloaded-virtual -Wundef -O2 -pipe -MT api_none.o -MD -MP -MF $depbase.Tpo -c -o api_none.o api_none.cc && mv -f $depbase.Tpo $depbase.Po
api_none.cc: In function `bool test_nosubdatabases1()':
api_none.cc:39: error: no match for 'operator==' in '
   Xapian::Database::get_metadata(const std::string&) const((&string("foo", 
   (&allocator<char>())))) == (operator new(8), ((true, 
   (<anonymous>->std::basic_string<_CharT, _Traits, _Alloc>::basic_string [with 
   _CharT = char, _Traits = std::char_traits<char>, _Alloc = 
   std::allocator<char>](), (<anonymous> <unknown operator> false))), 
   <anonymous>))'
harness/testutils.h:55: error: candidates are: bool operator==(const 
   Xapian::MSet&, const Xapian::MSet&)
*** Error code 1

Change History (8)

comment:1 by Olly Betts, 14 years ago

Description: modified (diff)

comment:2 by Olly Betts, 14 years ago

Status: newassigned

But get_metadata() returns std::string, not std::string *. So the compilation error you've given us doesn't reveal anything useful as the error it is reporting is due to the patch you've applied.

The code as shipped builds on all the platforms I've tried it on. What's the error you get without the patch?

comment:3 by Daniel Dickman, 14 years ago

Here is the error

===>  Regression check for xapian-core-1.0.18
make  check-recursive
Making check in .
Making check in docs
Making check in tests
make  check-am
make  btreetest  quartztest apitest  internaltest stemtest  queryparsertest termgentest runtest
`btreetest' is up to date.
`quartztest' is up to date.
depbase=`echo api_none.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; c++ -DHAVE_CONFIG_H -I. -I.. -I../common -I../include  -I../include -I./harness -I../backends/quartz    -Wall -W -Wredundant-decls -Wpointer-arith -Wcast-qual -Wcast-align -Wno-long-long -Wformat-security -fno-gnu-keywords -Woverloaded-virtual -Wundef -O2 -pipe -MT api_none.o -MD -MP -MF $depbase.Tpo -c -o api_none.o api_none.cc && mv -f $depbase.Tpo $depbase.Po
api_none.cc: In function `bool test_nosubdatabases1()':
api_none.cc:39: error: syntax error before `)' token
api_none.cc:39: error: syntax error before `<<' token

comment:4 by Olly Betts, 14 years ago

Milestone: 1.1.5

Odd, the code looks valid to me - std::string() should construct a temporary empty string object. What does g++ --version report?

It is hard to know exactly which bit of that line the error is for due to the macros involved, but the simplest fix is probably just to change the offending line to:

    TEST(db.get_metadata("foo").empty());

in reply to:  4 comment:5 by Daniel Dickman, 14 years ago

OpenBSD uses a slightly older g++:

g++ (GCC) 3.3.5 (propolice)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

With your suggested change, the regression tests complete as before... thanks.

comment:6 by Olly Betts, 14 years ago

Milestone: 1.1.51.0.19

Committed to trunk as r14266. Marking to backport for 1.0.19.

comment:7 by Olly Betts, 14 years ago

Backported to 1.0 branch in r14270, along with another backport (got confused, sorry). ChangeLog updated in r14271.

comment:8 by Olly Betts, 14 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.