foxBMS - Unit Tests  1.6.0
The foxBMS Unit Tests API Documentation
test_ltc_pec.c File Reference

Test of the ltc_pec.c module in ltc. More...

#include "unity.h"
#include "fstd_types.h"
#include "ltc_pec.h"
#include "test_assert_helper.h"
Include dependency graph for test_ltc_pec.c:

Go to the source code of this file.

Functions

void setUp (void)
 
void tearDown (void)
 
void testLtcPec15 (void)
 
void testLtcPec15InvalidInput (void)
 

Variables

uint8_t byte2Test0 [2u] = {0x12u, 0x34u}
 
uint8_t byte2Test1 [2u] = {0xBEu, 0xEFu}
 
uint8_t byte2Test2 [2u] = {0x00u, 0x01u}
 
uint8_t byte2Test3 [2u] = {0x07u, 0x23u}
 
uint8_t byte2Test4 [2u] = {0x03u, 0x60u}
 
uint8_t byte6Test0 [6u] = {0x12u, 0x34u, 0x56u, 0x78u, 0x9Au, 0xBCu}
 
uint8_t byte6Test1 [6u] = {0xFFu, 0xFFu, 0xFFu, 0xFFu, 0xFFu, 0xFFu}
 
uint8_t byte6Test2 [6u] = {0xBEu, 0xEFu, 0xBEu, 0xEFu, 0xBEu, 0xEFu}
 
uint8_t byte6Test3 [6u] = {0xA0u, 0xB0u, 0xC0u, 0xD0u, 0xE0u, 0xF0u}
 
uint8_t byte6Test4 [6u] = {0x01u, 0x2Eu, 0x9Bu, 0x33u, 0xACu, 0x55u}
 

Detailed Description

Test of the ltc_pec.c module in ltc.

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
2022-11-04 (date of creation)
Updated
2023-10-12 (date of last update)
Version
v1.6.0
Prefix
TEST

Definition in file test_ltc_pec.c.

Function Documentation

◆ setUp()

void setUp ( void  )

Definition at line 83 of file test_ltc_pec.c.

◆ tearDown()

void tearDown ( void  )

Definition at line 86 of file test_ltc_pec.c.

◆ testLtcPec15()

void testLtcPec15 ( void  )

Definition at line 91 of file test_ltc_pec.c.

◆ testLtcPec15InvalidInput()

void testLtcPec15InvalidInput ( void  )

Definition at line 105 of file test_ltc_pec.c.

Variable Documentation

◆ byte2Test0

uint8_t byte2Test0[2u] = {0x12u, 0x34u}

Definition at line 70 of file test_ltc_pec.c.

◆ byte2Test1

uint8_t byte2Test1[2u] = {0xBEu, 0xEFu}

Definition at line 71 of file test_ltc_pec.c.

◆ byte2Test2

uint8_t byte2Test2[2u] = {0x00u, 0x01u}

Definition at line 72 of file test_ltc_pec.c.

◆ byte2Test3

uint8_t byte2Test3[2u] = {0x07u, 0x23u}

Definition at line 73 of file test_ltc_pec.c.

◆ byte2Test4

uint8_t byte2Test4[2u] = {0x03u, 0x60u}

Definition at line 74 of file test_ltc_pec.c.

◆ byte6Test0

uint8_t byte6Test0[6u] = {0x12u, 0x34u, 0x56u, 0x78u, 0x9Au, 0xBCu}

Definition at line 76 of file test_ltc_pec.c.

◆ byte6Test1

uint8_t byte6Test1[6u] = {0xFFu, 0xFFu, 0xFFu, 0xFFu, 0xFFu, 0xFFu}

Definition at line 77 of file test_ltc_pec.c.

◆ byte6Test2

uint8_t byte6Test2[6u] = {0xBEu, 0xEFu, 0xBEu, 0xEFu, 0xBEu, 0xEFu}

Definition at line 78 of file test_ltc_pec.c.

◆ byte6Test3

uint8_t byte6Test3[6u] = {0xA0u, 0xB0u, 0xC0u, 0xD0u, 0xE0u, 0xF0u}

Definition at line 79 of file test_ltc_pec.c.

◆ byte6Test4

uint8_t byte6Test4[6u] = {0x01u, 0x2Eu, 0x9Bu, 0x33u, 0xACu, 0x55u}

Definition at line 80 of file test_ltc_pec.c.