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

Test of ADI PEC computations. More...

#include "unity.h"
#include "adi_ades183x_pec.h"
#include "fstd_types.h"
#include "test_assert_helper.h"
#include <stdbool.h>
#include <stdint.h>
Include dependency graph for test_adi_ades1830_pec.c:

Go to the source code of this file.

Functions

void setUp (void)
 
void tearDown (void)
 
void testAdiPec15 (void)
 
void testAdiPec10 (void)
 
void testAdiPec15Asserts (void)
 
void testAdiPec10Asserts (void)
 

Variables

uint8_t pec15Byte2Test0 [2u] = {0x12u, 0x34u}
 
uint8_t pec15Byte2Test1 [2u] = {0xBEu, 0xEFu}
 
uint8_t pec15Byte2Test2 [2u] = {0x00u, 0x01u}
 
uint8_t pec15Byte2Test3 [2u] = {0x07u, 0x23u}
 
uint8_t pec15Byte2Test4 [2u] = {0x03u, 0x60u}
 
uint8_t pec15Byte6Test0 [6u] = {0x12u, 0x34u, 0x56u, 0x78u, 0x9Au, 0xBCu}
 
uint8_t pec15Byte6Test1 [6u] = {0xFFu, 0xFFu, 0xFFu, 0xFFu, 0xFFu, 0xFFu}
 
uint8_t pec15Byte6Test2 [6u] = {0xBEu, 0xEFu, 0xBEu, 0xEFu, 0xBEu, 0xEFu}
 
uint8_t pec15Byte6Test3 [6u] = {0xA0u, 0xB0u, 0xC0u, 0xD0u, 0xE0u, 0xF0u}
 
uint8_t pec15Byte6Test4 [6u] = {0x01u, 0x2Eu, 0x9Bu, 0x33u, 0xACu, 0x55u}
 
uint8_t pec10Byte7Test0 [7u] = {0x12u, 0x34u, 0x56u, 0x78u, 0x9Au, 0xBCu, 0xDEu}
 
uint8_t pec10Byte7Test1 [7u] = {0x12u, 0x34u, 0x56u, 0x78u, 0x9Au, 0xBCu, 0x00u}
 
uint8_t pec10Byte7Test2 [7u] = {0xFFu, 0xFFu, 0xFFu, 0xFFu, 0xFFu, 0xFFu, 0xFFu}
 
uint8_t pec10Byte7Test3 [7u] = {0xFFu, 0xFFu, 0xFFu, 0xFFu, 0xFFu, 0xFFu, 0x00u}
 
uint8_t pec10Byte7Test4 [7u] = {0xBEu, 0xEFu, 0xBEu, 0xEFu, 0xBEu, 0xEFu, 0x35u}
 
uint8_t pec10Byte7Test5 [7u] = {0xBEu, 0xEFu, 0xBEu, 0xEFu, 0xBEu, 0xEFu, 0x00u}
 
uint8_t pec10Byte7Test6 [7u] = {0x12u, 0x34u, 0x56u, 0x78u, 0x9Au, 0xBCu, 0x00u}
 
uint8_t pec10Byte7Test7 [7u] = {0x12u, 0x34u, 0x56u, 0x78u, 0x9Au, 0xBCu, 0xFFu}
 

Detailed Description

Test of ADI PEC computations.

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_adi_ades1830_pec.c.

Function Documentation

◆ setUp()

void setUp ( void  )

Definition at line 103 of file test_adi_ades1830_pec.c.

◆ tearDown()

void tearDown ( void  )

Definition at line 106 of file test_adi_ades1830_pec.c.

◆ testAdiPec10()

void testAdiPec10 ( void  )

Definition at line 125 of file test_adi_ades1830_pec.c.

Here is the call graph for this function:

◆ testAdiPec10Asserts()

void testAdiPec10Asserts ( void  )

Definition at line 156 of file test_adi_ades1830_pec.c.

Here is the call graph for this function:

◆ testAdiPec15()

void testAdiPec15 ( void  )

Definition at line 111 of file test_adi_ades1830_pec.c.

Here is the call graph for this function:

◆ testAdiPec15Asserts()

void testAdiPec15Asserts ( void  )

Definition at line 149 of file test_adi_ades1830_pec.c.

Here is the call graph for this function:

Variable Documentation

◆ pec10Byte7Test0

uint8_t pec10Byte7Test0[7u] = {0x12u, 0x34u, 0x56u, 0x78u, 0x9Au, 0xBCu, 0xDEu}

Definition at line 92 of file test_adi_ades1830_pec.c.

◆ pec10Byte7Test1

uint8_t pec10Byte7Test1[7u] = {0x12u, 0x34u, 0x56u, 0x78u, 0x9Au, 0xBCu, 0x00u}

Definition at line 93 of file test_adi_ades1830_pec.c.

◆ pec10Byte7Test2

uint8_t pec10Byte7Test2[7u] = {0xFFu, 0xFFu, 0xFFu, 0xFFu, 0xFFu, 0xFFu, 0xFFu}

Definition at line 94 of file test_adi_ades1830_pec.c.

◆ pec10Byte7Test3

uint8_t pec10Byte7Test3[7u] = {0xFFu, 0xFFu, 0xFFu, 0xFFu, 0xFFu, 0xFFu, 0x00u}

Definition at line 95 of file test_adi_ades1830_pec.c.

◆ pec10Byte7Test4

uint8_t pec10Byte7Test4[7u] = {0xBEu, 0xEFu, 0xBEu, 0xEFu, 0xBEu, 0xEFu, 0x35u}

Definition at line 96 of file test_adi_ades1830_pec.c.

◆ pec10Byte7Test5

uint8_t pec10Byte7Test5[7u] = {0xBEu, 0xEFu, 0xBEu, 0xEFu, 0xBEu, 0xEFu, 0x00u}

Definition at line 97 of file test_adi_ades1830_pec.c.

◆ pec10Byte7Test6

uint8_t pec10Byte7Test6[7u] = {0x12u, 0x34u, 0x56u, 0x78u, 0x9Au, 0xBCu, 0x00u}

Definition at line 99 of file test_adi_ades1830_pec.c.

◆ pec10Byte7Test7

uint8_t pec10Byte7Test7[7u] = {0x12u, 0x34u, 0x56u, 0x78u, 0x9Au, 0xBCu, 0xFFu}

Definition at line 100 of file test_adi_ades1830_pec.c.

◆ pec15Byte2Test0

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

Definition at line 79 of file test_adi_ades1830_pec.c.

◆ pec15Byte2Test1

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

Definition at line 80 of file test_adi_ades1830_pec.c.

◆ pec15Byte2Test2

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

Definition at line 81 of file test_adi_ades1830_pec.c.

◆ pec15Byte2Test3

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

Definition at line 82 of file test_adi_ades1830_pec.c.

◆ pec15Byte2Test4

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

Definition at line 83 of file test_adi_ades1830_pec.c.

◆ pec15Byte6Test0

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

Definition at line 85 of file test_adi_ades1830_pec.c.

◆ pec15Byte6Test1

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

Definition at line 86 of file test_adi_ades1830_pec.c.

◆ pec15Byte6Test2

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

Definition at line 87 of file test_adi_ades1830_pec.c.

◆ pec15Byte6Test3

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

Definition at line 88 of file test_adi_ades1830_pec.c.

◆ pec15Byte6Test4

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

Definition at line 89 of file test_adi_ades1830_pec.c.