Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac515334 authored by Qasim Javed's avatar Qasim Javed Committed by Gerrit Code Review
Browse files

Merge "Separate out fake timer."

parents 4a691142 107f632a
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -229,10 +229,11 @@ cc_library {
        "libbluetooth_gd_defaults",
    ],
    srcs: [
        ":BluetoothOsSources_fuzz",
        ":BluetoothOsSources_fake_timer",
    ],
    cflags: [
        "-DFUZZ_TARGET",
        "-DUSE_FAKE_TIMERS",
    ],
}

@@ -490,6 +491,7 @@ cc_defaults {
    ],
    cflags: [
        "-DFUZZ_TARGET",
        "-DUSE_FAKE_TIMERS",
    ],
    target: {
        android: {
+4 −4
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
#include "hci/fuzz/fuzz_hci_layer.h"
#include "hci/hci_layer.h"
#include "module.h"
#include "os/fuzz/fake_timerfd.h"
#include "os/fake_timer/fake_timerfd.h"
#include "os/log.h"

#include <fuzzer/FuzzedDataProvider.h>
@@ -31,9 +31,9 @@ using bluetooth::fuzz::GetArbitraryBytes;
using bluetooth::hci::AclManager;
using bluetooth::hci::HciLayer;
using bluetooth::hci::fuzz::FuzzHciLayer;
using bluetooth::os::fuzz::fake_timerfd_advance;
using bluetooth::os::fuzz::fake_timerfd_cap_at;
using bluetooth::os::fuzz::fake_timerfd_reset;
using bluetooth::os::fake_timer::fake_timerfd_advance;
using bluetooth::os::fake_timer::fake_timerfd_cap_at;
using bluetooth::os::fake_timer::fake_timerfd_reset;

extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
  FuzzedDataProvider dataProvider(data, size);
+4 −4
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
#include "hci/fuzz/hci_layer_fuzz_client.h"
#include "hci/hci_layer.h"
#include "module.h"
#include "os/fuzz/fake_timerfd.h"
#include "os/fake_timer/fake_timerfd.h"
#include "os/log.h"

#include <fuzzer/FuzzedDataProvider.h>
@@ -31,9 +31,9 @@ using bluetooth::fuzz::GetArbitraryBytes;
using bluetooth::hal::HciHal;
using bluetooth::hal::fuzz::FuzzHciHal;
using bluetooth::hci::fuzz::HciLayerFuzzClient;
using bluetooth::os::fuzz::fake_timerfd_advance;
using bluetooth::os::fuzz::fake_timerfd_cap_at;
using bluetooth::os::fuzz::fake_timerfd_reset;
using bluetooth::os::fake_timer::fake_timerfd_advance;
using bluetooth::os::fake_timer::fake_timerfd_cap_at;
using bluetooth::os::fake_timer::fake_timerfd_reset;

extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
  FuzzedDataProvider dataProvider(data, size);
+2 −2
Original line number Diff line number Diff line
@@ -93,8 +93,8 @@ name: "BluetoothOsBenchmarkSources",
}

filegroup {
    name: "BluetoothOsSources_fuzz",
    name: "BluetoothOsSources_fake_timer",
    srcs: [
        "fuzz/fake_timerfd.cc",
        "fake_timer/fake_timerfd.cc",
    ],
}
+3 −3
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
 * limitations under the License.
 */

#include "os/fuzz/fake_timerfd.h"
#include "os/fake_timer/fake_timerfd.h"

#include <sys/eventfd.h>
#include <unistd.h>
@@ -23,7 +23,7 @@

namespace bluetooth {
namespace os {
namespace fuzz {
namespace fake_timer {

class FakeTimerFd {
 public:
@@ -134,6 +134,6 @@ void fake_timerfd_cap_at(uint64_t ms) {
  max_clock = ms;
}

}  // namespace fuzz
}  // namespace fake_timer
}  // namespace os
}  // namespace bluetooth
Loading