Fix warning (make string constant)
[yazpp-moved-to-github.git] / zlint / test-search-01.cpp
index f537bc3..88467aa 100644 (file)
@@ -1,8 +1,6 @@
-/*
- * Copyright (c) 2004, Index Data.
+/* This file is part of the yazpp toolkit.
+ * Copyright (C) 1998-2009 Index Data and Mike Taylor
  * See the file LICENSE for details.
- * 
- * $Id: test-search-01.cpp,v 1.5 2005-06-25 15:53:21 adam Exp $
  */
 
 #include <yaz/log.h>
@@ -10,6 +8,7 @@
 #include <yaz/sortspec.h>
 
 #include <zlint.h>
+#include <yaz/oid_db.h>
 
 static const char *try_query[] = {
     "@attr 1=4 petersson",
@@ -131,8 +130,9 @@ Zlint_code Zlint_test_search_01::sendTest(Zlint *z)
 
         z->msg_check_for("record syntax %s", try_syntax[m_record_syntax_no]);
         pr->preferredRecordSyntax =
-            yaz_str_to_z3950oid(z->odr_encode(), CLASS_RECSYN,
-                                try_syntax[m_record_syntax_no]);
+            yaz_string_to_oid_odr(yaz_oid_std(),
+                                  CLASS_RECSYN, try_syntax[m_record_syntax_no],
+                                  z->odr_encode());
         z->send_Z_PDU(apdu, &len);
         return TEST_CONTINUE;
     }
@@ -143,7 +143,7 @@ Zlint_code Zlint_test_search_01::sendTest(Zlint *z)
         {
             z->msg_check_for("sort %s", try_sort[m_sort_no]);
 
-            char *setstring = "default";
+            const char *setstring = "default";
             int len;
             Z_SortRequest *sr = apdu->u.sortRequest;
             
@@ -173,7 +173,6 @@ Zlint_code Zlint_test_search_01::recv_gdu(Zlint *z, Z_GDU *gdu)
         gdu->u.z3950 && gdu->u.z3950->which == Z_APDU_initResponse)
     {
         Z_InitResponse *init = gdu->u.z3950->u.initResponse;
-        int ver = z->initResponseGetVersion(init);
         int result = init->result ? *init->result : 0;
         if (!result)
         {
@@ -222,8 +221,9 @@ Zlint_code Zlint_test_search_01::recv_gdu(Zlint *z, Z_GDU *gdu)
             {
                 Z_External *ext = sr->records->u.databaseOrSurDiagnostics->records[0]->u.databaseRecord;
                 Odr_oid *expectRecordSyntax =
-                    yaz_str_to_z3950oid(z->odr_decode(), CLASS_RECSYN,
-                                        try_syntax[m_record_syntax_no]);
+                    yaz_string_to_oid_odr(
+                        yaz_oid_std(), CLASS_RECSYN,
+                        try_syntax[m_record_syntax_no], z->odr_decode());
                 if (oid_oidcmp(expectRecordSyntax,
                                ext->direct_reference))
                 {
@@ -278,6 +278,7 @@ Zlint_code Zlint_test_search_01::recv_fail(Zlint *z, int reason)
 /*
  * Local variables:
  * c-basic-offset: 4
+ * c-file-style: "Stroustrup"
  * indent-tabs-mode: nil
  * End:
  * vim: shiftwidth=4 tabstop=8 expandtab