diff options
Diffstat (limited to 'cts/common')
-rw-r--r-- | cts/common/cts.rc | 10 | ||||
-rw-r--r-- | cts/common/cts_common.h | 8 | ||||
-rw-r--r-- | cts/common/cts_testlist.h | 2 | ||||
-rw-r--r-- | cts/common/dut_common.c | 4 | ||||
-rw-r--r-- | cts/common/dut_common.h | 2 | ||||
-rw-r--r-- | cts/common/th_common.c | 4 | ||||
-rw-r--r-- | cts/common/th_common.h | 2 |
7 files changed, 20 insertions, 12 deletions
diff --git a/cts/common/cts.rc b/cts/common/cts.rc new file mode 100644 index 0000000000..ec9bab76af --- /dev/null +++ b/cts/common/cts.rc @@ -0,0 +1,10 @@ +/* Copyright 2016 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* This file is included by cts_common.h as an enumeration of error codes. */ +CTS_RC_SUCCESS, +CTS_RC_FAILURE, +CTS_RC_BAD_SYNC, +CTS_RC_UNKNOWN diff --git a/cts/common/cts_common.h b/cts/common/cts_common.h index 6233740167..cfc347c3c2 100644 --- a/cts/common/cts_common.h +++ b/cts/common/cts_common.h @@ -18,11 +18,9 @@ /* In a single test, only one board can return unknown, the other must * return a useful result (i.e. success, failure, etc) */ -enum cts_error_code { - CTS_SUCCESS, - CTS_ERROR_FAILURE, - CTS_ERROR_BAD_SYNC, - CTS_ERROR_UNKNOWN + +enum cts_rc { + #include "cts.rc" }; #endif diff --git a/cts/common/cts_testlist.h b/cts/common/cts_testlist.h index 8f560d674d..a9a53c56f6 100644 --- a/cts/common/cts_testlist.h +++ b/cts/common/cts_testlist.h @@ -4,7 +4,7 @@ */ struct cts_test { - enum cts_error_code (*run)(void); + enum cts_rc (*run)(void); char *name; }; diff --git a/cts/common/dut_common.c b/cts/common/dut_common.c index 3c8a64b4da..bae4662fbc 100644 --- a/cts/common/dut_common.c +++ b/cts/common/dut_common.c @@ -12,7 +12,7 @@ /* Returns unknown because TH could potentially still get stuck * even if the DUT completes the sync */ -enum cts_error_code sync(void) +enum cts_rc sync(void) { int input_level; @@ -28,5 +28,5 @@ enum cts_error_code sync(void) } while (input_level); gpio_set_level(GPIO_HANDSHAKE_OUTPUT, 0); - return CTS_ERROR_UNKNOWN; + return CTS_RC_UNKNOWN; } diff --git a/cts/common/dut_common.h b/cts/common/dut_common.h index bd844499be..f812631633 100644 --- a/cts/common/dut_common.h +++ b/cts/common/dut_common.h @@ -8,6 +8,6 @@ #include "cts_common.h" -enum cts_error_code sync(void); +enum cts_rc sync(void); #endif diff --git a/cts/common/th_common.c b/cts/common/th_common.c index d30d5ffe32..bcab367658 100644 --- a/cts/common/th_common.c +++ b/cts/common/th_common.c @@ -12,7 +12,7 @@ /* Return SUCCESS if and only if we reach end of function * Returning success here means sync was successful */ -enum cts_error_code sync(void) +enum cts_rc sync(void) { int input_level; @@ -32,5 +32,5 @@ enum cts_error_code sync(void) input_level = gpio_get_level(GPIO_HANDSHAKE_INPUT); } while (input_level); - return CTS_SUCCESS; + return CTS_RC_SUCCESS; } diff --git a/cts/common/th_common.h b/cts/common/th_common.h index 0495e1048e..339375c78c 100644 --- a/cts/common/th_common.h +++ b/cts/common/th_common.h @@ -8,6 +8,6 @@ #include "cts_common.h" -enum cts_error_code sync(void); +enum cts_rc sync(void); #endif |