<commit_before>#include <xc.h>
#include <stdint.h>
#include <unity.h>

#include "Platform/Event.h"
#include "Platform/NvmSettings.h"
#include "Mock_VoltageRegulator.h"
#include "Mock_LcdInternals.h"
#include "Platform/Lcd.h"

#include "../../Fixture.h"
#include "../../NonDeterminism.h"

TEST_FILE("Platform/Event.c")
TEST_FILE("Platform/Lcd/LcdInitialise.c")
TEST_FILE("Platform/Lcd/LcdEnableDisable.c")

void onBeforeTest(void)
{
}

void onAfterTest(void)
{
}

void test_lcdInitialise_called_expectPwm3And5ModulesAreEnabled(void)
{
	PMD3 = anyByteWithMaskSet(_PMD3_PWM3MD_MASK | _PMD3_PWM5MD_MASK);
	uint8_t originalPmd3 = PMD3;
	lcdInitialise();
	TEST_ASSERT_EQUAL_UINT8(
		originalPmd3 & ~(_PMD3_PWM3MD_MASK | _PMD3_PWM5MD_MASK),
		PMD3);
}

void test_lcdInitialise_called_expectLcdContrastPinIsTristated(void)
{
	static const uint8_t lcdContrastPin = _TRISA_TRISA2_MASK;
	ANSELA = anyByteWithMaskClear(lcdContrastPin);
	TRISA = anyByteWithMaskClear(lcdContrastPin);
	lcdInitialise();
	TEST_ASSERT_BITS_HIGH_MESSAGE(lcdContrastPin, ANSELA, "ANSELA");
	TEST_ASSERT_BITS_HIGH_MESSAGE(lcdContrastPin, TRISA, "TRISA");
}

void test_lcdInitialise_called_expectLcdPortAPinsExceptContrastPinAreAllOutputs(void)
{
	static const uint8_t lcdContrastPin = _TRISA_TRISA3_MASK;
	static const uint8_t usedPins =<commit_msg>Fixed typo with the LCD contrast pin assignment.<commit_after>#include <xc.h>
#include <stdint.h>
#include <unity.h>

#include "Platform/Event.h"
#include "Platform/NvmSettings.h"
#include "Mock_VoltageRegulator.h"
#include "Mock_LcdInternals.h"
#include "Platform/Lcd.h"

#include "../../Fixture.h"
#include "../../NonDeterminism.h"

TEST_FILE("Platform/Event.c")
TEST_FILE("Platform/Lcd/LcdInitialise.c")
TEST_FILE("Platform/Lcd/LcdEnableDisable.c")

void onBeforeTest(void)
{
}

void onAfterTest(void)
{
}

void test_lcdInitialise_called_expectPwm3And5ModulesAreEnabled(void)
{
	PMD3 = anyByteWithMaskSet(_PMD3_PWM3MD_MASK | _PMD3_PWM5MD_MASK);
	uint8_t originalPmd3 = PMD3;
	lcdInitialise();
	TEST_ASSERT_EQUAL_UINT8(
		originalPmd3 & ~(_PMD3_PWM3MD_MASK | _PMD3_PWM5MD_MASK),
		PMD3);
}

void test_lcdInitialise_called_expectLcdContrastPinIsTristated(void)
{
	static const uint8_t lcdContrastPin = _TRISA_TRISA2_MASK;
	ANSELA = anyByteWithMaskClear(lcdContrastPin);
	TRISA = anyByteWithMaskClear(lcdContrastPin);
	lcdInitialise();
	TEST_ASSERT_BITS_HIGH_MESSAGE(lcdContrastPin, ANSELA, "ANSELA");
	TEST_ASSERT_BITS_HIGH_MESSAGE(lcdContrastPin, TRISA, "TRISA");
}

void test_lcdInitialise_called_expectLcdPortAPinsExceptContrastPinAreAllOutputs(void)
{
	static const uint8_t lcdContrastPin = _TRISA_TRISA2_MASK;
	static const uint8_t usedPins =
{'fraction_non_alphanumeric': 0.11010898158586997, 'fraction_numerical': 0.016535137166478767, 'mean_word_length': 7.903010033444816, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5655717', 'n_tokens_mistral': 1116, 'n_tokens_neox': 1086, 'n_words': 147}