1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #include <tools/stream.hxx>
11 #include <vcl/FilterConfigItem.hxx>
12 #include <com/sun/star/ucb/XContentProvider.hpp>
13 #include <com/sun/star/ucb/XUniversalContentBroker.hpp>
14 #include "commonfuzzer.hxx"
16 extern "C" void* ScCreateDialogFactory() { return nullptr; }
18 extern "C" bool TestImportWKS(SvStream
& rStream
);
20 extern "C" int LLVMFuzzerInitialize(int* argc
, char*** argv
)
25 CommonInitialize(argc
, argv
);
27 // initialise unconfigured UCB:
28 css::uno::Reference
<css::ucb::XUniversalContentBroker
> xUcb(
29 comphelper::getProcessServiceFactory()->createInstance(
30 "com.sun.star.ucb.UniversalContentBroker"),
31 css::uno::UNO_QUERY_THROW
);
32 css::uno::Sequence
<css::uno::Any
> aArgs
{ css::uno::Any(OUString("NoConfig")) };
33 css::uno::Reference
<css::ucb::XContentProvider
> xFileProvider(
34 comphelper::getProcessServiceFactory()->createInstanceWithArguments(
35 "com.sun.star.ucb.FileContentProvider", aArgs
),
36 css::uno::UNO_QUERY_THROW
);
37 xUcb
->registerContentProvider(xFileProvider
, "file", true);
45 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data
, size_t size
)
47 SvMemoryStream
aStream(const_cast<uint8_t*>(data
), size
, StreamMode::READ
);
48 (void)TestImportWKS(aStream
);
52 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */