summaryrefslogtreecommitdiff
path: root/libreofficekit
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2018-09-27 18:08:07 +0200
committerTor Lillqvist <tml@collabora.com>2018-09-28 14:03:05 +0200
commit68de1021353902d48ddd712f5e6fedc51c57936d (patch)
tree6184dffa89c40bff91feb3944b88ec47da7c85a1 /libreofficekit
parent7f7e890a10a710db57739cc1a6e0abfe7ae83530 (diff)
Start on the iOS unit test app
Change-Id: Idef0b375d5c7d6d4542aee1f8abecaf9f834189c Reviewed-on: https://gerrit.libreoffice.org/61058 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'libreofficekit')
-rw-r--r--libreofficekit/qa/tilebench/tilebench.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/libreofficekit/qa/tilebench/tilebench.cxx b/libreofficekit/qa/tilebench/tilebench.cxx
index 60a856212c5d..d4148dfaa797 100644
--- a/libreofficekit/qa/tilebench/tilebench.cxx
+++ b/libreofficekit/qa/tilebench/tilebench.cxx
@@ -286,12 +286,13 @@ static void testDialog( Document *pDocument, const char *uno_cmd )
int main( int argc, char* argv[] )
{
- int arg;
+ int arg = 2;
+ origin = getTimeNow();
+#ifndef IOS
// avoid X oddness etc.
unsetenv("DISPLAY");
- origin = getTimeNow();
if( argc < 4 ||
( argc > 1 && ( !strcmp( argv[1], "--help" ) || !strcmp( argv[1], "-h" ) ) ) )
return help();
@@ -302,7 +303,6 @@ int main( int argc, char* argv[] )
return 1;
}
- arg = 2;
const char *doc_url = argv[arg++];
const char *mode = argv[arg++];
@@ -325,10 +325,18 @@ int main( int argc, char* argv[] )
lok_preinit(argv[1], user_url.c_str());
aTimes.emplace_back();
}
+ const char *install_path = argv[1];
+ const char *user_profile = user_url.c_str();
+#else
+ const char *install_path = nullptr;
+ const char *user_profile = nullptr;
+ const char *doc_url = strdup([[[[[NSBundle mainBundle] bundleURL] absoluteString] stringByAppendingString:@"/test.odt"] UTF8String]);
+ const char *mode = "--tile";
+#endif
aTimes.emplace_back("initialization");
// coverity[tainted_string] - build time test tool
- Office *pOffice = lok_cpp_init(argv[1], user_url.c_str());
+ Office *pOffice = lok_cpp_init(install_path, user_profile);
if (pOffice == nullptr)
{
fprintf(stderr, "Failed to initialize Office from %s\n", argv[1]);