Skip to content

Commit 24dcfce

Browse files
Luiskyrzr
authored andcommitted
libs2/tf: SWPROT-8720: removed C51 specific code in TestFramework (SiliconLabsSoftware#57)
(cherry picked from commit 76628f725482047b6977f49a039aa4a0cba9c81f) Forwarded: SiliconLabsSoftware#57 Relate-to: SiliconLabsSoftware#50 Signed-off-by: Philippe Coval <philippe.coval@silabs.com>
1 parent 7d8c325 commit 24dcfce

File tree

3 files changed

+1
-101
lines changed

3 files changed

+1
-101
lines changed

applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/gen_test_runner.py

100644100755
-51
Original file line numberDiff line numberDiff line change
@@ -69,57 +69,7 @@
6969
void setUpSuite(void);
7070
void tearDownSuite(void);
7171
#endif
72-
''')
73-
74-
print('''
75-
76-
#ifdef __C51__
77-
#include "reg51.h"
78-
79-
void setUp() {
80-
#if 1
81-
SCON = 0x50; /* SCON: mode 1, 8-bit UART, enable rcvr */
82-
TMOD |= 0x20; /* TMOD: timer 1, mode 2, 8-bit reload */
83-
TH1 = 0xf3; /* TH1: reload value for 2400 baud */
84-
TR1 = 1; /* TR1: timer 1 run */
85-
TI = 1; /* TI: set TI to send first char of UART */
86-
#else
87-
int bBaudRate;
88-
WATCHDOG_DISABLE;
89-
bBaudRate = 1152;
90-
bBaudRate = (80000/bBaudRate ) + (((80000 %bBaudRate ) >= (bBaudRate >> 1)) ? 1:0);
91-
UART0_SET_BAUD_RATE(68);
92-
UART0_TX_ENABLE;
93-
94-
OPEN_IOS
95-
UART0BUF = '*';
96-
#endif
97-
98-
}
99-
100-
void tearDown() {
101-
102-
}
103-
104-
extern int main(void) {
105-
int i;
106-
int ret;
10772
108-
setUpSuite();
109-
verbose=0;
110-
unity_print_init();
111-
UNITY_BEGIN();
112-
113-
''')
114-
for f in funcs:
115-
print(' UnityDefaultTestRun(&{}, "{}", {});'.format(f[0], f[0], f[1]))
116-
print('''
117-
ret = UNITY_END();
118-
unity_print_close();
119-
tearDownSuite();
120-
while(1);
121-
}
122-
#else
12373
int main(int argc, char** argp) {
12474
int ret;
12575
setUpSuite();
@@ -146,6 +96,5 @@
14696
tearDownSuite();
14797
return ret;
14898
}
149-
#endif
15099
151100
''')

applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/mock/mock_control.h

-41
Original file line numberDiff line numberDiff line change
@@ -545,46 +545,6 @@ typedef struct
545545
}while(0)
546546

547547

548-
#if __C51__
549-
#define MOCK_CALL_ACTUAL_ARG1(P_MOCK, ARG0) do { \
550-
P_MOCK->actual_arg[0].value = (uint32_t) ARG0; \
551-
}while(0)
552-
553-
#define MOCK_CALL_ACTUAL_ARG2(P_MOCK, ARG0, ARG1) do { \
554-
P_MOCK->actual_arg[0].value = (uint32_t) ARG0; \
555-
P_MOCK->actual_arg[1].value = (uint32_t) ARG1; \
556-
}while(0)
557-
558-
#define MOCK_CALL_ACTUAL_ARG3(P_MOCK, ARG0, ARG1, ARG2) do { \
559-
P_MOCK->actual_arg[0].value = (uint32_t) ARG0; \
560-
P_MOCK->actual_arg[1].value = (uint32_t) ARG1; \
561-
P_MOCK->actual_arg[2].value = (uint32_t) ARG2; \
562-
}while(0)
563-
564-
#define MOCK_CALL_ACTUAL_ARG4(P_MOCK, ARG0, ARG1, ARG2, ARG3) do { \
565-
P_MOCK->actual_arg[0].value = (uint32_t) ARG0; \
566-
P_MOCK->actual_arg[1].value = (uint32_t) ARG1; \
567-
P_MOCK->actual_arg[2].value = (uint32_t) ARG2; \
568-
P_MOCK->actual_arg[3].value = (uint32_t) ARG3; \
569-
}while(0)
570-
571-
#define MOCK_CALL_ACTUAL_ARG5(P_MOCK, ARG0, ARG1, ARG2, ARG3, ARG4) do { \
572-
P_MOCK->actual_arg[0].value = (uint32_t) ARG0; \
573-
P_MOCK->actual_arg[1].value = (uint32_t) ARG1; \
574-
P_MOCK->actual_arg[2].value = (uint32_t) ARG2; \
575-
P_MOCK->actual_arg[3].value = (uint32_t) ARG3; \
576-
P_MOCK->actual_arg[4].value = (uint32_t) ARG4; \
577-
}while(0)
578-
579-
#define MOCK_CALL_ACTUAL_ARG6(P_MOCK, ARG0, ARG1, ARG2, ARG3, ARG4, ARG5) do { \
580-
P_MOCK->actual_arg[0].value = (uint32_t) ARG0; \
581-
P_MOCK->actual_arg[1].value = (uint32_t) ARG1; \
582-
P_MOCK->actual_arg[2].value = (uint32_t) ARG2; \
583-
P_MOCK->actual_arg[3].value = (uint32_t) ARG3; \
584-
P_MOCK->actual_arg[4].value = (uint32_t) ARG4; \
585-
P_MOCK->actual_arg[5].value = (uint32_t) ARG5; \
586-
}while(0)
587-
#else
588548
#define MOCK_CALL_ACTUAL_ARG1(P_MOCK, ARG0) do { \
589549
P_MOCK->actual_arg[0].pointer = (void *)(uintptr_t) ARG0; \
590550
}while(0)
@@ -656,7 +616,6 @@ typedef struct
656616
P_MOCK->actual_arg[7].pointer = (void *)(uintptr_t) ARG7; \
657617
P_MOCK->actual_arg[8].pointer = (void *)(uintptr_t) ARG8; \
658618
}while(0)
659-
#endif
660619

661620
#define N_ARGS_COUNT(_1, _2, _3, _4, _5, _6, _7, _8, _9, N, ...) N
662621
#define N_ARGS(...) N_ARGS_COUNT(__VA_ARGS__, 9, 8, 7, 6, 5, 4, 3, 2, 1)

applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/mock/test/example_test_mock.h

+1-9
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,7 @@
1111
#include <stddef.h>
1212
#include <stdint.h>
1313

14-
#if __C51__
15-
typedef uint16_t WORD;
16-
typedef uint8_t BYTE;
17-
#define CODE code
18-
#define VOID_CALLBACKFUNC(completedFunc) void (CODE *completedFunc)
19-
#define STRIP_GENERIC_PTR(p) ((unsigned) (void *) (p))
20-
#define IS_NULL(x) (STRIP_GENERIC_PTR(x) == 0)
21-
#define NON_NULL(x) (STRIP_GENERIC_PTR(x) != 0)
22-
#elif __GNUC__
14+
#if __GNUC__
2315
typedef uint16_t WORD;
2416
typedef uint8_t BYTE;
2517
#define CODE

0 commit comments

Comments
 (0)