summaryrefslogtreecommitdiff
path: root/smoketest
diff options
context:
space:
mode:
authorJuergen Funk <juergen.funk_ml@cib.de>2014-11-14 10:56:40 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-11-18 17:18:37 +0000
commit725a52c55e91d3629dfbfb9ba4758048d8bf1a77 (patch)
tree86f1caddaeaa62d95a19b2b6093f3da809ad7507 /smoketest
parent0cda507b30fdbbc19b0d4b27fccbebf7829b4404 (diff)
Preparation of the LibreOfficeKit for Windows
- not yet included in the make for windows Change-Id: Iee31b0ed0c6545572295ce00a3bb0f909c428b5a Reviewed-on: https://gerrit.libreoffice.org/12425 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'smoketest')
-rw-r--r--smoketest/libtest.cxx58
1 files changed, 46 insertions, 12 deletions
diff --git a/smoketest/libtest.cxx b/smoketest/libtest.cxx
index 14df8825dc70..ae87c796112a 100644
--- a/smoketest/libtest.cxx
+++ b/smoketest/libtest.cxx
@@ -12,19 +12,55 @@
#include <malloc.h>
#include <assert.h>
#include <math.h>
-#include <sys/time.h>
-#include <sal/types.h>
+
#include <LibreOfficeKit/LibreOfficeKitInit.h>
#include <LibreOfficeKit/LibreOfficeKit.hxx>
+
+
+#ifdef _WIN32
+//#include <Windows.h> // come from LibreOfficeKitInit.h
+ long getTimeMS()
+ {
+ return GetTickCount();
+ }
+
+ bool IsAbsolutePath(char *pPath)
+ {
+ if (pPath[1] != ':')
+ {
+ fprintf( stderr, "Absolute path required to libreoffice install\n" );
+ return false;
+ }
+
+ return true;
+ }
+
+#else
+#include <sys/time.h>
+#include <sal/types.h>
+ long getTimeMS()
+ {
+ struct timeval t;
+ gettimeofday(&t, NULL);
+ return t.tv_sec*1000 + t.tv_usec/1000;
+ }
+
+ bool IsAbsolutePath(char *pPath)
+ {
+ if (pPath[0] != '/')
+ {
+ fprintf( stderr, "Absolute path required to libreoffice install\n" );
+ return false;
+ }
+
+ return true;
+ }
+#endif
+
+
using namespace ::lok;
-long getTimeMS()
-{
- struct timeval t;
- gettimeofday(&t, NULL);
- return t.tv_sec*1000 + t.tv_usec/1000;
-}
static int help()
{
@@ -42,11 +78,9 @@ int main (int argc, char **argv)
( argc > 1 && ( !strcmp( argv[1], "--help" ) || !strcmp( argv[1], "-h" ) ) ) )
return help();
- if (argv[1][0] != '/')
- {
- fprintf( stderr, "Absolute path required to libreoffice install\n" );
+
+ if( !IsAbsolutePath(argv[1]) )
return 1;
- }
// coverity[tainted_string] - build time test tool
Office *pOffice = lok_cpp_init( argv[1] );