Date: prev next · Thread: first prev next last
2016 Archives by date, by thread · List index


On 01/19/2016 03:13 PM, Giuseppe Castagno wrote:
Hi all,

I'm trying to add unit tests to webdav, for the time being limited to
member function that are used internally, that is that don't need a
server to interact with.

Member functions in library ucpdav1 are not exported (so I gather...).

Is the following method allowed to make externally visible member
function that I intend to test? Any downside?

Limited to webdav_ucp::NeonUri as the first to be checked:

diff --git a/ucb/source/ucp/webdav-neon/NeonUri.hxx
b/ucb/source/ucp/webdav-neon/NeonUri.hxx
index cd9fbe9..c5cea8c 100644
--- a/ucb/source/ucp/webdav-neon/NeonUri.hxx
+++ b/ucb/source/ucp/webdav-neon/NeonUri.hxx
@@ -41,7 +41,8 @@ namespace webdav_ucp
  #define DEFAULT_FTP_PORT        21

  // A URI implementation for use with the neon/expat library
-class NeonUri
+// Added SAL_DLLPUBLIC_EXPORT to implement cppunit test
+class SAL_DLLPUBLIC_EXPORT NeonUri

There's two approaches to this ugly problem. One is as above, with the downside of increasing the number of global symbols. The other is to link a Library's objects directly into a CppunitTest library via gb_CppunitTest_use_library_objects. The downside there is that you need typically duplicate all the Library_*.mk's gb_Library_set/use/whatever... calls as gb_CppunitTest_... calls in the CppunitTest_*.mk.

Both approaches suck. When possible, try to stick with the second one, though.


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.