summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYi Chou <yich@google.com>2023-03-21 15:06:49 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-04-25 13:24:06 +0000
commit002af21a2bf462d5396ed0e552af08d47b9a5516 (patch)
tree58796c3104bbdff1b3e71f68663b44f0d97b13a3
parentfa58ebaa77b02f9e2b523d6d67458700d835ff15 (diff)
downloadchrome-ec-002af21a2bf462d5396ed0e552af08d47b9a5516.tar.gz
test/fpsensor_state: Convert to C++
BUG=b:248508087, b:234181908 TEST=make V=1 BOARD=bloonchipper -j TEST=make run-fpsensor_state BRANCH=none Change-Id: If61f4d5f66df397a06d1b5961b60f60b0810c75e Signed-off-by: Yi Chou <yich@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4354807 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
-rw-r--r--test/fpsensor_state.cc (renamed from test/fpsensor_state.c)20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/fpsensor_state.c b/test/fpsensor_state.cc
index 771523b33b..dd98fae244 100644
--- a/test/fpsensor_state.c
+++ b/test/fpsensor_state.cc
@@ -190,7 +190,7 @@ test_static int test_fp_command_read_match_secret_fail_fgr_less_than_zero(void)
{
/* Create invalid param with fgr < 0 */
struct ec_params_fp_read_match_secret test_match_secret = {
- .fgr = -1,
+ .fgr = static_cast<uint16_t>(-1),
};
TEST_ASSERT(test_send_host_command(EC_CMD_FP_READ_MATCH_SECRET, 0,
@@ -247,9 +247,9 @@ test_static int test_fp_command_read_match_secret_unmatched_fgr(void)
* readable state, and wrong template matched
*/
struct positive_match_secret_state test_state = {
- .deadline.val = 5000000,
- .readable = true,
.template_matched = unmatched_fgr,
+ .readable = true,
+ .deadline = { .val = 5000000 },
};
/* Test for the wrong matched finger state */
@@ -275,9 +275,9 @@ test_static int test_fp_command_read_match_secret_unreadable_state(void)
* unreadable state, and correct matched template
*/
struct positive_match_secret_state test_state = {
- .deadline.val = 5000000,
- .readable = false,
.template_matched = matched_fgr,
+ .readable = false,
+ .deadline = { .val = 5000000 },
};
/* Test for the unreadable state */
@@ -303,9 +303,9 @@ test_static int test_fp_command_read_match_secret_derive_fail(void)
* readable state, and correct template matched
*/
struct positive_match_secret_state test_state_1 = {
- .deadline.val = 5000000,
- .readable = true,
.template_matched = matched_fgr,
+ .readable = true,
+ .deadline = { .val = 5000000 },
};
positive_match_secret_state = test_state_1;
/* Set fp_positive_match_salt to the trivial value */
@@ -343,9 +343,9 @@ test_static int test_fp_command_read_match_secret_derive_succeed(void)
* readable state, and correct template matched
*/
struct positive_match_secret_state test_state_1 = {
- .deadline.val = 5000000,
- .readable = true,
.template_matched = matched_fgr,
+ .readable = true,
+ .deadline = { .val = 5000000 },
};
positive_match_secret_state = test_state_1;
/* Set fp_positive_match_salt to the trivial value */
@@ -377,7 +377,7 @@ test_static int test_fp_command_read_match_secret_derive_succeed(void)
return EC_SUCCESS;
}
-void run_test(int argc, const char **argv)
+extern "C" void run_test(int argc, const char **argv)
{
RUN_TEST(test_fp_enc_status_valid_flags);
RUN_TEST(test_fp_tpm_seed_not_set);