blob: 057ac2235d6c957d74691ca27209b50aa27b8f24 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation */
/* Copyright (c) 2026 Eclipse ThreadX contributors */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the MIT License which is available at */
/* https://opensource.org/licenses/MIT. */
/* */
/* SPDX-License-Identifier: MIT */
/***************************************************************************/
/* This test is designed to test kernel setup functionality in ThreadX. */
// Some portions generated by Codex (gpt 5.4).
#include <stdio.h>
#include <stdlib.h>
#include "tx_api.h"
#include "tx_initialize.h"
#include "tx_thread.h"
TEST_FLAG test_forced_mutex_timeout;
TEST_FLAG threadx_mutex_suspension_put_test;
TEST_FLAG threadx_mutex_suspension_priority_test;
TEST_FLAG threadx_byte_allocate_loop_test;
TEST_FLAG test_initialize_flag;
TEST_FLAG threadx_byte_release_loop_test;
TEST_FLAG test_stack_analyze_flag;
/* Define the test control global variables. */
ULONG test_control_return_status;
ULONG test_control_successful_tests;
ULONG test_control_failed_tests;
ULONG test_control_system_errors;
UINT test_mutex_from_init;
UINT test_semaphore_from_init;
UINT test_queue_from_init;
UINT test_event_flags_from_init;
UINT test_byte_pool_create_init;
UINT test_block_pool_create_init;
UINT test_timer_create_init;
int main(void)
{
/* Setup the ThreadX kernel. */
_tx_initialize_kernel_setup();
if (_tx_thread_system_state == TX_INITIALIZE_ALMOST_DONE)
{
printf("Running Initialize Kernel Setup Test................................ SUCCESS!\n");
exit(0);
}
else
{
printf("Running Initialize Kernel Setup Test................................ ERROR!\n");
exit(1);
}
return(0);
}
void test_application_define(void *first_unused_memory){}
void tx_application_define(void *first_unused_memory){}
#ifndef TX_TIMER_PROCESS_IN_ISR
/* Define the deletion of the system timer thread. */
extern TX_THREAD _tx_timer_thread;
TEST_FLAG threadx_delete_timer_thread;
void delete_timer_thread(void)
{
_tx_thread_terminate(&_tx_timer_thread);
_tx_thread_delete(&_tx_timer_thread);
}
#endif
|