diff options
author | Tom Hughes <tomhughes@chromium.org> | 2019-09-23 16:04:20 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-02-07 21:27:04 +0000 |
commit | 1f5cc901ecc4026ebce41d4eeca602875ad7f4b6 (patch) | |
tree | 2c726c1f4096353e7dfa748197683b090ff678e5 /include/mock | |
parent | f74a01dc024fea492d970300c679aa6acaf2cacc (diff) | |
download | chrome-ec-1f5cc901ecc4026ebce41d4eeca602875ad7f4b6.tar.gz |
fpsensor: Refactor fpsensor tests into separate binaries
Using separate test binaries helps to prevent state from one set of
tests accidentally leaking into other tests. Ideally all unit tests
should be completely independent. Since there's a lot of global state in
the fpsensor code the separate test binaries should help prevent the
state from leaking across tests as we continue to add more.
Also, by having a 1:1 correspondence between test binaries and test
files, it's clearer what file (and functionality) each set of tests is
targeting.
BRANCH=none
BUG=none
TEST=make buildall -j
Change-Id: I937a5ffebfe61aa711efbbc2467d15d514fcfbae
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1832748
Commit-Queue: Yicheng Li <yichengli@chromium.org>
Tested-by: Yicheng Li <yichengli@chromium.org>
Reviewed-by: Yicheng Li <yichengli@chromium.org>
Diffstat (limited to 'include/mock')
-rw-r--r-- | include/mock/fpsensor_state_mock.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/mock/fpsensor_state_mock.h b/include/mock/fpsensor_state_mock.h new file mode 100644 index 0000000000..eafe01851c --- /dev/null +++ b/include/mock/fpsensor_state_mock.h @@ -0,0 +1,18 @@ +/* Copyright 2020 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. + */ + +#ifndef __MOCK_FPSENSOR_STATE_MOCK_H +#define __MOCK_FPSENSOR_STATE_MOCK_H + +#include <stdbool.h> +#include <stdint.h> +#include "ec_commands.h" + +extern const uint8_t default_fake_tpm_seed[FP_CONTEXT_TPM_BYTES]; + +int fpsensor_state_mock_set_tpm_seed( + const uint8_t tpm_seed[FP_CONTEXT_TPM_BYTES]); + +#endif /* __MOCK_FPSENSOR_STATE_MOCK_H */ |