diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2016-01-28 18:31:03 -0500 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2016-03-20 21:59:39 +0200 |
commit | 8e824a59965906077f1d1c39c5afa73b9fc4d650 (patch) | |
tree | ecdb769a53ac3af4ca4555256312f3ef4d02582c /smoketest | |
parent | 3cbdfeeb2b1765d6399ae7656a7b9ff91290bb7b (diff) |
Restoring preinit
Change-Id: I65341c57d00308d246ec90deab8050b2c4bb3e61
(cherry picked from commit 62a2d525a7db09c7223a21907e1a0f4989398c15)
Diffstat (limited to 'smoketest')
-rw-r--r-- | smoketest/libtest.cxx | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/smoketest/libtest.cxx b/smoketest/libtest.cxx index ae87c796112a..60ee19e62357 100644 --- a/smoketest/libtest.cxx +++ b/smoketest/libtest.cxx @@ -83,7 +83,29 @@ int main (int argc, char **argv) return 1; // coverity[tainted_string] - build time test tool - Office *pOffice = lok_cpp_init( argv[1] ); + char *install_path = argv[1]; + + if( argc > 4 ) + { + fprintf( stderr, "testing preinit\n"); + char *imp_lib; + void *dlhandle; + dlhandle = lok_dlopen( install_path, &imp_lib ); + if( !dlhandle ) + { + fprintf( stderr, "Failed to link '%s'\n", lok_dlerror() ); + return -1; + } + LokHookPreInit *preinit = (LokHookPreInit *) lok_dlsym( dlhandle, "lok_preinit" ); + if( !preinit ) + { + fprintf( stderr, "Failed to find pre-init symbol: %s\n", lok_dlerror() ); + return -1; + } + preinit( install_path, NULL ); + } + + Office *pOffice = lok_cpp_init( install_path ); if( !pOffice ) { fprintf( stderr, "Failed to initialize\n" ); |