projects
/
idzebra-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Changed record update API . It is now handled by function
[idzebra-moved-to-github.git]
/
test
/
api
/
t11.c
diff --git
a/test/api/t11.c
b/test/api/t11.c
index
ab59f20
..
c44a802
100644
(file)
--- a/
test/api/t11.c
+++ b/
test/api/t11.c
@@
-1,5
+1,5
@@
-/* $Id: t11.c,v 1.2 2005-05-02 09:25:12 adam Exp $
- Copyright (C) 1995-2005
+/* $Id: t11.c,v 1.9 2007-01-15 15:10:20 adam Exp $
+ Copyright (C) 1995-2007
Index Data ApS
This file is part of the Zebra server.
Index Data ApS
This file is part of the Zebra server.
@@
-15,9
+15,9
@@
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
for more details.
You should have received a copy of the GNU General Public License
-along with Zebra; see the file LICENSE.zebra. If not, write to the
-Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
*/
/** testing of scan */
*/
/** testing of scan */
@@
-29,97
+29,132
@@
const char *myrec[] = {
"<gils>\n<title>e f</title>\n</gils>\n" ,
0} ;
"<gils>\n<title>e f</title>\n</gils>\n" ,
0} ;
-int main(int argc, char **argv)
+static void tst(int argc, char **argv)
{
{
- ZebraService zs = start_up(0, argc, argv);
- ZebraHandle zh = zebra_open(zs);
+ ZebraService zs = tl_start_up(0, argc, argv);
+ ZebraHandle zh = zebra_open(zs, 0);
+
+ YAZ_CHECK(zh);
+
+ YAZ_CHECK(tl_init_data(zh, myrec));
- init_data(zh, myrec);
+ /*
+ int tl_scan
+ (
+ ZebraHandle zh, const char *query,
+ int pos, int num,
+ int exp_pos, int exp_num, int exp_partial,
+ const char **exp_entries
+ )
+ */
if (1)
{
if (1)
{
+ /* bad string use attrite, bug #647 */
+ YAZ_CHECK(tl_scan(zh, "@attr 1=bad 0", 1, 1, 1, 1, 0, 0));
+ }
+ if (1)
+ {
+ /* bad numeric use attributes, bug #647 */
+ YAZ_CHECK(tl_scan(zh, "@attr 1=1234 0", 1, 1, 1, 1, 0, 0));
+ }
+ if (1)
+ {
/* scan before. nothing must be returned */
const char *ent[] = { "a", 0 };
/* scan before. nothing must be returned */
const char *ent[] = { "a", 0 };
- do_scan(__LINE__, zh, "@attr 1=4 0", 1, 1, 1, 1, 0, ent);
+ YAZ_CHECK(tl_scan(zh, "@attr 1=4 0", 1, 1, 1, 1, 0, ent));
}
if (1)
{
/* scan after. nothing must be returned */
}
if (1)
{
/* scan after. nothing must be returned */
- do_scan(__LINE__, zh, "@attr 1=4 m", 1, 1, 1, 0, 1, 0);
+ const char *ent[] = { 0 };
+ YAZ_CHECK(tl_scan(zh, "@attr 1=4 m", 1, 1, 1, 0, 1, ent));
}
if (1)
{
const char *ent[] = { "a", 0 };
}
if (1)
{
const char *ent[] = { "a", 0 };
- do_scan(__LINE__, zh, "@attr 1=4 a", 1, 1, 1, 1, 0, ent);
+ YAZ_CHECK(tl_scan(zh, "@attr 1=4 a", 1, 1, 1, 1, 0, ent));
}
if (1)
{
const char *ent[] = { "b", "c", 0 };
}
if (1)
{
const char *ent[] = { "b", "c", 0 };
- do_scan(__LINE__, zh, "@attr 1=4 aa", 1, 2, 1, 2, 0, ent);
+ YAZ_CHECK(tl_scan(zh, "@attr 1=4 aa", 1, 2, 1, 2, 0, ent));
}
if (1)
{
const char *ent[] = { "b", "c", 0 };
}
if (1)
{
const char *ent[] = { "b", "c", 0 };
- do_scan(__LINE__, zh, "@attr 1=4 aa", 1, 2, 1, 2, 0, ent);
+ YAZ_CHECK(tl_scan(zh, "@attr 1=4 aa", 1, 2, 1, 2, 0, ent));
}
if (1)
{
const char *ent[] = { "e", "f", 0 };
}
if (1)
{
const char *ent[] = { "e", "f", 0 };
- do_scan(__LINE__, zh, "@attr 1=4 e", 1, 3, 1, 2, 1, ent);
+ YAZ_CHECK(tl_scan(zh, "@attr 1=4 e", 1, 3, 1, 2, 1, ent));
}
if (1)
{
const char *ent[] = { "c", "d", 0 };
}
if (1)
{
const char *ent[] = { "c", "d", 0 };
- do_scan(__LINE__, zh, "@attr 1=4 a", -1, 2, -1, 2, 0, ent);
+ YAZ_CHECK(tl_scan(zh, "@attr 1=4 a", -1, 2, -1, 2, 0, ent));
}
if (1)
{
const char *ent[] = { "d", 0 };
}
if (1)
{
const char *ent[] = { "d", 0 };
- do_scan(__LINE__, zh, "@attr 1=4 a", -2, 1, -2, 1, 0, ent);
+ YAZ_CHECK(tl_scan(zh, "@attr 1=4 a", -2, 1, -2, 1, 0, ent));
}
if (1)
{
const char *ent[] = { "f", 0 };
}
if (1)
{
const char *ent[] = { "f", 0 };
- do_scan(__LINE__, zh, "@attr 1=4 a", -4, 1, -4, 1, 0, ent);
+ YAZ_CHECK(tl_scan(zh, "@attr 1=4 a", -4, 1, -4, 1, 0, ent));
}
if (1)
{
const char *ent[] = { "f", 0 };
}
if (1)
{
const char *ent[] = { "f", 0 };
- do_scan(__LINE__, zh, "@attr 1=4 a", -5, 1, -5, 0, 1, ent);
+ YAZ_CHECK(tl_scan(zh, "@attr 1=4 a", -5, 1, -5, 0, 1, ent));
}
if (1)
{
const char *ent[] = { "d", "e", "f", 0 };
}
if (1)
{
const char *ent[] = { "d", "e", "f", 0 };
- do_scan(__LINE__, zh, "@attr 1=4 a", -2, 3, -2, 3, 0, ent);
+ YAZ_CHECK(tl_scan(zh, "@attr 1=4 a", -2, 3, -2, 3, 0, ent));
}
if (1)
{
const char *ent[] = { "d", "e", "f", 0 };
}
if (1)
{
const char *ent[] = { "d", "e", "f", 0 };
- do_scan(__LINE__, zh, "@attr 1=4 a", -2, 4, -2, 3, 1, ent);
+ YAZ_CHECK(tl_scan(zh, "@attr 1=4 a", -2, 4, -2, 3, 1, ent));
}
if (1)
{
const char *ent[] = { "a", "b", "c", "d", "e", "f", 0 };
}
if (1)
{
const char *ent[] = { "a", "b", "c", "d", "e", "f", 0 };
- do_scan(__LINE__, zh, "@attr 1=4 0", 2, 100, 1, 6, 1, ent);
+ YAZ_CHECK(tl_scan(zh, "@attr 1=4 0", 2, 100, 1, 6, 1, ent));
}
if (1)
{
const char *ent[] = { "b", "c", "d", "e", "f", 0 };
}
if (1)
{
const char *ent[] = { "b", "c", "d", "e", "f", 0 };
- do_scan(__LINE__, zh, "@attr 1=4 0", 0, 100, 0, 5, 1, ent);
+ YAZ_CHECK(tl_scan(zh, "@attr 1=4 0", 0, 100, 0, 5, 1, ent));
}
if (1)
{
const char *ent[] = { "a", "b", "c", "d", "e", "f", 0 };
}
if (1)
{
const char *ent[] = { "a", "b", "c", "d", "e", "f", 0 };
- do_scan(__LINE__, zh, "@attr 1=4 0", 10, 100, 1, 6, 1, ent);
+ YAZ_CHECK(tl_scan(zh, "@attr 1=4 0", 10, 100, 1, 6, 1, ent));
}
if (1)
{
const char *ent[] = { "a", "b", "c", "d", "e", "f", 0 };
}
if (1)
{
const char *ent[] = { "a", "b", "c", "d", "e", "f", 0 };
- do_scan(__LINE__, zh, "@attr 1=4 0", 22, 10, 1, 0, 1, ent);
+ YAZ_CHECK(tl_scan(zh, "@attr 1=4 0", 22, 10, 1, 0, 1, ent));
}
if (1)
{
}
if (1)
{
- do_scan(__LINE__, zh, "@attr 1=4 z", -22, 10, -22, 0, 1, 0);
+ const char *ent[] = { 0 };
+ YAZ_CHECK(tl_scan(zh, "@attr 1=4 z", -22, 10, -22, 0, 1, ent));
}
}
- return close_down(zh, zs, 0);
+ YAZ_CHECK(tl_close_down(zh, zs));
}
}
+
+TL_MAIN
+
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+