binder_test - fix an atest aborting exception in stoi("")
The failure is:
I/ModuleListener: [16/57] BinderTest#GetSetProcSysNet fail:
No test results.
system/netd/tests/binder_test.cpp:973: Failure
Value of: mNetd->getProcSysNet(ipversion, category, tun, parameter, &value).isOk()
Actual: false
Expected: true
system/netd/tests/binder_test.cpp:974: Failure
Value of: value.empty()
Actual: true
Expected: false
terminating with uncaught exception of type std::invalid_argument: stoi: no conversion
AtestTradefedTestRunner
-----------------------
Runner encountered a critical failure. Skipping.
FAILURE: Traceback (most recent call last):
...
EventHandleError: Error: Saw TEST_MODULE_STARTED Start event and TEST_RUN_ENDED End event. These should be equal!
Test: ran tests
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I6de1be8321e1112b8dbec01170db905b814c06e9
diff --git a/tests/binder_test.cpp b/tests/binder_test.cpp
index b69acf8..47ac2f4 100644
--- a/tests/binder_test.cpp
+++ b/tests/binder_test.cpp
@@ -971,7 +971,7 @@
std::string value{};
EXPECT_TRUE(mNetd->getProcSysNet(ipversion, category, tun, parameter, &value).isOk());
- EXPECT_FALSE(value.empty());
+ ASSERT_FALSE(value.empty());
const int ival = std::stoi(value);
EXPECT_GT(ival, 0);
// Try doubling the parameter value (always best!).