int test_peripheral_io_uart_peripheral_uart_write_p(void);
int test_peripheral_io_uart_peripheral_uart_write_n1(void);
int test_peripheral_io_uart_peripheral_uart_write_n2(void);
+int test_peripheral_io_uart_peripheral_uart_flush_p(void);
+int test_peripheral_io_uart_peripheral_uart_flush_n(void);
+int test_peripheral_io_uart_peripheral_uart_drain_p(void);
+int test_peripheral_io_uart_peripheral_uart_drain_n(void);
#endif /* __TEST_PERIPHERAL_UART_H__ */
\ No newline at end of file
__error_check(ret, "test_peripheral_io_uart_peripheral_uart_write_n1");
ret = test_peripheral_io_uart_peripheral_uart_write_n2();
__error_check(ret, "test_peripheral_io_uart_peripheral_uart_write_n2");
+ ret = test_peripheral_io_uart_peripheral_uart_flush_p();
+ __error_check(ret, "test_peripheral_io_uart_peripheral_uart_flush_p");
+ ret = test_peripheral_io_uart_peripheral_uart_flush_n();
+ __error_check(ret, "test_peripheral_io_uart_peripheral_uart_flush_n");
+ ret = test_peripheral_io_uart_peripheral_uart_drain_p();
+ __error_check(ret, "test_peripheral_io_uart_peripheral_uart_drain_p");
+ ret = test_peripheral_io_uart_peripheral_uart_drain_n();
+ __error_check(ret, "test_peripheral_io_uart_peripheral_uart_drain_n");
__test_performance_for_function("open/close", test_peripheral_io_uart_peripheral_uart_open_p);
}
return PERIPHERAL_ERROR_NONE;
}
+
+int test_peripheral_io_uart_peripheral_uart_flush_p(void)
+{
+ int ret = PERIPHERAL_ERROR_NONE;
+
+ peripheral_uart_h uart_h = NULL;
+
+ if (g_feature == false) {
+ ret = peripheral_uart_flush(uart_h);
+ if (ret != PERIPHERAL_ERROR_NOT_SUPPORTED)
+ return ret;
+
+ } else {
+ ret = peripheral_uart_open(port, &uart_h);
+ if (ret != PERIPHERAL_ERROR_NONE)
+ return ret;
+
+ ret = peripheral_uart_flush(uart_h);
+ if (ret != PERIPHERAL_ERROR_NONE && ret != PERIPHERAL_ERROR_TRY_AGAIN) {
+ peripheral_uart_close(uart_h);
+ return ret;
+ }
+
+ ret = peripheral_uart_close(uart_h);
+ if (ret != PERIPHERAL_ERROR_NONE)
+ return ret;
+ }
+
+ return PERIPHERAL_ERROR_NONE;
+}
+
+int test_peripheral_io_uart_peripheral_uart_flush_n(void)
+{
+ int ret = PERIPHERAL_ERROR_NONE;
+
+ if (g_feature == false) {
+ ret = peripheral_uart_flush(NULL);
+ if (ret != PERIPHERAL_ERROR_NOT_SUPPORTED)
+ return ret;
+
+ } else {
+ ret = peripheral_uart_flush(NULL);
+ if (ret != PERIPHERAL_ERROR_INVALID_PARAMETER) {
+ return ret;
+ }
+ }
+
+ return PERIPHERAL_ERROR_NONE;
+}
+
+int test_peripheral_io_uart_peripheral_uart_drain_p(void)
+{
+ int ret = PERIPHERAL_ERROR_NONE;
+
+ peripheral_uart_h uart_h = NULL;
+
+ if (g_feature == false) {
+ ret = peripheral_uart_drain(uart_h);
+ if (ret != PERIPHERAL_ERROR_NOT_SUPPORTED)
+ return ret;
+
+ } else {
+ ret = peripheral_uart_open(port, &uart_h);
+ if (ret != PERIPHERAL_ERROR_NONE)
+ return ret;
+
+ ret = peripheral_uart_drain(uart_h);
+ if (ret != PERIPHERAL_ERROR_NONE && ret != PERIPHERAL_ERROR_TRY_AGAIN) {
+ peripheral_uart_close(uart_h);
+ return ret;
+ }
+
+ ret = peripheral_uart_close(uart_h);
+ if (ret != PERIPHERAL_ERROR_NONE)
+ return ret;
+ }
+
+ return PERIPHERAL_ERROR_NONE;
+}
+
+int test_peripheral_io_uart_peripheral_uart_drain_n(void)
+{
+ int ret = PERIPHERAL_ERROR_NONE;
+
+ if (g_feature == false) {
+ ret = peripheral_uart_drain(NULL);
+ if (ret != PERIPHERAL_ERROR_NOT_SUPPORTED)
+ return ret;
+
+ } else {
+ ret = peripheral_uart_drain(NULL);
+ if (ret != PERIPHERAL_ERROR_INVALID_PARAMETER) {
+ return ret;
+ }
+ }
+
+ return PERIPHERAL_ERROR_NONE;
+}