Add blackbox test for provisioning code to make sure it can be run more than once...
[samba.git] / source / torture / smbiconv.c
index 8e68d252d6e289c963550a29fcab93e7eff0b9b7..4eece66bdf6b8b63b9c71fa99bf853ca624f962d 100644 (file)
@@ -8,7 +8,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
@@ -17,8 +17,7 @@
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "includes.h"
@@ -183,7 +182,7 @@ int main(int argc, char *argv[])
                { "to-code", 't', POPT_ARG_STRING, &to, 0, "Encoding for output" },
                { "output", 'o', POPT_ARG_STRING, &output, 0, "Write output to this file" },
                { "preload-modules", 'p', POPT_ARG_STRING, &preload_modules[0], 0, "Modules to load" },
-               POPT_TABLEEND
+               { NULL }
        };
 
        setlinebuf(stdout);
@@ -195,10 +194,6 @@ int main(int argc, char *argv[])
        
        while(poptGetNextOpt(pc) != -1);
 
-       /* the following functions are part of the Samba debugging
-          facilities.  See lib/debug.c */
-       setup_logging("smbiconv", True);
-
        if (preload_modules[0]) smb_load_modules(preload_modules);
 
        if(output) {
@@ -210,7 +205,7 @@ int main(int argc, char *argv[])
                }
        }
 
-       cd = smb_iconv_open(to, from);
+       cd = smb_iconv_open_ex(tctx, to, from, lp_parm_bool(tctx->lp_ctx, NULL, "iconv", "native", true));
        if((int)cd == -1) {
                DEBUG(0,("unable to find from or to encoding, exiting...\n"));
                return 1;