X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Ffilter_backend_test.cpp;h=57f6b391bccce008cba449e14237f6513a687f84;hb=94e341af1ed1bcb064089db64836015844c3dcd7;hp=635d9eb8c174274e7fecf56a15dd21537c05e9e8;hpb=219ffa015c0e35b03fae0788b0e8e6abcfde1a81;p=metaproxy-moved-to-github.git diff --git a/src/filter_backend_test.cpp b/src/filter_backend_test.cpp index 635d9eb..57f6b39 100644 --- a/src/filter_backend_test.cpp +++ b/src/filter_backend_test.cpp @@ -1,7 +1,22 @@ -/* $Id: filter_backend_test.cpp,v 1.24 2007-04-13 09:57:51 adam Exp $ +/* $Id: filter_backend_test.cpp,v 1.26 2007-05-09 21:23:09 adam Exp $ Copyright (c) 2005-2007, Index Data. - See the LICENSE file for details +This file is part of Metaproxy. + +Metaproxy is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +Metaproxy is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Metaproxy; see the file LICENSE. If not, write to the +Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ #include "config.hpp" @@ -100,14 +115,14 @@ Z_Records *yf::BackendTest::Rep::fetch( return 0; } - const char *name_oid = OID_STR_USMARC; // default if syntax is given + if (!preferredRecordSyntax) + preferredRecordSyntax = odr_oiddup(odr, yaz_oid_recsyn_usmarc); + if (preferredRecordSyntax) { - name_oid = - yaz_oid_to_string(yaz_oid_std(), preferredRecordSyntax, 0); - if (name_oid && !strcmp(name_oid, OID_STR_USMARC)) + if (!oid_oidcmp(preferredRecordSyntax, yaz_oid_recsyn_xml)) ; - else if (name_oid && !strcmp(name_oid, OID_STR_XML)) + else if (!oid_oidcmp(preferredRecordSyntax, yaz_oid_recsyn_usmarc)) ; else { @@ -128,13 +143,13 @@ Z_Records *yf::BackendTest::Rep::fetch( element_set_name = esn->u.generic; } if (!strcmp(element_set_name, "B") - && !strcmp(name_oid, OID_STR_USMARC)) + && !oid_oidcmp(preferredRecordSyntax, yaz_oid_recsyn_usmarc)) ; // Brief else if (!strcmp(element_set_name, "F") - && !strcmp(name_oid, OID_STR_USMARC)) + && !oid_oidcmp(preferredRecordSyntax, yaz_oid_recsyn_usmarc)) ; // Full else if (!strncmp(element_set_name, "FF", 2) - && !strcmp(name_oid, OID_STR_XML)) + && !oid_oidcmp(preferredRecordSyntax, yaz_oid_recsyn_xml)) ; // Huge XML test record else {