Snap for 7756953 from 704c3eee8ce4923947ed183ec59b88ec4f8720e8 to sc-v2-release
Change-Id: Iaaf07480f07d2d7a1e157ff90eddb6e5c1a65291
diff --git a/fuzzing/system_fuzzers/libwatchdog_perf_service/libwatchdog_perf_service_fuzzer.cpp b/fuzzing/system_fuzzers/libwatchdog_perf_service/libwatchdog_perf_service_fuzzer.cpp
index 4de3b0e..816945b 100644
--- a/fuzzing/system_fuzzers/libwatchdog_perf_service/libwatchdog_perf_service_fuzzer.cpp
+++ b/fuzzing/system_fuzzers/libwatchdog_perf_service/libwatchdog_perf_service_fuzzer.cpp
@@ -14,13 +14,15 @@
* limitations under the License.
*/
-#include "IoPerfCollection.h"
-#include "UidIoStats.h"
-
#include <android-base/file.h>
#include <fuzzer/FuzzedDataProvider.h>
+
#include <iostream>
+#include "IoPerfCollection.h"
+#include "ProcStat.h"
+#include "UidIoStatsCollector.h"
+
namespace android {
namespace automotive {
namespace watchdog {
@@ -41,7 +43,7 @@
std::string uidIoStatsSnapshot;
std::string procStatsSnapshot;
- // Prepare for UidIOStats data
+ // Prepare for UidIoStatsCollector data
int count = 0;
while (fdp.remaining_bytes() > (size / 2)) {
uint64_t val = fdp.ConsumeIntegral<uint64_t>();
@@ -76,18 +78,18 @@
}
if (uidIoStatsSnapshot.size() > 0 && procStatsSnapshot.size() > 0) {
- // Test UidIoStats
- TemporaryFile tf1;
- WriteStringToFile(uidIoStatsSnapshot, tf1.path);
- UidIoStats uidIoStats(tf1.path);
- assert(uidIoStats.enabled() == true);
- uidIoStats.collect();
- // Test ProcStats
- TemporaryFile tf2;
- WriteStringToFile(procStatsSnapshot, tf2.path);
- ProcStat procStat(tf2.path);
- assert(procStat.enabled() == true);
- procStat.collect();
+ // Test UidIoStatsCollector
+ TemporaryFile tf1;
+ WriteStringToFile(uidIoStatsSnapshot, tf1.path);
+ UidIoStatsCollector uidIoStatsCollector(tf1.path);
+ assert(uidIoStatsCollector.enabled() == true);
+ uidIoStatsCollector.collect();
+ // Test ProcStat
+ TemporaryFile tf2;
+ WriteStringToFile(procStatsSnapshot, tf2.path);
+ ProcStat procStat(tf2.path);
+ assert(procStat.enabled() == true);
+ procStat.collect();
}
return 0;
}