Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/tools/fuzzing/registry/FuzzerRegistry.cpp
Line
Count
Source
1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2
 * * This Source Code Form is subject to the terms of the Mozilla Public
3
 * * License, v. 2.0. If a copy of the MPL was not distributed with this
4
 * * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6
#include "FuzzerRegistry.h"
7
8
namespace mozilla {
9
10
24
FuzzerRegistry& FuzzerRegistry::getInstance() {
11
24
    static FuzzerRegistry instance;
12
24
    return instance;
13
24
}
14
15
21
void FuzzerRegistry::registerModule(std::string moduleName, FuzzerInitFunc initFunc, FuzzerTestingFunc testingFunc) {
16
21
    moduleMap.insert(std::pair<std::string, FuzzerFunctions>(moduleName,FuzzerFunctions(initFunc, testingFunc)));
17
21
}
18
19
3
FuzzerFunctions FuzzerRegistry::getModuleFunctions(std::string& moduleName) {
20
3
    return moduleMap[moduleName];
21
3
}
22
23
} // namespace mozilla