1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) 1995-2011 Index Data
3 * See the file LICENSE for details.
14 #include <yaz/oid_db.h>
18 char oid_buf[OID_STR_MAX];
23 NMEM nmem = nmem_create();
24 ODR odr = odr_createmem(ODR_ENCODE);
29 c_oid = yaz_string_to_oid(db, CLASS_ATTSET, "Bib-1");
30 YAZ_CHECK(c_oid && oid_oidcmp(c_oid, yaz_oid_attset_bib_1) == 0);
32 c_oid = yaz_string_to_oid(db, CLASS_GENERAL, "Bib-1");
33 YAZ_CHECK(c_oid && oid_oidcmp(c_oid, yaz_oid_attset_bib_1) == 0);
35 c_oid = yaz_string_to_oid(db, CLASS_ATTSET, "unknown");
36 YAZ_CHECK(c_oid == 0);
38 oid = yaz_string_to_oid_nmem(db, CLASS_ATTSET, "1.2.840.10003.3.1", nmem);
39 YAZ_CHECK(oid && !oid_oidcmp(oid, yaz_oid_attset_bib_1));
41 oid = yaz_string_to_oid_nmem(db, CLASS_ATTSET, "unknown", nmem);
44 oid = yaz_string_to_oid_odr(db, CLASS_ATTSET, "1.2.840.10003.3.1", odr);
45 YAZ_CHECK(oid && !oid_oidcmp(oid, yaz_oid_attset_bib_1));
47 oid = yaz_string_to_oid_odr(db, CLASS_ATTSET, "unknown", odr);
50 n = yaz_oid_to_string(db, yaz_oid_attset_bib_1, 0);
51 YAZ_CHECK(n && !strcmp(n, "Bib-1"));
53 n = oid_name_to_dotstring(CLASS_ATTSET, "Bib-1", oid_buf);
54 YAZ_CHECK(n && !strcmp(n, "1.2.840.10003.3.1"));
56 n = oid_name_to_dotstring(CLASS_DIAGSET, "Bib-1", oid_buf);
57 YAZ_CHECK(n && !strcmp(n, "1.2.840.10003.4.1"));
59 n = oid_name_to_dotstring(CLASS_DIAGSET, "unknown", oid_buf);
62 n = oid_name_to_dotstring(CLASS_DIAGSET, "1.2.840.10003.3.1", oid_buf);
70 int main (int argc, char **argv)
72 YAZ_CHECK_INIT(argc, argv);
81 * c-file-style: "Stroustrup"
82 * indent-tabs-mode: nil
84 * vim: shiftwidth=4 tabstop=8 expandtab