foxBMS - Unit Tests  1.2.1
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
2021-12-06 (date of last update)
Prefix
MXM

def

Definition in file test_mxm_1785x_tools.c.

Function Documentation

◆ setUp()

void setUp ( void  )

Definition at line 67 of file test_mxm_1785x_tools.c.

◆ tearDown()

void tearDown ( void  )

Definition at line 70 of file test_mxm_1785x_tools.c.

◆ testConversionExtractAndInsertRoundTripFullScale()

void testConversionExtractAndInsertRoundTripFullScale ( void  )

Definition at line 254 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testConversionExtractAndInsertRoundTripNull()

void testConversionExtractAndInsertRoundTripNull ( void  )

Definition at line 269 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testConversionExtractAndInsertRoundTripSomeValue()

void testConversionExtractAndInsertRoundTripSomeValue ( void  )

Definition at line 284 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ConvertFullScale()

void testMXM_ConvertFullScale ( void  )

Definition at line 158 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ConvertHalfScale()

void testMXM_ConvertHalfScale ( void  )

Definition at line 176 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ConvertInvalidConversionType()

void testMXM_ConvertInvalidConversionType ( void  )

Definition at line 150 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ConvertLowScale()

void testMXM_ConvertLowScale ( void  )

Definition at line 167 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ConvertModuleToStringFirstInFirstString()

void testMXM_ConvertModuleToStringFirstInFirstString ( void  )

Definition at line 328 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ConvertModuleToStringFirstInSecondString()

void testMXM_ConvertModuleToStringFirstInSecondString ( void  )

Definition at line 340 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ConvertModuleToStringNullPointer()

void testMXM_ConvertModuleToStringNullPointer ( void  )

Definition at line 306 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ConvertModuleToStringSecondInFirstString()

void testMXM_ConvertModuleToStringSecondInFirstString ( void  )

Definition at line 356 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ConvertModuleToStringSecondInSecondString()

void testMXM_ConvertModuleToStringSecondInSecondString ( void  )

Definition at line 374 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ConvertModuleToStringTooManyForMaxim()

void testMXM_ConvertModuleToStringTooManyForMaxim ( void  )

Definition at line 313 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ConvertModuleToStringTooManyForSystem()

void testMXM_ConvertModuleToStringTooManyForSystem ( void  )

Definition at line 320 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ConvertSelfCheck()

void testMXM_ConvertSelfCheck ( void  )

Definition at line 185 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 79 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 88 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 97 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 106 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 124 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 133 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 142 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 115 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_ExtractValueFromRegisterTest()

void testMXM_ExtractValueFromRegisterTest ( void  )

Definition at line 74 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_FirstSetBitTest()

void testMXM_FirstSetBitTest ( void  )

Definition at line 190 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_Unipolar14BitInto16BitWithInput0()

void testMXM_Unipolar14BitInto16BitWithInput0 ( void  )

Definition at line 194 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_Unipolar14BitInto16BitWithInput3FFF()

void testMXM_Unipolar14BitInto16BitWithInput3FFF ( void  )

Definition at line 202 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testMXM_VoltageIntoUnipolar14Bit()

void testMXM_VoltageIntoUnipolar14Bit ( void  )

Definition at line 210 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testScaleAndConvert2500()

void testScaleAndConvert2500 ( void  )

Definition at line 222 of file test_mxm_1785x_tools.c.

Here is the call graph for this function:

◆ testScaleAndConvert500()

void testScaleAndConvert500 ( void  )

Definition at line 238 of file test_mxm_1785x_tools.c.

Here is the call graph for this function: