foxBMS - Unit Tests  1.2.1
The foxBMS Unit Tests API Documentation
test_mxm_registry.c File Reference

Test for the Maxim registry tool. More...

#include "unity.h"
#include "Mockfassert.h"
#include "Mockmxm_1785x.h"
#include "Mockmxm_basic_defines.h"
#include "foxmath.h"
#include "mxm_1785x_tools.h"
#include "mxm_registry.h"
#include "test_assert_helper.h"
Include dependency graph for test_mxm_registry.c:

Go to the source code of this file.

Functions

static void rxBufferFillAscending (MXM_MONITORING_INSTANCE_s *pState)
 
void setUp (void)
 
void tearDown (void)
 
void testRegistryInitiated (void)
 
void testMXM_MonRegistryInitNullPointer (void)
 
void testMXM_MonRegistryConnectDevicesNullPointer (void)
 
void testRegistryConnectDevices (void)
 
void testRegistryConnectDevicesInvalidNumber (void)
 
void testMXM_MonRegistryGetHighestConnected5XDeviceNullPointer (void)
 
void testHighest5X (void)
 
void testMXM_MonRegistryParseIdIntoDevicesNullPointer (void)
 
void testMXM_MonRegistryParseIdIntoDevicesInvalidRegister (void)
 
void testMXM_MonRegistryParseIdIntoDevicesValidRegister (void)
 
void testMXM_MonRegistryParseIdIntoDevicesCheckAscendingBufferId1 (void)
 
void testMXM_MonRegistryParseIdIntoDevicesWrongBufferLengthId1 (void)
 
void testMXM_MonRegistryParseIdIntoDevicesCheckAscendingBufferId2 (void)
 
void testMXM_MonRegistryParseIdIntoDevicesWrongBufferLengthId2 (void)
 
void testMXM_MonRegistryParseVersionIntoDevicesNullPointer (void)
 
void testMXM_MonRegistryParseVersionIntoDevicesCheckAscendingBuffer (void)
 
void testMXM_MonRegistryParseVersionIntoDevicesWrongBufferLength (void)
 
void testMXM_MonRegistryParseStatusFmeaIntoDevicesNullPointer (void)
 
void testMXM_MonRegistryParseStatusFmeaIntoDevicesCheckAscendingBuffer (void)
 
void testMXM_MonRegistryParseStatusFmeaIntoDevicesWrongBufferLength (void)
 
void testMXM_CheckIfADeviceHasBeenReset (void)
 
void testMXM_CheckIfADeviceIsConnectedinvalidValues (void)
 
void testMXM_CheckIfADeviceIsConnected (void)
 

Variables

static MXM_MONITORING_INSTANCE_s mxm_state
 

Detailed Description

Test for the Maxim registry tool.

SPDX-License-Identifier: BSD-3-Clause

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

We kindly request you to use one or more of the following phrases to refer to foxBMS in your hardware, software, documentation or advertising materials:

  • ″This product uses parts of foxBMS®″
  • ″This product includes parts of foxBMS®″
  • ″This product is derived from foxBMS®″
Author
foxBMS Team
Date
2020-07-16 (date of creation)
Updated
2021-12-06 (date of last update)
Prefix
MXM

def

Definition in file test_mxm_registry.c.

Function Documentation

◆ rxBufferFillAscending()

static void rxBufferFillAscending ( MXM_MONITORING_INSTANCE_s pState)
static

Definition at line 103 of file test_mxm_registry.c.

◆ setUp()

void setUp ( void  )

Definition at line 111 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ tearDown()

void tearDown ( void  )

Definition at line 116 of file test_mxm_registry.c.

◆ testHighest5X()

void testHighest5X ( void  )

Definition at line 175 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_CheckIfADeviceHasBeenReset()

void testMXM_CheckIfADeviceHasBeenReset ( void  )

check that MXM_CheckIfADeviceHasBeenReset() recognizes a set ALRTRST bit

Definition at line 327 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_CheckIfADeviceIsConnected()

void testMXM_CheckIfADeviceIsConnected ( void  )

