bump product version to 4.1.6.2
[LibreOffice.git] / smoketest / libtest.cxx
blobf3d207fef39b60b0b6168eb5537a2126ff42348b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include <stdio.h>
11 #include <assert.h>
12 #include <liblibreoffice.hxx>
14 int main (int argc, char **argv)
16 if( argc < 2 )
17 return -1;
18 LibLibreOffice *pOffice = lo_init( argv[1] );
19 if( !pOffice )
20 return -1;
21 // This separate init is lame I think.
22 if( !pOffice->initialize( argv[1] ) )
24 fprintf( stderr, "failed to initialize\n" );
25 return -1;
27 fprintf( stderr, "start to load document '%s'\n", argv[2] );
28 LODocument *pDocument = pOffice->documentLoad( argv[2] );
29 if( !pDocument )
31 fprintf( stderr, "failed to load document '%s'\n", argv[2] );
32 return -1;
34 fprintf( stderr, "all tests passed." );
35 return 0;
38 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */