summaryrefslogtreecommitdiff
path: root/smoketest
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2013-07-26 18:21:45 +0100
committerMichael Meeks <michael.meeks@suse.com>2013-07-26 18:22:19 +0100
commitd32b179c3f2b16bb96679816db485d62ce8fe87f (patch)
treecabdac33dbd07263bbce96ca27024bafce9b67f6 /smoketest
parent04646443b3ee3baef0c3bdbaefad0eb66b71d33a (diff)
more liblibreoffice pieces.
Change-Id: I21d67de281847321d784cddc652d4a51a437fadf
Diffstat (limited to 'smoketest')
-rw-r--r--smoketest/libtest.cxx23
1 files changed, 22 insertions, 1 deletions
diff --git a/smoketest/libtest.cxx b/smoketest/libtest.cxx
index f3d207fef39b..390774913f73 100644
--- a/smoketest/libtest.cxx
+++ b/smoketest/libtest.cxx
@@ -8,6 +8,7 @@
*/
#include <stdio.h>
+#include <malloc.h>
#include <assert.h>
#include <liblibreoffice.hxx>
@@ -28,10 +29,30 @@ int main (int argc, char **argv)
LODocument *pDocument = pOffice->documentLoad( argv[2] );
if( !pDocument )
{
- fprintf( stderr, "failed to load document '%s'\n", argv[2] );
+ char *pError = pOffice->getError();
+ fprintf( stderr, "failed to load document '%s': '%s'\n",
+ argv[2], pError );
+ free (pError);
return -1;
}
+
+ if( argc > 3 )
+ {
+ fprintf( stderr, "save document as '%s'\n", argv[3] );
+ if ( !pDocument->saveAs( argv[ 3 ] ) )
+ {
+ char *pError = pOffice->getError();
+ fprintf( stderr, "failed to save document '%s'\n", pError);
+ free (pError);
+ }
+ else
+ fprintf( stderr, "Save succeeded\n" );
+ }
fprintf( stderr, "all tests passed." );
+
+ delete pDocument;
+ delete pOffice;
+
return 0;
}