check if MXM_CheckIfADeviceIsConnected() does its job

Definition at line 351 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_CheckIfADeviceIsConnectedinvalidValues()

void testMXM_CheckIfADeviceIsConnectedinvalidValues ( void  )

check that invalid values trip MXM_CheckIfADeviceIsConnected()

Definition at line 345 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_MonRegistryConnectDevicesNullPointer()

void testMXM_MonRegistryConnectDevicesNullPointer ( void  )

Definition at line 154 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_MonRegistryGetHighestConnected5XDeviceNullPointer()

void testMXM_MonRegistryGetHighestConnected5XDeviceNullPointer ( void  )

Definition at line 171 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_MonRegistryInitNullPointer()

void testMXM_MonRegistryInitNullPointer ( void  )

Definition at line 150 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_MonRegistryParseIdIntoDevicesCheckAscendingBufferId1()

void testMXM_MonRegistryParseIdIntoDevicesCheckAscendingBufferId1 ( void  )

Definition at line 195 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_MonRegistryParseIdIntoDevicesCheckAscendingBufferId2()

void testMXM_MonRegistryParseIdIntoDevicesCheckAscendingBufferId2 ( void  )

Definition at line 217 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_MonRegistryParseIdIntoDevicesInvalidRegister()

void testMXM_MonRegistryParseIdIntoDevicesInvalidRegister ( void  )

Definition at line 185 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_MonRegistryParseIdIntoDevicesNullPointer()

void testMXM_MonRegistryParseIdIntoDevicesNullPointer ( void  )

Definition at line 181 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_MonRegistryParseIdIntoDevicesValidRegister()

void testMXM_MonRegistryParseIdIntoDevicesValidRegister ( void  )

Definition at line 190 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_MonRegistryParseIdIntoDevicesWrongBufferLengthId1()

void testMXM_MonRegistryParseIdIntoDevicesWrongBufferLengthId1 ( void  )

Definition at line 208 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_MonRegistryParseIdIntoDevicesWrongBufferLengthId2()

void testMXM_MonRegistryParseIdIntoDevicesWrongBufferLengthId2 ( void  )

Definition at line 230 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_MonRegistryParseStatusFmeaIntoDevicesCheckAscendingBuffer()

void testMXM_MonRegistryParseStatusFmeaIntoDevicesCheckAscendingBuffer ( void  )

Definition at line 274 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_MonRegistryParseStatusFmeaIntoDevicesNullPointer()

void testMXM_MonRegistryParseStatusFmeaIntoDevicesNullPointer ( void  )

call MXM_MonRegistryParseStatusFmeaIntoDevices() with a null pointer

Definition at line 270 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_MonRegistryParseStatusFmeaIntoDevicesWrongBufferLength()

void testMXM_MonRegistryParseStatusFmeaIntoDevicesWrongBufferLength ( void  )

Definition at line 318 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_MonRegistryParseVersionIntoDevicesCheckAscendingBuffer()

void testMXM_MonRegistryParseVersionIntoDevicesCheckAscendingBuffer ( void  )

< invalid model ID

Definition at line 243 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_MonRegistryParseVersionIntoDevicesNullPointer()

void testMXM_MonRegistryParseVersionIntoDevicesNullPointer ( void  )

Definition at line 239 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_MonRegistryParseVersionIntoDevicesWrongBufferLength()

void testMXM_MonRegistryParseVersionIntoDevicesWrongBufferLength ( void  )

Definition at line 261 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testRegistryConnectDevices()

void testRegistryConnectDevices ( void  )

Definition at line 158 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testRegistryConnectDevicesInvalidNumber()

void testRegistryConnectDevicesInvalidNumber ( void  )

Definition at line 167 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testRegistryInitiated()

void testRegistryInitiated ( void  )

Definition at line 120 of file test_mxm_registry.c.

Here is the call graph for this function:

Variable Documentation

◆ mxm_state

MXM_MONITORING_INSTANCE_s mxm_state
static

Definition at line 68 of file test_mxm_registry.c.