Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
d3c70e68
Kaydet (Commit)
d3c70e68
authored
Eyl 23, 2013
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
writerfilter: remove dead doctok unit test
Change-Id: I4d223611df92a7e348dc31e38bd45849fe0eb028
üst
f236dd29
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
0 additions
and
311 deletions
+0
-311
CppunitTest_writerfilter_doctok.mk
writerfilter/CppunitTest_writerfilter_doctok.mk
+0
-44
Module_writerfilter.mk
writerfilter/Module_writerfilter.mk
+0
-2
doctok.job
writerfilter/qa/cppunittests/doctok/doctok.job
+0
-2
export.map
writerfilter/qa/cppunittests/doctok/export.map
+0
-25
testdoctok.cxx
writerfilter/qa/cppunittests/doctok/testdoctok.cxx
+0
-238
No files found.
writerfilter/CppunitTest_writerfilter_doctok.mk
deleted
100644 → 0
Dosyayı görüntüle @
f236dd29
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This file incorporates work covered by the following license notice:
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed
# with this work for additional information regarding copyright
# ownership. The ASF licenses this file to you under the Apache
# License, Version 2.0 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
$(eval $(call gb_CppunitTest_CppunitTest,writerfilter_doctok))
$(eval $(call gb_CppunitTest_use_external,writerfilter_doctok,boost_headers))
$(eval $(call gb_CppunitTest_add_exception_objects,writerfilter_doctok, \
writerfilter/qa/cppunittests/doctok/testdoctok \
))
$(eval $(call gb_CppunitTest_use_libraries,writerfilter_doctok, \
cppu \
cppuhelper \
sal \
writerfilter \
$(gb_UWINAPI) \
))
$(eval $(call gb_CppunitTest_set_include,writerfilter_doctok,\
$$(INCLUDE) \
-I$(SRCDIR)/writerfilter/inc \
))
$(eval $(call gb_CppunitTest_use_sdk_api,writerfilter_doctok))
$(eval $(call gb_CppunitTest_use_udk_api,writerfilter_doctok))
# vim: set noet sw=4 ts=4:
writerfilter/Module_writerfilter.mk
Dosyayı görüntüle @
d3c70e68
...
@@ -18,6 +18,4 @@ $(eval $(call gb_Module_add_slowcheck_targets,writerfilter,\
...
@@ -18,6 +18,4 @@ $(eval $(call gb_Module_add_slowcheck_targets,writerfilter,\
CppunitTest_writerfilter_rtftok \
CppunitTest_writerfilter_rtftok \
))
))
# CppunitTest_writerfilter_doctok \
# vim: set noet sw=4 ts=4:
# vim: set noet sw=4 ts=4:
writerfilter/qa/cppunittests/doctok/doctok.job
deleted
100644 → 0
Dosyayı görüntüle @
f236dd29
doctok.test.openFile
\ No newline at end of file
writerfilter/qa/cppunittests/doctok/export.map
deleted
100644 → 0
Dosyayı görüntüle @
f236dd29
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This file incorporates work covered by the following license notice:
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed
# with this work for additional information regarding copyright
# ownership. The ASF licenses this file to you under the Apache
# License, Version 2.0 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
UDK_3_0_0 {
global:
registerAllTestFunction;
local:
*;
};
writerfilter/qa/cppunittests/doctok/testdoctok.cxx
deleted
100644 → 0
Dosyayı görüntüle @
f236dd29
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sal/config.h>
#include <osl/process.h>
#include <ucbhelper/contentbroker.hxx>
#include <ucbhelper/std_inputstream.hxx>
#include <cppuhelper/bootstrap.hxx>
#include "cppunit/TestAssert.h"
#include "cppunit/TestFixture.h"
#include "cppunit/extensions/HelperMacros.h"
#include "cppunit/plugin/TestPlugIn.h"
#include <com/sun/star/ucb/SimpleFileAccess.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/container/XNameContainer.hpp>
#include <resourcemodel/exceptions.hxx>
#include <doctok/WW8Document.hxx>
#include <resourcemodel/WW8ResourceModel.hxx>
#include <iostream>
namespace
testdoctok
{
using
namespace
::
std
;
using
namespace
::
writerfilter
::
doctok
;
using
namespace
::
com
::
sun
::
star
;
uno
::
Reference
<
io
::
XInputStream
>
xStream
;
uno
::
Reference
<
uno
::
XComponentContext
>
xContext
;
WW8Document
::
Pointer_t
pDocument
;
uno
::
Reference
<
::
com
::
sun
::
star
::
ucb
::
XSimpleFileAccess3
>
xSimpleFileAccess
;
class
test
:
public
CppUnit
::
TestFixture
{
public
:
// initialise your test code values here.
void
setUp
()
{
}
void
tearDown
()
{
}
void
testInitUno
()
{
bool
bResult
=
false
;
// initialise UCB-Broker
uno
::
Reference
<
uno
::
XComponentContext
>
xComponentContext
(
::
cppu
::
defaultBootstrap_InitialComponentContext
());
OSL_ASSERT
(
xComponentContext
.
is
()
);
xContext
=
xComponentContext
;
uno
::
Reference
<
lang
::
XMultiComponentFactory
>
xFactory
(
xComponentContext
->
getServiceManager
()
);
OSL_ASSERT
(
xFactory
.
is
());
uno
::
Sequence
<
uno
::
Any
>
aUcbInitSequence
(
2
);
aUcbInitSequence
[
0
]
<<=
OUString
(
"Local"
);
aUcbInitSequence
[
1
]
<<=
OUString
(
"Office"
);
uno
::
Reference
<
lang
::
XMultiServiceFactory
>
xServiceFactory
(
xFactory
,
uno
::
UNO_QUERY
);
OSL_ASSERT
(
xServiceFactory
.
is
()
);
if
(
xServiceFactory
.
is
())
{
sal_Bool
bRet
=
::
ucb
::
ContentBroker
::
initialize
(
xServiceFactory
,
aUcbInitSequence
);
OSL_ASSERT
(
bRet
);
if
(
bRet
)
{
xSimpleFileAccess
=
ucb
::
SimpleFileAccess
::
create
(
xComponentContext
);
bResult
=
true
;
}
}
CPPUNIT_ASSERT_MESSAGE
(
"UNO initialization failed"
,
bResult
);
}
// insert your test code here.
void
testOpenFile
()
{
try
{
rtl_uString
*
dir
=
NULL
;
osl_getProcessWorkingDir
(
&
dir
);
rtl_uString
*
fname
=
NULL
;
//rtl_uString_newFromAscii(&fname, "/OpenDocument-v1.doc");
rtl_uString_newFromAscii
(
&
fname
,
"/test.doc"
);
//rtl_uString_newFromAscii(&fname, "/numbers.doc");
rtl_uString
*
absfile
=
NULL
;
rtl_uString_newConcat
(
&
absfile
,
dir
,
fname
);
OUString
sInputFileURL
(
absfile
);
for
(
sal_uInt32
n
=
0
;
n
<
sInputFileURL
.
getLength
();
++
n
)
{
sal_uChar
nC
=
sInputFileURL
[
n
];
if
(
nC
<
0xff
&&
isprint
(
nC
))
clog
<<
static_cast
<
char
>
(
nC
);
else
clog
<<
"."
;
}
clog
<<
endl
;
xStream
=
xSimpleFileAccess
->
openFileRead
(
sInputFileURL
);
WW8Stream
::
Pointer_t
pStream
=
WW8DocumentFactory
::
createStream
(
xContext
,
xStream
);
pDocument
=
WW8DocumentFactory
::
createDocument
(
pStream
);
}
catch
(
writerfilter
::
Exception
e
)
{
clog
<<
"Exception!!"
<<
endl
;
}
CPPUNIT_ASSERT_MESSAGE
(
"creating document failed"
,
pDocument
!=
NULL
);
#if 1
}
void
testTraversal
()
{
#endif
sal_uInt32
nResult
=
0
;
try
{
WW8DocumentIterator
::
Pointer_t
pIt
=
pDocument
->
begin
();
WW8DocumentIterator
::
Pointer_t
pItEnd
=
pDocument
->
end
();
while
(
!
pIt
->
equal
(
*
pItEnd
))
{
pIt
->
dump
(
clog
);
clog
<<
endl
;
WW8PropertySet
::
Pointer_t
pAttrs
=
pIt
->
getProperties
();
if
(
pAttrs
!=
NULL
)
{
pAttrs
->
dump
(
clog
);
}
pIt
->
getText
().
dump
(
clog
);
++
(
*
pIt
);
++
nResult
;
}
}
catch
(
writerfilter
::
Exception
e
)
{
clog
<<
"Exception!!"
<<
endl
;
}
char
sBuffer
[
256
];
snprintf
(
sBuffer
,
255
,
"%d"
,
nResult
);
clog
<<
"Iterator steps:"
<<
sBuffer
<<
endl
;
CPPUNIT_ASSERT_MESSAGE
(
"traversing document failed"
,
nResult
>
0
);
}
void
testEvents
()
{
try
{
Stream
::
Pointer_t
pStream
=
doctok
::
createStreamHandler
();
pDocument
->
resolve
(
*
pStream
);
}
catch
(
writerfilter
::
Exception
e
)
{
clog
<<
"Exception!!"
<<
endl
;
}
}
void
testEnd
()
{
::
ucb
::
ContentBroker
::
deinitialize
();
}
// Change the following lines only, if you add, remove or rename
// member functions of the current class,
// because these macros are need by auto register mechanism.
CPPUNIT_TEST_SUITE
(
test
);
CPPUNIT_TEST
(
testInitUno
);
CPPUNIT_TEST
(
testOpenFile
);
//CPPUNIT_TEST(testTraversal);
CPPUNIT_TEST
(
testEvents
);
CPPUNIT_TEST
(
testEnd
);
CPPUNIT_TEST_SUITE_END
();
};
// class test
// -----------------------------------------------------------------------------
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION
(
testdoctok
::
test
,
"doctok"
);
}
// namespace doctok
// -----------------------------------------------------------------------------
// this macro creates an empty function, which will called by the RegisterAllFunctions()
// to let the user the possibility to also register some functions by hand.
NOADDITIONAL
;
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment