| 22876 | |
| 22877 | |
| 22878 | static int |
| 22879 | test_xmlSaveFormatFileTo(void) { |
| 22880 | int test_ret = 0; |
| 22881 | |
| 22882 | #if defined(LIBXML_OUTPUT_ENABLED) |
| 22883 | int mem_base; |
| 22884 | int ret_val; |
| 22885 | xmlOutputBufferPtr buf; /* an output I/O buffer */ |
| 22886 | int n_buf; |
| 22887 | xmlDocPtr cur; /* the document */ |
| 22888 | int n_cur; |
| 22889 | char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */ |
| 22890 | int n_encoding; |
| 22891 | int format; /* should formatting spaces been added */ |
| 22892 | int n_format; |
| 22893 | |
| 22894 | for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) { |
| 22895 | for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { |
| 22896 | for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { |
| 22897 | for (n_format = 0;n_format < gen_nb_int;n_format++) { |
| 22898 | mem_base = xmlMemBlocks(); |
| 22899 | buf = gen_xmlOutputBufferPtr(n_buf, 0); |
| 22900 | cur = gen_xmlDocPtr(n_cur, 1); |
| 22901 | encoding = gen_const_char_ptr(n_encoding, 2); |
| 22902 | format = gen_int(n_format, 3); |
| 22903 | |
| 22904 | ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format); |
| 22905 | buf = NULL; |
| 22906 | desret_int(ret_val); |
| 22907 | call_tests++; |
| 22908 | des_xmlOutputBufferPtr(n_buf, buf, 0); |
| 22909 | des_xmlDocPtr(n_cur, cur, 1); |
| 22910 | des_const_char_ptr(n_encoding, (const char *)encoding, 2); |
| 22911 | des_int(n_format, format, 3); |
| 22912 | xmlResetLastError(); |
| 22913 | if (mem_base != xmlMemBlocks()) { |
| 22914 | printf("Leak of %d blocks found in xmlSaveFormatFileTo", |
| 22915 | xmlMemBlocks() - mem_base); |
| 22916 | test_ret++; |
| 22917 | printf(" %d", n_buf); |
| 22918 | printf(" %d", n_cur); |
| 22919 | printf(" %d", n_encoding); |
| 22920 | printf(" %d", n_format); |
| 22921 | printf("\n"); |
| 22922 | } |
| 22923 | } |
| 22924 | } |
| 22925 | } |
| 22926 | } |
| 22927 | function_tests++; |
| 22928 | #endif |
| 22929 | |
| 22930 | return(test_ret); |
| 22931 | } |
| 22932 | |
| 22933 | |
| 22934 | static int |
no test coverage detected