feat (driver)!: Added mocking for i2c.h

BREAKING CHANGE: removed ringbuf.h from public i2c.h
This commit is contained in:
Jakob Hasse
2021-10-22 10:35:46 +08:00
parent 13ab2cd9f9
commit 1eb96cfc79
13 changed files with 173 additions and 28 deletions

View File

@@ -1,16 +1,8 @@
// Copyright 2020 Espressif Systems (Shanghai) PTE LTD
//
// Licensed 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
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
* SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "unity.h"
#include "unity_cxx.hpp"
@@ -59,16 +51,6 @@ struct MasterFixture {
vector<uint8_t> data;
};
TEST_CASE("I2CMaster GPIO out of range", "[cxx i2c][leaks=300]")
{
TEST_THROW(I2CMaster(0, 255, 255, 400000), I2CException);
}
TEST_CASE("I2CMaster SDA and SCL equal", "[cxx i2c][leaks=300]")
{
TEST_THROW(I2CMaster(0, 0, 0, 400000), I2CException);
}
TEST_CASE("I2Transfer timeout", "[cxx i2c][leaks=300]")
{
std::vector<uint8_t> data = {MAGIC_TEST_NUMBER};