foxBMS - Unit Tests  1.3.0
The foxBMS Unit Tests API Documentation
test_mxm_1785x_tools.c File Reference

Test for the Maxim 1785x driver tools. More...

#include "unity.h"
#include "Mockfassert.h"
#include "Mockmxm_cfg.h"
#include "mxm_1785x_tools.h"
#include "test_assert_helper.h"
Include dependency graph for test_mxm_1785x_tools.c:

Go to the source code of this file.

Functions

void setUp (void)
 
void tearDown (void)
 
void testMXM_ExtractValueFromRegisterTest (void)
 
void testMXM_ExtractValueFromRegisterADCValue (void)
 
void testMXM_ExtractValueFromRegisterLsbBitSet (void)
 
void testMXM_ExtractValueFromRegisterLsbBitUnset (void)
 
void testMXM_ExtractValueFromRegisterLsbCompletelySet (void)
 
void testMXM_ExtractValueFromRegisterMsbCompletelySet (void)
 
void testMXM_ExtractValueFromRegisterMsbBitSet (void)
 
void testMXM_ExtractValueFromRegisterMsbBitSetFullBytes (void)
 
void testMXM_ExtractValueFromRegisterMsbBitUnset (void)
 
void testMXM_ConvertInvalidConversionType (void)
 
void testMXM_ConvertFullScale (void)
 
void testMXM_ConvertLowScale (void)
 
void testMXM_ConvertHalfScale (void)
 
void testMXM_ConvertSelfCheck (void)
 
void testMXM_FirstSetBitTest (void)
 
void testMXM_Unipolar14BitInto16BitWithInput0 (void)
 
void testMXM_Unipolar14BitInto16BitWithInput3FFF (void)
 
void testMXM_VoltageIntoUnipolar14Bit (void)
 
void testScaleAndConvert2500 (void)
 
void testScaleAndConvert500 (void)
 
void testConversionExtractAndInsertRoundTripFullScale (void)
 
void testConversionExtractAndInsertRoundTripNull (void)
 
void testConversionExtractAndInsertRoundTripSomeValue (void)
 
void testMXM_ConvertModuleToStringNullPointer (void)
 
void testMXM_ConvertModuleToStringTooManyForMaxim (void)
 
void testMXM_ConvertModuleToStringTooManyForSystem (void)
 
void testMXM_ConvertModuleToStringFirstInFirstString (void)
 
void testMXM_ConvertModuleToStringFirstInSecondString (void)
 
void testMXM_ConvertModuleToStringSecondInFirstString (void)
 
void testMXM_ConvertModuleToStringSecondInSecondString (void)
 

Detailed Description

Test for the Maxim 1785x driver tools.

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-15 (date of creation)
Updated
2022-05-30 (date of last update)
Version
v1.3.0
Prefix
MXM

def

Definition in file test_mxm_1785x_tools.c.

Function Documentation

◆ setUp()

void setUp ( void  )

Definition at line 68 of file test_mxm_1785x_tools.c.

◆ tearDown()

void tearDown ( void  )

Definition at line 71 of file test_mxm_1785x_tools.c.

◆ testConversionExtractAndInsertRoundTripFullScale()

void testConversionExtractAndInsertRoundTripFullScale ( void  )

Definition at line 255 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testConversionExtractAndInsertRoundTripNull()

void testConversionExtractAndInsertRoundTripNull ( void  )

Definition at line 270 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testConversionExtractAndInsertRoundTripSomeValue()

void testConversionExtractAndInsertRoundTripSomeValue ( void  )

Definition at line 285 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ConvertFullScale()

void testMXM_ConvertFullScale ( void  )

Definition at line 159 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ConvertHalfScale()

void testMXM_ConvertHalfScale ( void  )

Definition at line 177 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ConvertInvalidConversionType()

void testMXM_ConvertInvalidConversionType ( void  )

Definition at line 151 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ConvertLowScale()

void testMXM_ConvertLowScale ( void  )

