Skip to content

Commit 2a456e5

Browse files
committed
Merge pull request #154 from adbridge/status_t_update
Update all instances of status_t in the unit tests to fully namespace…
2 parents be0fcfb + 635afa5 commit 2a456e5

File tree

13 files changed

+53
-53
lines changed

13 files changed

+53
-53
lines changed

frameworks/utest/TESTS/unit_tests/basic_test/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ void test_simple() {
1212
printf("Simple test called\n");
1313
}
1414

15-
status_t test_repeats_setup(const Case *const source, const size_t index_of_case) {
15+
utest::v1::status_t test_repeats_setup(const Case *const source, const size_t index_of_case) {
1616
UTEST_LOG_FUNCTION();
1717
// Call the default handler for proper reporting
18-
status_t status = greentea_case_setup_handler(source, index_of_case);
18+
utest::v1::status_t status = greentea_case_setup_handler(source, index_of_case);
1919
printf("Setting up for '%s'\n", source->get_description());
2020
return status;
2121
}
@@ -28,7 +28,7 @@ control_t test_repeats(const size_t call_count) {
2828
}
2929

3030
// Custom setup handler required for proper Greentea support
31-
status_t greentea_setup(const size_t number_of_cases) {
31+
utest::v1::status_t greentea_setup(const size_t number_of_cases) {
3232
UTEST_LOG_FUNCTION();
3333
GREENTEA_SETUP(20, "default_auto");
3434
// Call the default reporting function

frameworks/utest/TESTS/unit_tests/case_async_validate/main.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ control_t multiple_validation_case()
7272
return CaseAwait;
7373
}
7474

75-
status_t multiple_validation_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
75+
utest::v1::status_t multiple_validation_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
7676
{
7777
TEST_ASSERT_EQUAL(1, passed);
7878
TEST_ASSERT_EQUAL(0, failed);
@@ -96,7 +96,7 @@ control_t premature_validation_case()
9696
return CaseAwait;
9797
}
9898

99-
status_t premature_validation_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
99+
utest::v1::status_t premature_validation_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
100100
{
101101
TEST_ASSERT_EQUAL(1, passed);
102102
TEST_ASSERT_EQUAL(0, failed);
@@ -121,7 +121,7 @@ control_t multiple_premature_validation_case()
121121
return CaseAwait;
122122
}
123123

124-
status_t multiple_premature_validation_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
124+
utest::v1::status_t multiple_premature_validation_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
125125
{
126126
TEST_ASSERT_EQUAL(1, passed);
127127
TEST_ASSERT_EQUAL(0, failed);
@@ -150,7 +150,7 @@ control_t attributed_validation_cancel_repeat_case()
150150
return CaseRepeatAll + CaseAwait;
151151
}
152152

153-
status_t attributed_validation_cancel_repeat_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
153+
utest::v1::status_t attributed_validation_cancel_repeat_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
154154
{
155155
TEST_ASSERT_EQUAL(1, passed);
156156
TEST_ASSERT_EQUAL(0, failed);
@@ -186,7 +186,7 @@ control_t attributed_validation_enable_repeat_case(const size_t call_count)
186186
return CaseNext;
187187
}
188188

189-
status_t attributed_validation_enable_repeat_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
189+
utest::v1::status_t attributed_validation_enable_repeat_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
190190
{
191191
TEST_ASSERT_EQUAL(2, passed);
192192
TEST_ASSERT_EQUAL(0, failed);
@@ -206,7 +206,7 @@ Case cases[] = {
206206
Case("Validate: Attributed Validation: Enable Repeat Handler", attributed_validation_enable_repeat_case, attributed_validation_enable_repeat_case_teardown)
207207
};
208208

209-
status_t greentea_setup(const size_t number_of_cases)
209+
utest::v1::status_t greentea_setup(const size_t number_of_cases)
210210
{
211211
GREENTEA_SETUP(15, "default_auto");
212212

frameworks/utest/TESTS/unit_tests/case_control_async/main.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ control_t timeout_failure_case(const size_t call_count)
6565
TEST_ASSERT_EQUAL(0, call_counter++);
6666
return CaseTimeout(100);
6767
}
68-
status_t timeout_failure_case_failure_handler(const Case *const source, const failure_t failure)
68+
utest::v1::status_t timeout_failure_case_failure_handler(const Case *const source, const failure_t failure)
6969
{
7070
UTEST_LOG_FUNCTION();
7171
TEST_ASSERT_EQUAL(1, call_counter++);
@@ -74,7 +74,7 @@ status_t timeout_failure_case_failure_handler(const Case *const source, const fa
7474
verbose_case_failure_handler(source, failure);
7575
return STATUS_CONTINUE;
7676
}
77-
status_t timeout_failure_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
77+
utest::v1::status_t timeout_failure_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
7878
{
7979
UTEST_LOG_FUNCTION();
8080
TEST_ASSERT_EQUAL(2, call_counter++);
@@ -101,7 +101,7 @@ control_t timeout_success_case(const size_t call_count)
101101

102102
return CaseTimeout(200);
103103
}
104-
status_t timeout_success_case_failure_handler(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
104+
utest::v1::status_t timeout_success_case_failure_handler(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
105105
{
106106
UTEST_LOG_FUNCTION();
107107
TEST_ASSERT_EQUAL(5, call_counter++);
@@ -126,7 +126,7 @@ control_t await_case(const size_t call_count)
126126

127127
// Control: RepeatAllOnTimeout ----------------------------------------------------------------------------------------
128128
bool repeat_all_start_flag = true;
129-
status_t repeat_all_on_timeout_case_setup(const Case *const source, const size_t index_of_case)
129+
utest::v1::status_t repeat_all_on_timeout_case_setup(const Case *const source, const size_t index_of_case)
130130
{
131131
if (repeat_all_start_flag){
132132
UTEST_TRACE_START
@@ -153,7 +153,7 @@ control_t repeat_all_on_timeout_case(const size_t call_count)
153153
}
154154
return CaseRepeatAllOnTimeout(100);
155155
}
156-
status_t repeat_all_on_timeout_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
156+
utest::v1::status_t repeat_all_on_timeout_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
157157
{
158158
UTEST_LOG_FUNCTION();
159159
static int repeat_counter(0);
@@ -169,7 +169,7 @@ status_t repeat_all_on_timeout_case_teardown(const Case *const source, const siz
169169
}
170170

171171
// Control: RepeatAllOnTimeout ----------------------------------------------------------------------------------------
172-
status_t repeat_handler_on_timeout_case_setup(const Case *const source, const size_t index_of_case)
172+
utest::v1::status_t repeat_handler_on_timeout_case_setup(const Case *const source, const size_t index_of_case)
173173
{
174174
UTEST_LOG_FUNCTION();
175175
TEST_ASSERT_EQUAL(4, index_of_case);
@@ -191,7 +191,7 @@ control_t repeat_handler_on_timeout_case(const size_t call_count)
191191
}
192192
return CaseRepeatHandlerOnTimeout(100);
193193
}
194-
status_t repeat_handler_on_timeout_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
194+
utest::v1::status_t repeat_handler_on_timeout_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
195195
{
196196
UTEST_LOG_FUNCTION();
197197
TEST_ASSERT_EQUAL(1, passed);
@@ -232,7 +232,7 @@ Case cases[] = {
232232
};
233233

234234
// Specification: Setup & Teardown ------------------------------------------------------------------------------------
235-
status_t greentea_setup(const size_t number_of_cases)
235+
utest::v1::status_t greentea_setup(const size_t number_of_cases)
236236
{
237237
GREENTEA_SETUP(15, "default_auto");
238238

frameworks/utest/TESTS/unit_tests/case_control_repeat/main.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ using namespace utest::v1;
2424
static int call_counter(0);
2525

2626
// Control: RepeatAll -------------------------------------------------------------------------------------------------
27-
status_t repeat_all_case_setup(const Case *const source, const size_t index_of_case)
27+
utest::v1::status_t repeat_all_case_setup(const Case *const source, const size_t index_of_case)
2828
{
2929
static int repeat_counter(0);
3030
TEST_ASSERT_EQUAL(0, index_of_case);
@@ -40,7 +40,7 @@ control_t repeat_all_case(const size_t call_count)
4040
TEST_ASSERT_EQUAL((call_count-1)*3 + 1, call_counter++);
4141
return (call_count < 10) ? CaseRepeatAll : CaseNoRepeat;
4242
}
43-
status_t repeat_all_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
43+
utest::v1::status_t repeat_all_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
4444
{
4545
static int repeat_counter(0);
4646
TEST_ASSERT_EQUAL(repeat_counter*3 + 2, call_counter++);
@@ -53,7 +53,7 @@ status_t repeat_all_case_teardown(const Case *const source, const size_t passed,
5353
}
5454

5555
// Control: RepeatHandler ---------------------------------------------------------------------------------------------
56-
status_t repeat_handler_case_setup(const Case *const source, const size_t index_of_case)
56+
utest::v1::status_t repeat_handler_case_setup(const Case *const source, const size_t index_of_case)
5757
{
5858
TEST_ASSERT_EQUAL(1, index_of_case);
5959
TEST_ASSERT_EQUAL(30, call_counter++);
@@ -67,7 +67,7 @@ control_t repeat_handler_case(const size_t call_count)
6767
TEST_ASSERT_EQUAL((call_count-1) + 31, call_counter++);
6868
return (call_count < 10) ? CaseRepeatHandler : CaseNoRepeat;
6969
}
70-
status_t repeat_handler_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
70+
utest::v1::status_t repeat_handler_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
7171
{
7272
TEST_ASSERT_EQUAL(41, call_counter++);
7373
TEST_ASSERT_EQUAL(10, passed);
@@ -104,7 +104,7 @@ Case cases[] = {
104104
Case("Control: CaseNext", next_handler_case)
105105
};
106106

107-
status_t greentea_setup(const size_t number_of_cases)
107+
utest::v1::status_t greentea_setup(const size_t number_of_cases)
108108
{
109109
GREENTEA_SETUP(15, "default_auto");
110110

frameworks/utest/TESTS/unit_tests/case_selection/main.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,43 +28,43 @@ void handler_case_2()
2828
{
2929
printf("Executing Case 2...\n");
3030
}
31-
status_t teardown_case_2(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
31+
utest::v1::status_t teardown_case_2(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
3232
{
3333
TEST_ASSERT_EQUAL(1, passed);
3434
TEST_ASSERT_EQUAL(0, failed);
3535
TEST_ASSERT_EQUAL(REASON_NONE, failure.reason);
3636
TEST_ASSERT_EQUAL(LOCATION_NONE, failure.location);
3737
TEST_ASSERT_EQUAL(0, call_counter++);
3838
greentea_case_teardown_handler(source, passed, failed, failure);
39-
return status_t(0);
39+
return utest::v1::status_t(0);
4040
}
4141
void handler_case_0()
4242
{
4343
printf("Executing Case 0...\n");
4444
}
45-
status_t teardown_case_0(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
45+
utest::v1::status_t teardown_case_0(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
4646
{
4747
TEST_ASSERT_EQUAL(1, passed);
4848
TEST_ASSERT_EQUAL(0, failed);
4949
TEST_ASSERT_EQUAL(REASON_NONE, failure.reason);
5050
TEST_ASSERT_EQUAL(LOCATION_NONE, failure.location);
5151
TEST_ASSERT_EQUAL(1, call_counter++);
5252
greentea_case_teardown_handler(source, passed, failed, failure);
53-
return status_t(1);
53+
return utest::v1::status_t(1);
5454
}
5555
void handler_case_1()
5656
{
5757
printf("Executing Case 1...\n");
5858
}
59-
status_t teardown_case_1(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
59+
utest::v1::status_t teardown_case_1(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
6060
{
6161
TEST_ASSERT_EQUAL(1, passed);
6262
TEST_ASSERT_EQUAL(0, failed);
6363
TEST_ASSERT_EQUAL(REASON_NONE, failure.reason);
6464
TEST_ASSERT_EQUAL(LOCATION_NONE, failure.location);
6565
TEST_ASSERT_EQUAL(2, call_counter++);
6666
greentea_case_teardown_handler(source, passed, failed, failure);
67-
return status_t(3);
67+
return utest::v1::status_t(3);
6868
}
6969

7070
Case cases[] =
@@ -74,12 +74,12 @@ Case cases[] =
7474
Case("Case 3", handler_case_2, teardown_case_2)
7575
};
7676

77-
status_t test_setup_handler(const size_t number_of_cases)
77+
utest::v1::status_t test_setup_handler(const size_t number_of_cases)
7878
{
7979
GREENTEA_SETUP(5, "default_auto");
8080

8181
greentea_test_setup_handler(number_of_cases);
82-
return status_t(2);
82+
return utest::v1::status_t(2);
8383
};
8484
void test_teardown_handler(const size_t passed, const size_t failed, const failure_t failure)
8585
{

frameworks/utest/TESTS/unit_tests/case_setup_failure/main.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ void never_call_case()
2828
TEST_FAIL_MESSAGE("Case handler should have never been called!");
2929
}
3030

31-
status_t abort_case_setup(const Case *const source, const size_t index_of_case)
31+
utest::v1::status_t abort_case_setup(const Case *const source, const size_t index_of_case)
3232
{
3333
call_counter++;
3434
TEST_ASSERT_EQUAL(0, index_of_case);
3535
greentea_case_setup_handler(source, index_of_case);
3636
return STATUS_ABORT;
3737
}
3838

39-
status_t abort_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
39+
utest::v1::status_t abort_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
4040
{
4141
TEST_ASSERT_EQUAL(1, call_counter);
4242
TEST_ASSERT_EQUAL(0, passed);
@@ -47,7 +47,7 @@ status_t abort_case_teardown(const Case *const source, const size_t passed, cons
4747
return greentea_case_teardown_handler(source, 1, 0, failure);
4848
}
4949

50-
status_t ignore_case_setup(const Case *const source, const size_t index_of_case)
50+
utest::v1::status_t ignore_case_setup(const Case *const source, const size_t index_of_case)
5151
{
5252
TEST_ASSERT_EQUAL(2, call_counter);
5353
TEST_ASSERT_EQUAL(1, index_of_case);
@@ -56,7 +56,7 @@ status_t ignore_case_setup(const Case *const source, const size_t index_of_case)
5656
return STATUS_IGNORE; // this is the same
5757
}
5858

59-
status_t ignore_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
59+
utest::v1::status_t ignore_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
6060
{
6161
TEST_ASSERT_EQUAL(3, call_counter);
6262
TEST_ASSERT_EQUAL(0, passed);
@@ -67,7 +67,7 @@ status_t ignore_case_teardown(const Case *const source, const size_t passed, con
6767
return greentea_case_teardown_handler(source, 1, 0, failure);
6868
}
6969

70-
status_t continue_case_setup(const Case *const source, const size_t index_of_case)
70+
utest::v1::status_t continue_case_setup(const Case *const source, const size_t index_of_case)
7171
{
7272
TEST_ASSERT_EQUAL(4, call_counter);
7373
TEST_ASSERT_EQUAL(2, index_of_case);
@@ -82,7 +82,7 @@ void continue_case_handler()
8282
call_counter++;
8383
}
8484

85-
status_t continue_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
85+
utest::v1::status_t continue_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
8686
{
8787
TEST_ASSERT_EQUAL(6, call_counter);
8888
TEST_ASSERT_EQUAL(1, passed);
@@ -99,7 +99,7 @@ Case cases[] = {
9999
Case("Setup handler returns CONTINUE", continue_case_setup, continue_case_handler, continue_case_teardown)
100100
};
101101

102-
status_t greentea_setup(const size_t number_of_cases)
102+
utest::v1::status_t greentea_setup(const size_t number_of_cases)
103103
{
104104
GREENTEA_SETUP(15, "default_auto");
105105

frameworks/utest/TESTS/unit_tests/case_teardown_failure/main.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ void continue_case()
2828
{
2929
TEST_ASSERT_EQUAL(0, call_counter++);
3030
}
31-
status_t continue_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
31+
utest::v1::status_t continue_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
3232
{
3333
TEST_ASSERT_EQUAL(1, passed);
3434
TEST_ASSERT_EQUAL(0, failed);
@@ -37,7 +37,7 @@ status_t continue_case_teardown(const Case *const source, const size_t passed, c
3737
TEST_ASSERT_EQUAL(1, call_counter++);
3838
return greentea_case_teardown_handler(source, passed, failed, failure);
3939
}
40-
status_t continue_failure(const Case *const, const failure_t)
40+
utest::v1::status_t continue_failure(const Case *const, const failure_t)
4141
{
4242
TEST_FAIL_MESSAGE("Failure handler should have never been called!");
4343
return STATUS_CONTINUE;
@@ -48,7 +48,7 @@ void ignore_case()
4848
{
4949
TEST_ASSERT_EQUAL(2, call_counter++);
5050
}
51-
status_t ignore_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
51+
utest::v1::status_t ignore_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
5252
{
5353
TEST_ASSERT_EQUAL(1, passed);
5454
TEST_ASSERT_EQUAL(0, failed);
@@ -58,7 +58,7 @@ status_t ignore_case_teardown(const Case *const source, const size_t passed, con
5858
greentea_case_teardown_handler(source, passed, failed, failure);
5959
return STATUS_ABORT;
6060
}
61-
status_t ignore_failure(const Case *const source, const failure_t failure)
61+
utest::v1::status_t ignore_failure(const Case *const source, const failure_t failure)
6262
{
6363
TEST_ASSERT_EQUAL(4, call_counter++);
6464
TEST_ASSERT_EQUAL(REASON_CASE_TEARDOWN, failure.reason);
@@ -72,7 +72,7 @@ void abort_case()
7272
{
7373
TEST_ASSERT_EQUAL(5, call_counter++);
7474
}
75-
status_t abort_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
75+
utest::v1::status_t abort_case_teardown(const Case *const source, const size_t passed, const size_t failed, const failure_t failure)
7676
{
7777
TEST_ASSERT_EQUAL(1, passed);
7878
TEST_ASSERT_EQUAL(0, failed);
@@ -82,7 +82,7 @@ status_t abort_case_teardown(const Case *const source, const size_t passed, cons
8282
greentea_case_teardown_handler(source, passed, failed, failure);
8383
return STATUS_ABORT;
8484
}
85-
status_t abort_failure(const Case *const source, const failure_t failure)
85+
utest::v1::status_t abort_failure(const Case *const source, const failure_t failure)
8686
{
8787
TEST_ASSERT_EQUAL(7, call_counter++);
8888
TEST_ASSERT_EQUAL(REASON_CASE_TEARDOWN, failure.reason);
@@ -98,7 +98,7 @@ Case cases[] = {
9898
};
9999

100100
// Specification: Setup & Teardown ------------------------------------------------------------------------------------
101-
status_t greentea_setup(const size_t number_of_cases)
101+
utest::v1::status_t greentea_setup(const size_t number_of_cases)
102102
{
103103
GREENTEA_SETUP(15, "default_auto");
104104

frameworks/utest/TESTS/unit_tests/control_type/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ Case cases[] =
260260
Case("Testing combinations of different group", test_different_group_combinations)
261261
};
262262

263-
status_t greentea_setup(const size_t number_of_cases)
263+
utest::v1::status_t greentea_setup(const size_t number_of_cases)
264264
{
265265
GREENTEA_SETUP(15, "default_auto");
266266

0 commit comments

Comments
 (0)