foxBMS - Unit Tests  1.6.0
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 <stdbool.h>
#include <stdint.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
2023-10-12 (date of last update)
Version
v1.6.0
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 114 of file test_mxm_registry.c.

◆ setUp()

void setUp ( void  )

Definition at line 122 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ tearDown()

void tearDown ( void  )

Definition at line 127 of file test_mxm_registry.c.

◆ testHighest5X()

void testHighest5X ( void  )

Definition at line 186 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 338 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 362 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 356 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_MonRegistryConnectDevicesNullPointer()

void testMXM_MonRegistryConnectDevicesNullPointer ( void  )

Definition at line 165 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_MonRegistryGetHighestConnected5XDeviceNullPointer()

void testMXM_MonRegistryGetHighestConnected5XDeviceNullPointer ( void  )

Definition at line 182 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_MonRegistryInitNullPointer()

void testMXM_MonRegistryInitNullPointer ( void  )

Definition at line 161 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_MonRegistryParseIdIntoDevicesCheckAscendingBufferId1()

void testMXM_MonRegistryParseIdIntoDevicesCheckAscendingBufferId1 ( void  )

Definition at line 206 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_MonRegistryParseIdIntoDevicesCheckAscendingBufferId2()

void testMXM_MonRegistryParseIdIntoDevicesCheckAscendingBufferId2 ( void  )

Definition at line 228 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_MonRegistryParseIdIntoDevicesInvalidRegister()

void testMXM_MonRegistryParseIdIntoDevicesInvalidRegister ( void  )

Definition at line 196 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_MonRegistryParseIdIntoDevicesNullPointer()

void testMXM_MonRegistryParseIdIntoDevicesNullPointer ( void  )

Definition at line 192 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_MonRegistryParseIdIntoDevicesValidRegister()

void testMXM_MonRegistryParseIdIntoDevicesValidRegister ( void  )

Definition at line 201 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_MonRegistryParseIdIntoDevicesWrongBufferLengthId1()

void testMXM_MonRegistryParseIdIntoDevicesWrongBufferLengthId1 ( void  )

Definition at line 219 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_MonRegistryParseIdIntoDevicesWrongBufferLengthId2()

void testMXM_MonRegistryParseIdIntoDevicesWrongBufferLengthId2 ( void  )

Definition at line 241 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_MonRegistryParseStatusFmeaIntoDevicesCheckAscendingBuffer()

void testMXM_MonRegistryParseStatusFmeaIntoDevicesCheckAscendingBuffer ( void  )

Definition at line 285 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 281 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_MonRegistryParseStatusFmeaIntoDevicesWrongBufferLength()

void testMXM_MonRegistryParseStatusFmeaIntoDevicesWrongBufferLength ( void  )

Definition at line 329 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 254 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_MonRegistryParseVersionIntoDevicesNullPointer()

void testMXM_MonRegistryParseVersionIntoDevicesNullPointer ( void  )

Definition at line 250 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testMXM_MonRegistryParseVersionIntoDevicesWrongBufferLength()

void testMXM_MonRegistryParseVersionIntoDevicesWrongBufferLength ( void  )

Definition at line 272 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testRegistryConnectDevices()

void testRegistryConnectDevices ( void  )

Definition at line 169 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testRegistryConnectDevicesInvalidNumber()

void testRegistryConnectDevicesInvalidNumber ( void  )

Definition at line 178 of file test_mxm_registry.c.

Here is the call graph for this function:

◆ testRegistryInitiated()

void testRegistryInitiated ( void  )

Definition at line 131 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 79 of file test_mxm_registry.c.