Skip to content

Commit

Permalink
CRAS: Use metrics_stub.cc in iodev unittest
Browse files Browse the repository at this point in the history
Let iodev unittest use the stubs in metrics_stub.cc instead of its own
duplicated ones. This is a functional no-op.

BUG=b:250544745
TEST="FEATURES=test USE=asan emerge-brya adhd"

Change-Id: I1f7cbc870f1d508f790a0e0ee237a53c2cd8c6c4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/adhd/+/5170387
Tested-by: chromeos-cop-builder@chromeos-cop.iam.gserviceaccount.com <chromeos-cop-builder@chromeos-cop.iam.gserviceaccount.com>
Reviewed-by: Curtis Malainey <cujomalainey@chromium.org>
Commit-Queue: Ben Zhang <benzh@chromium.org>
  • Loading branch information
bzhg authored and Chromeos LUCI committed Jan 10, 2024
1 parent 6d1f91f commit 7a5e7b2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 23 deletions.
1 change: 1 addition & 0 deletions cras/src/tests/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -1397,6 +1397,7 @@ cc_test(
name = "iodev_unittest",
srcs = [
":iodev_unittest.cc",
":metrics_stub.cc",
"//cras/src/common:cras_selinux_helper_stub.c",
"//cras/src/common:cras_shm.c",
"//cras/src/common:cras_string.c",
Expand Down
23 changes: 0 additions & 23 deletions cras/src/tests/iodev_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3167,29 +3167,6 @@ int cras_audio_thread_event_dev_overrun() {
return 0;
}

int cras_server_metrics_device_open_status(struct cras_iodev* iodev,
enum CRAS_DEVICE_OPEN_STATUS code) {
return 0;
}

int cras_server_metrics_device_runtime(struct cras_iodev* iodev) {
return 0;
}

int cras_server_metrics_device_volume(struct cras_iodev* iodev) {
return 0;
}

int cras_server_metrics_device_sample_rate(struct cras_iodev* iodev) {
return 0;
}

int cras_server_metrics_device_configure_time(struct cras_iodev* iodev,
struct timespec* beg,
struct timespec* end) {
return 0;
}

void ewma_power_init(struct ewma_power* ewma,
snd_pcm_format_t fmt,
unsigned int rate){};
Expand Down
14 changes: 14 additions & 0 deletions cras/src/tests/metrics_stub.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@ int cras_server_metrics_device_runtime(struct cras_iodev* iodev) {
return 0;
}

int cras_server_metrics_device_volume(struct cras_iodev* iodev) {
return 0;
}

int cras_server_metrics_device_sample_rate(struct cras_iodev* iodev) {
return 0;
}

int cras_server_metrics_device_configure_time(struct cras_iodev* iodev,
struct timespec* beg,
struct timespec* end) {
return 0;
}

int cras_server_metrics_highest_device_delay(
unsigned int hw_level,
unsigned int largest_cb_level,
Expand Down

0 comments on commit 7a5e7b2

Please sign in to comment.