aboutsummaryrefslogtreecommitdiff
path: root/OperationLimiterTest.cpp
diff options
context:
space:
mode:
authorMike Yu <yumike@google.com>2022-06-23 12:52:35 +0000
committerMike Yu <yumike@google.com>2022-06-23 13:07:24 +0000
commita3b3e8866c99334674eefa5d4424e568e9d73100 (patch)
treef87360ef176f51390bb55d7b70056c746a3e7fa1 /OperationLimiterTest.cpp
parentbb674bbd0f1ebfd6098ceeaeabf330021eece71c (diff)
Test: Change to use test fixtures and log test life cycle
Some of the tests are defined by TEST() that can't be logged. Change to use TEST_F(). Bug: 223731710 Test: atest Test: doh_ffi_test Change-Id: Ic249256dccc27b65508a7bad8189c22c6e9c4fd1
Diffstat (limited to 'OperationLimiterTest.cpp')
-rw-r--r--OperationLimiterTest.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/OperationLimiterTest.cpp b/OperationLimiterTest.cpp
index 9d2dadb3..2eeb887e 100644
--- a/OperationLimiterTest.cpp
+++ b/OperationLimiterTest.cpp
@@ -18,10 +18,14 @@
#include <gtest/gtest-spi.h>
+#include "resolv_test_base.h"
+
namespace android {
namespace netdutils {
-TEST(OperationLimiter, limits) {
+class OperationLimiterTest : public ResolvTestBase {};
+
+TEST_F(OperationLimiterTest, limits) {
OperationLimiter<int> limiter(3);
EXPECT_TRUE(limiter.start(42));
@@ -50,7 +54,7 @@ TEST(OperationLimiter, limits) {
limiter.finish(42);
}
-TEST(OperationLimiter, finishWithoutStart) {
+TEST_F(OperationLimiterTest, finishWithoutStart) {
OperationLimiter<int> limiter(1);
// Will output a LOG(FATAL_WITHOUT_ABORT), but we have no way to probe this.
@@ -61,7 +65,7 @@ TEST(OperationLimiter, finishWithoutStart) {
EXPECT_FALSE(limiter.start(42));
}
-TEST(OperationLimiter, destroyWithActiveOperations) {
+TEST_F(OperationLimiterTest, destroyWithActiveOperations) {
// The death message doesn't seem to be captured on Android.
EXPECT_DEBUG_DEATH(
{