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


Hello everyone,

As I am currently between assignments (I work for a consulting firm), my
employer has graciously allowed me to
improve on my skills using open source software, and submit anything I do.
So for starters I'm looking into
the unit tests, because that's an area of expertise I've neglected for far
too long. I don't know for how long I can do
this or how many patches will follow, but hopefully I'll be able to do some
useful things. Contributing to a piece
of software that I use often (professionally as well as personally) feels
like a good thing to do, anyhow.

Please let me know if the patch is okay like this, because I'm new to this
whole git thing. It already ate
all my patches earlier today.

This patch contributed under dual LPGLv3/MPL license, as requested.

Kind regards,
 Theo van Klaveren
From d382c944c6f7566c33cf00495d577410a898f66a Mon Sep 17 00:00:00 2001
From: Theo van Klaveren <theo.van.klaveren@gmail.com>
Date: Thu, 10 Mar 2011 11:34:40 +0100
Subject: [PATCH] Make the qa/sal unit test build, and use it.

---
 sal/prj/build.lst         |    1 +
 sal/qa/sal/makefile.mk    |    8 ++------
 sal/qa/sal/test_types.cxx |    9 ++++++---
 sal/qa/sal/version.map    |   34 ----------------------------------
 4 files changed, 9 insertions(+), 43 deletions(-)
 delete mode 100644 sal/qa/sal/version.map

diff --git a/sal/prj/build.lst b/sal/prj/build.lst
index ddbc446..dea5c31 100644
--- a/sal/prj/build.lst
+++ b/sal/prj/build.lst
@@ -26,3 +26,4 @@ sa sal\qa\osl\process nmake - all sa_qa_osl_process sa_cppunittester sa_util NUL
 sa sal\qa\rtl\strings nmake - all sa_qa_rt_strings sa_cppunittester sa_util NULL
 sa sal\qa\rtl\oustringbuffer nmake - all sa_qa_rt_oustringbuffer sa_cppunittester sa_util NULL
 sa sal\qa\rtl\alloc nmake - all sa_qa_rt_alloc sa_cppunittester sa_util NULL
+sa sal\qa\sal nmake - all sa_qa_sal sa_cppunittester sa_util NULL
diff --git a/sal/qa/sal/makefile.mk b/sal/qa/sal/makefile.mk
index 954d339..e5ccce3 100644
--- a/sal/qa/sal/makefile.mk
+++ b/sal/qa/sal/makefile.mk
@@ -36,15 +36,11 @@ ENABLE_EXCEPTIONS := TRUE
 SHL1TARGET = $(TARGET)_types
 SHL1OBJS = $(SLO)$/test_types.obj
 SHL1STDLIBS = $(SALLIB) $(CPPUNITLIB)
-SHL1VERSIONMAP = version.map
+SHL1VERSIONMAP = $(PRJ)$/qa$/export.map
 SHL1IMPLIB = i$(SHL1TARGET)
 DEF1NAME = $(SHL1TARGET)
 
 SLOFILES = $(SHL1OBJS)
 
 .INCLUDE: target.mk
-
-ALLTAR: test
-
-test .PHONY: $(SHL1TARGETN)
-    testshl2 $(SHL1TARGETN)
+.INCLUDE: $(PRJ)$/qa$/cppunit_local.mk
diff --git a/sal/qa/sal/test_types.cxx b/sal/qa/sal/test_types.cxx
index 3b6c85c..03d30a1 100644
--- a/sal/qa/sal/test_types.cxx
+++ b/sal/qa/sal/test_types.cxx
@@ -33,7 +33,10 @@
 #include <stdio.h> // C99 snprintf not necessarily in <cstdio>
 #include <string.h> // wntmsci10 does not know <cstring> std::strcmp
 
-#include "testshl/simpleheader.hxx"
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/plugin/TestPlugIn.h>
+
 #include "sal/types.h"
 
 namespace {
@@ -75,10 +78,10 @@ void Test::test() {
     testPrintf("ABC", "%" SAL_PRIXUINTPTR, static_cast< sal_uIntPtr >(0xabc));
 }
 
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(Test, "alltests");
+CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 }
 
-NOADDITIONAL;
+CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/qa/sal/version.map b/sal/qa/sal/version.map
deleted file mode 100644
index f313c44..0000000
--- a/sal/qa/sal/version.map
+++ /dev/null
@@ -1,34 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-# 
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org.  If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-UDK_3_0_0 {
-    global:
-        registerAllTestFunction;
-
-    local:
-        *;
-};
-- 
1.7.4.1


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.