/src/libreoffice/vcl/workben/svmfuzzer.cxx
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
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/. |
8 | | */ |
9 | | |
10 | | #include <tools/stream.hxx> |
11 | | #include "commonfuzzer.hxx" |
12 | | |
13 | | #include <config_features.h> |
14 | | #include <osl/detail/component-mapping.h> |
15 | | |
16 | | extern "C" bool TestImportSVM(SvStream &rStream); |
17 | | |
18 | | extern "C" { |
19 | | void com_sun_star_i18n_LocaleDataImpl_get_implementation( void ); |
20 | | void com_sun_star_i18n_BreakIterator_Unicode_get_implementation( void ); |
21 | | void com_sun_star_i18n_BreakIterator_get_implementation( void ); |
22 | | void com_sun_star_i18n_NativeNumberSupplier_get_implementation( void ); |
23 | | void com_sun_star_i18n_NumberFormatCodeMapper_get_implementation( void ); |
24 | | void com_sun_star_comp_rendering_CanvasFactory_get_implementation( void ); |
25 | | void com_sun_star_comp_rendering_Canvas_VCL_get_implementation( void ); |
26 | | void linguistic_ConvDicList_get_implementation( void ); |
27 | | void linguistic_DicList_get_implementation( void ); |
28 | | void linguistic_LinguProps_get_implementation( void ); |
29 | | void linguistic_LngSvcMgr_get_implementation( void ); |
30 | | void linguistic_GrammarCheckingIterator_get_implementation( void ); |
31 | | } |
32 | | |
33 | | const lib_to_factory_mapping * |
34 | | lo_get_factory_map(void) |
35 | 0 | { |
36 | 0 | static lib_to_factory_mapping map[] = { |
37 | 0 | { 0, 0 } |
38 | 0 | }; |
39 | |
|
40 | 0 | return map; |
41 | 0 | } |
42 | | |
43 | | const lib_to_constructor_mapping * |
44 | | lo_get_constructor_map(void) |
45 | 379k | { |
46 | 379k | static lib_to_constructor_mapping map[] = { |
47 | 379k | { "com_sun_star_i18n_LocaleDataImpl_get_implementation", com_sun_star_i18n_LocaleDataImpl_get_implementation }, |
48 | 379k | { "com_sun_star_i18n_BreakIterator_Unicode_get_implementation", com_sun_star_i18n_BreakIterator_Unicode_get_implementation }, |
49 | 379k | { "com_sun_star_i18n_BreakIterator_get_implementation", com_sun_star_i18n_BreakIterator_get_implementation }, |
50 | 379k | { "com_sun_star_i18n_NativeNumberSupplier_get_implementation", com_sun_star_i18n_NativeNumberSupplier_get_implementation }, |
51 | 379k | { "com_sun_star_i18n_NumberFormatCodeMapper_get_implementation", com_sun_star_i18n_NumberFormatCodeMapper_get_implementation }, |
52 | 379k | { "com_sun_star_comp_rendering_CanvasFactory_get_implementation", com_sun_star_comp_rendering_CanvasFactory_get_implementation }, |
53 | 379k | { "com_sun_star_comp_rendering_Canvas_VCL_get_implementation", com_sun_star_comp_rendering_Canvas_VCL_get_implementation }, |
54 | 379k | { "linguistic_ConvDicList_get_implementation", linguistic_ConvDicList_get_implementation }, |
55 | 379k | { "linguistic_DicList_get_implementation", linguistic_DicList_get_implementation }, |
56 | 379k | { "linguistic_LinguProps_get_implementation", linguistic_LinguProps_get_implementation }, |
57 | 379k | { "linguistic_LngSvcMgr_get_implementation", linguistic_LngSvcMgr_get_implementation }, |
58 | 379k | { "linguistic_GrammarCheckingIterator_get_implementation", linguistic_GrammarCheckingIterator_get_implementation }, |
59 | 379k | { 0, 0 } |
60 | 379k | }; |
61 | | |
62 | 379k | return map; |
63 | 379k | } |
64 | | |
65 | | extern "C" void* lo_get_custom_widget_func(const char*) |
66 | 0 | { |
67 | 0 | return nullptr; |
68 | 0 | } |
69 | | |
70 | | extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv) |
71 | 92 | { |
72 | 92 | TypicalFuzzerInitialize(argc, argv); |
73 | 92 | return 0; |
74 | 92 | } |
75 | | |
76 | | extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) |
77 | 440k | { |
78 | 440k | SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ); |
79 | 440k | (void)TestImportSVM(aStream); |
80 | 440k | return 0; |
81 | 440k | } |
82 | | |
83 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |