update to 9.7.1-P2
[tridge/bind9.git] / bin / tests / names / t_names.c
index e3d58fef594e0d822dda8141fe4692b3de4cb4fc..d3a8b66c7dcec3d707157ff8e1336fd6ae9a42b3 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: t_names.c,v 1.46.158.2 2009/01/22 23:47:05 tbox Exp $ */
+/* $Id: t_names.c,v 1.50 2009/09/01 23:47:44 tbox Exp $ */
 
 #include <config.h>
 
@@ -344,8 +344,7 @@ dname_from_tname(char *name, dns_name_t *dns_name) {
                isc_buffer_init(binbuf, junk, BUFLEN);
                dns_name_init(dns_name, NULL);
                dns_name_setbuffer(dns_name, binbuf);
-               result = dns_name_fromtext(dns_name,  &txtbuf,
-                                               NULL, ISC_FALSE, NULL);
+               result = dns_name_fromtext(dns_name,  &txtbuf, NULL, 0, NULL);
        } else {
                result = ISC_R_NOSPACE;
                if (junk != NULL)
@@ -535,7 +534,7 @@ test_dns_name_isabsolute(char *test_name, isc_boolean_t expected) {
        isc_buffer_init(&binbuf, &junk[0], BUFLEN);
        dns_name_init(&name, NULL);
        dns_name_setbuffer(&name, &binbuf);
-       result = dns_name_fromtext(&name,  &buf, NULL, ISC_FALSE, NULL);
+       result = dns_name_fromtext(&name,  &buf, NULL, 0, NULL);
        if (result == ISC_R_SUCCESS) {
                isabs_p = dns_name_isabsolute(&name);
                if (isabs_p == expected)
@@ -1659,7 +1658,7 @@ static const char *a40 =
 
 static int
 test_dns_name_fromtext(char *test_name1, char *test_name2, char *test_origin,
-                      isc_boolean_t downcase)
+                      unsigned int downcase)
 {
        int             result;
        int             order;
@@ -1702,8 +1701,8 @@ test_dns_name_fromtext(char *test_name1, char *test_name2, char *test_origin,
        dns_name_setbuffer(&dns_name2, &binbuf2);
        dns_name_setbuffer(&dns_name3, &binbuf3);
 
-       dns_result = dns_name_fromtext(&dns_name3,  &txtbuf3, NULL,
-                                               ISC_FALSE, &binbuf3);
+       dns_result = dns_name_fromtext(&dns_name3,  &txtbuf3, NULL, 0,
+                                      &binbuf3);
        if (dns_result != ISC_R_SUCCESS) {
                t_info("dns_name_fromtext(dns_name3) failed, result == %s\n",
                        dns_result_totext(dns_result));
@@ -1718,8 +1717,8 @@ test_dns_name_fromtext(char *test_name1, char *test_name2, char *test_origin,
                return (T_FAIL);
        }
 
-       dns_result = dns_name_fromtext(&dns_name2,  &txtbuf2, NULL,
-                                               ISC_FALSE, &binbuf2);
+       dns_result = dns_name_fromtext(&dns_name2,  &txtbuf2, NULL, 0,
+                                      &binbuf2);
        if (dns_result != ISC_R_SUCCESS) {
                t_info("dns_name_fromtext(dns_name2) failed, result == %s\n",
                       dns_result_totext(dns_result));
@@ -1777,8 +1776,8 @@ t_dns_name_fromtext(void) {
                                                                Tokens[2],
                                                           atoi(Tokens[3])
                                                                == 0 ?
-                                                               ISC_FALSE :
-                                                               ISC_TRUE);
+                                                               0 :
+                                                            DNS_NAME_DOWNCASE);
                        } else {
                                t_info("bad format at line %d\n", line);
                        }
@@ -1830,8 +1829,7 @@ test_dns_name_totext(char *test_name, isc_boolean_t omit_final) {
        /*
         * Out of the data file to dns_name1.
         */
-       dns_result = dns_name_fromtext(&dns_name1, &buf1, NULL, ISC_FALSE,
-                                      &buf2);
+       dns_result = dns_name_fromtext(&dns_name1, &buf1, NULL, 0, &buf2);
        if (dns_result != ISC_R_SUCCESS) {
                t_info("dns_name_fromtext failed, result == %s\n",
                       dns_result_totext(dns_result));
@@ -1855,8 +1853,7 @@ test_dns_name_totext(char *test_name, isc_boolean_t omit_final) {
         */
        dns_name_init(&dns_name2, NULL);
        isc_buffer_init(&buf3, junk3, BUFLEN);
-       dns_result = dns_name_fromtext(&dns_name2, &buf1, NULL, ISC_FALSE,
-                                      &buf3);
+       dns_result = dns_name_fromtext(&dns_name2, &buf1, NULL, 0, &buf3);
        if (dns_result != ISC_R_SUCCESS) {
                t_info("dns_name_fromtext failed, result == %s\n",
                       dns_result_totext(dns_result));
@@ -2195,8 +2192,7 @@ test_dns_name_towire(char *testname, unsigned int dc_method, char *exp_data,
        isc_buffer_init(&iscbuf1, testname, len);
        isc_buffer_add(&iscbuf1, len);
        isc_buffer_init(&iscbuf2, buf2, BUFLEN);
-       dns_result = dns_name_fromtext(&dns_name, &iscbuf1, NULL, ISC_FALSE,
-                                      &iscbuf2);
+       dns_result = dns_name_fromtext(&dns_name, &iscbuf1, NULL, 0, &iscbuf2);
        if (dns_result == ISC_R_SUCCESS) {
                isc_buffer_init(&iscbuf3, buf3, buflen);
                dns_result = dns_name_towire(&dns_name, &cctx, &iscbuf3);