<commit_before>/*
 * Copyright (c) 2018 Intel Corporation
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include <ztest.h>

/**
 * @brief Test delay during boot
 * @defgroup kernel_bootdelay_tests Init
 * @ingroup all_tests
 * @{
 */

/**
 * @brief This module verifies the delay specified during boot.
 * @see k_cycle_get_32, #SYS_CLOCK_HW_CYCLES_TO_NS64(X)
 */
void verify_bootdelay(void)
{
	u32_t current_cycles = k_cycle_get_32();

	/* compare this with the boot delay specified */
	zassert_true(SYS_CLOCK_HW_CYCLES_TO_NS64(current_cycles) >=
		     (CONFIG_BOOT_DELAY * NSEC_PER_USEC * USEC_PER_MSEC),
		     "boot delay not executed");
}

/**
 * @}
 */

/*test case main entry*/
void test_main(void)
{
	ztest_test_suite(test_bootdelay,
			 ztest_unit_test(verify_bootdelay));
	ztest_run_test_suite(test_bootdelay);
}<commit_msg>tests: kernel: init: Fix integer overflow issue<commit_after>/*
 * Copyright (c) 2018 Intel Corporation
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include <ztest.h>

#define NSEC_PER_MSEC (u64_t)(NSEC_PER_USEC * USEC_PER_MSEC)
/**
 * @brief Test delay during boot
 * @defgroup kernel_bootdelay_tests Init
 * @ingroup all_tests
 * @{
 */

/**
 * @brief This module verifies the delay specified during boot.
 * @see k_cycle_get_32, #SYS_CLOCK_HW_CYCLES_TO_NS64(X)
 */
void verify_bootdelay(void)
{
	u32_t current_cycles = k_cycle_get_32();

	/* compare this with the boot delay specified */
	zassert_true(SYS_CLOCK_HW_CYCLES_TO_NS64(current_cycles) >=
			(NSEC_PER_MSEC * CONFIG_BOOT_DELAY),
			"boot delay not executed");
}

/**
 * @}
 */

/*test case main entry*/
void test_main(void)
{
	ztest_test_suite(test_bootdelay,
			 ztest_unit_test(verify_bootdelay));
	ztest_run_test_suite(test_bootdelay);
}
{'fraction_non_alphanumeric': 0.11947156806433085, 'fraction_numerical': 0.019529006318207927, 'mean_word_length': 4.768211920529802, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '4413231', 'n_tokens_mistral': 693, 'n_tokens_neox': 648, 'n_words': 131}