Definition at line 168 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ConvertModuleToStringFirstInFirstString()

void testMXM_ConvertModuleToStringFirstInFirstString ( void  )

Definition at line 329 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ConvertModuleToStringFirstInSecondString()

void testMXM_ConvertModuleToStringFirstInSecondString ( void  )

Definition at line 341 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ConvertModuleToStringNullPointer()

void testMXM_ConvertModuleToStringNullPointer ( void  )

Definition at line 307 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ConvertModuleToStringSecondInFirstString()

void testMXM_ConvertModuleToStringSecondInFirstString ( void  )

Definition at line 357 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ConvertModuleToStringSecondInSecondString()

void testMXM_ConvertModuleToStringSecondInSecondString ( void  )

Definition at line 375 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ConvertModuleToStringTooManyForMaxim()

void testMXM_ConvertModuleToStringTooManyForMaxim ( void  )

Definition at line 314 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ConvertModuleToStringTooManyForSystem()

void testMXM_ConvertModuleToStringTooManyForSystem ( void  )

Definition at line 321 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ConvertSelfCheck()

void testMXM_ConvertSelfCheck ( void  )

Definition at line 186 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ExtractValueFromRegisterADCValue()

void testMXM_ExtractValueFromRegisterADCValue ( void  )

test MXM_ExtractValueFromRegister() with an ADC value

Definition at line 80 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ExtractValueFromRegisterLsbBitSet()

void testMXM_ExtractValueFromRegisterLsbBitSet ( void  )

test MXM_ExtractValueFromRegister() with a single bit in lsb

Definition at line 89 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ExtractValueFromRegisterLsbBitUnset()

void testMXM_ExtractValueFromRegisterLsbBitUnset ( void  )

test MXM_ExtractValueFromRegister() without a bit in lsb

Definition at line 98 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ExtractValueFromRegisterLsbCompletelySet()

void testMXM_ExtractValueFromRegisterLsbCompletelySet ( void  )

test MXM_ExtractValueFromRegister() with whole lsb

Definition at line 107 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ExtractValueFromRegisterMsbBitSet()

void testMXM_ExtractValueFromRegisterMsbBitSet ( void  )

test MXM_ExtractValueFromRegister() with a single bit in msb

Definition at line 125 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ExtractValueFromRegisterMsbBitSetFullBytes()

void testMXM_ExtractValueFromRegisterMsbBitSetFullBytes ( void  )

test MXM_ExtractValueFromRegister() with a single bit in msb and with full byte

Definition at line 134 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ExtractValueFromRegisterMsbBitUnset()

void testMXM_ExtractValueFromRegisterMsbBitUnset ( void  )

test MXM_ExtractValueFromRegister() without a bit in msb

Definition at line 143 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ExtractValueFromRegisterMsbCompletelySet()

void testMXM_ExtractValueFromRegisterMsbCompletelySet ( void  )

test MXM_ExtractValueFromRegister() with whole msb

Definition at line 116 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ExtractValueFromRegisterTest()

void testMXM_ExtractValueFromRegisterTest ( void  )

Definition at line 75 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_FirstSetBitTest()

void testMXM_FirstSetBitTest ( void  )

Definition at line 191 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_Unipolar14BitInto16BitWithInput0()

void testMXM_Unipolar14BitInto16BitWithInput0 ( void  )

Definition at line 195 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_Unipolar14BitInto16BitWithInput3FFF()

void testMXM_Unipolar14BitInto16BitWithInput3FFF ( void  )

Definition at line 203 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_VoltageIntoUnipolar14Bit()

void testMXM_VoltageIntoUnipolar14Bit ( void  )

Definition at line 211 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testScaleAndConvert2500()

void testScaleAndConvert2500 ( void  )

Definition at line 223 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testScaleAndConvert500()

void testScaleAndConvert500 ( void  )

Definition at line 239 of file test_mxm_1785x_tools.c.

Here is the call graph for this function: