diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2016-07-12 15:00:07 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-07-15 21:39:20 -0700 |
commit | ff950203e0e5a2f774ebe8453624b311b5213e35 (patch) | |
tree | 3147ef21118bfc03bebbf3e0bbb7a30bded78593 /cts | |
parent | b783f0b991c43310675ab542c95902b65fffdbc4 (diff) | |
download | chrome-ec-ff950203e0e5a2f774ebe8453624b311b5213e35.tar.gz |
cts: Disambiguate enum cts_error_code
BUG=none
BRANCH=none
TEST=make -j buildall
Change-Id: I8008fcf8ea5a429ec6c3bd2cc59fe86f43d87ada
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/360180
Reviewed-by: Chris Chen <twothreecc@google.com>
Diffstat (limited to 'cts')
-rw-r--r-- | cts/common/cts_common.h | 8 | ||||
-rw-r--r-- | cts/common/dut_common.c | 2 | ||||
-rw-r--r-- | cts/common/th_common.c | 2 | ||||
-rw-r--r-- | cts/gpio/dut.c | 26 | ||||
-rw-r--r-- | cts/gpio/th.c | 24 |
5 files changed, 31 insertions, 31 deletions
diff --git a/cts/common/cts_common.h b/cts/common/cts_common.h index 4f0036039f..6233740167 100644 --- a/cts/common/cts_common.h +++ b/cts/common/cts_common.h @@ -19,10 +19,10 @@ * return a useful result (i.e. success, failure, etc) */ enum cts_error_code { - SUCCESS, - FAILURE, - BAD_SYNC, - UNKNOWN + CTS_SUCCESS, + CTS_ERROR_FAILURE, + CTS_ERROR_BAD_SYNC, + CTS_ERROR_UNKNOWN }; #endif diff --git a/cts/common/dut_common.c b/cts/common/dut_common.c index 9b0561eaa9..3c8a64b4da 100644 --- a/cts/common/dut_common.c +++ b/cts/common/dut_common.c @@ -28,5 +28,5 @@ enum cts_error_code sync(void) } while (input_level); gpio_set_level(GPIO_HANDSHAKE_OUTPUT, 0); - return UNKNOWN; + return CTS_ERROR_UNKNOWN; } diff --git a/cts/common/th_common.c b/cts/common/th_common.c index 8e9bd47fa3..d30d5ffe32 100644 --- a/cts/common/th_common.c +++ b/cts/common/th_common.c @@ -32,5 +32,5 @@ enum cts_error_code sync(void) input_level = gpio_get_level(GPIO_HANDSHAKE_INPUT); } while (input_level); - return SUCCESS; + return CTS_SUCCESS; } diff --git a/cts/gpio/dut.c b/cts/gpio/dut.c index 20248f2642..7858d81f57 100644 --- a/cts/gpio/dut.c +++ b/cts/gpio/dut.c @@ -13,7 +13,7 @@ enum cts_error_code sync_test(void) { - return SUCCESS; + return CTS_SUCCESS; } enum cts_error_code set_high_test(void) @@ -21,7 +21,7 @@ enum cts_error_code set_high_test(void) gpio_set_flags(GPIO_OUTPUT_TEST, GPIO_ODR_LOW); gpio_set_level(GPIO_OUTPUT_TEST, 1); msleep(READ_WAIT_TIME_MS*2); - return UNKNOWN; + return CTS_ERROR_UNKNOWN; } enum cts_error_code set_low_test(void) @@ -29,7 +29,7 @@ enum cts_error_code set_low_test(void) gpio_set_flags(GPIO_OUTPUT_TEST, GPIO_ODR_LOW); gpio_set_level(GPIO_OUTPUT_TEST, 0); msleep(READ_WAIT_TIME_MS*2); - return UNKNOWN; + return CTS_ERROR_UNKNOWN; } enum cts_error_code read_high_test(void) @@ -40,9 +40,9 @@ enum cts_error_code read_high_test(void) msleep(READ_WAIT_TIME_MS); level = gpio_get_level(GPIO_INPUT_TEST); if (level) - return SUCCESS; + return CTS_SUCCESS; else - return FAILURE; + return CTS_ERROR_FAILURE; } enum cts_error_code read_low_test(void) @@ -53,9 +53,9 @@ enum cts_error_code read_low_test(void) msleep(READ_WAIT_TIME_MS); level = gpio_get_level(GPIO_INPUT_TEST); if (!level) - return SUCCESS; + return CTS_SUCCESS; else - return FAILURE; + return CTS_ERROR_FAILURE; } enum cts_error_code od_read_high_test(void) @@ -66,9 +66,9 @@ enum cts_error_code od_read_high_test(void) msleep(READ_WAIT_TIME_MS); level = gpio_get_level(GPIO_OUTPUT_TEST); if (!level) - return SUCCESS; + return CTS_SUCCESS; else - return FAILURE; + return CTS_ERROR_FAILURE; } #include "cts_testlist.h" @@ -88,16 +88,16 @@ void cts_task(void) CPRINTS("Results:"); for (i = 0; i < CTS_TEST_ID_COUNT; i++) { switch (results[i]) { - case SUCCESS: + case CTS_SUCCESS: CPRINTS("%s) Passed", tests[i].name); break; - case FAILURE: + case CTS_ERROR_FAILURE: CPRINTS("%s) Failed", tests[i].name); break; - case BAD_SYNC: + case CTS_ERROR_BAD_SYNC: CPRINTS("%s) Bad sync", tests[i].name); break; - case UNKNOWN: + case CTS_ERROR_UNKNOWN: CPRINTS("%s) Test result unknown", tests[i].name); break; default: diff --git a/cts/gpio/th.c b/cts/gpio/th.c index ed1d582a75..3938f7951b 100644 --- a/cts/gpio/th.c +++ b/cts/gpio/th.c @@ -13,7 +13,7 @@ enum cts_error_code sync_test(void) { - return SUCCESS; + return CTS_SUCCESS; } enum cts_error_code set_high_test(void) @@ -24,9 +24,9 @@ enum cts_error_code set_high_test(void) msleep(READ_WAIT_TIME_MS); level = gpio_get_level(GPIO_INPUT_TEST); if (level) - return SUCCESS; + return CTS_SUCCESS; else - return FAILURE; + return CTS_ERROR_FAILURE; } enum cts_error_code set_low_test(void) @@ -37,9 +37,9 @@ enum cts_error_code set_low_test(void) msleep(READ_WAIT_TIME_MS); level = gpio_get_level(GPIO_INPUT_TEST); if (!level) - return SUCCESS; + return CTS_SUCCESS; else - return FAILURE; + return CTS_ERROR_FAILURE; } enum cts_error_code read_high_test(void) @@ -47,7 +47,7 @@ enum cts_error_code read_high_test(void) gpio_set_flags(GPIO_OUTPUT_TEST, GPIO_ODR_LOW); gpio_set_level(GPIO_OUTPUT_TEST, 1); msleep(READ_WAIT_TIME_MS*2); - return UNKNOWN; + return CTS_ERROR_UNKNOWN; } enum cts_error_code read_low_test(void) @@ -55,14 +55,14 @@ enum cts_error_code read_low_test(void) gpio_set_flags(GPIO_OUTPUT_TEST, GPIO_ODR_LOW); gpio_set_level(GPIO_OUTPUT_TEST, 0); msleep(READ_WAIT_TIME_MS*2); - return UNKNOWN; + return CTS_ERROR_UNKNOWN; } enum cts_error_code od_read_high_test(void) { gpio_set_flags(GPIO_INPUT_TEST, GPIO_OUTPUT | GPIO_ODR_LOW); msleep(READ_WAIT_TIME_MS*2); - return UNKNOWN; + return CTS_ERROR_UNKNOWN; } #include "cts_testlist.h" @@ -82,16 +82,16 @@ void cts_task(void) CPRINTS("Results:"); for (i = 0; i < CTS_TEST_ID_COUNT; i++) { switch (results[i]) { - case SUCCESS: + case CTS_SUCCESS: CPRINTS("%s) Passed", tests[i].name); break; - case FAILURE: + case CTS_ERROR_FAILURE: CPRINTS("%s) Failed", tests[i].name); break; - case BAD_SYNC: + case CTS_ERROR_BAD_SYNC: CPRINTS("%s) Bad sync", tests[i].name); break; - case UNKNOWN: + case CTS_ERROR_UNKNOWN: CPRINTS("%s) Test result unknown", tests[i].name); break; default: |