• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1  /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include <dlfcn.h>
17 #include <hwext/gtest-ext.h>
18 #include <hwext/gtest-tag.h>
19 
20 #include "memory_data_plugin.h"
21 #include "plugin_module_api.h"
22 #include "smaps_stats.h"
23 
24 using namespace testing::ext;
25 
26 namespace {
27 const std::string DEFAULT_TEST_PATH("/data/local/tmp/utresources/");
28 const int PERCENT = 100;
29 
30 class SmapsStatsTest : public ::testing::Test {
31 public:
SetUpTestCase()32     static void SetUpTestCase() {}
TearDownTestCase()33     static void TearDownTestCase()
34     {
35         if (access(DEFAULT_TEST_PATH.c_str(), F_OK) == 0) {
36             std::string str = "rm -rf " + DEFAULT_TEST_PATH;
37             system(str.c_str());
38         }
39     }
40 
SetUp()41     void SetUp() {}
TearDown()42     void TearDown() {}
43 };
44 
45 /**
46  * @tc.name: smaps stats
47  * @tc.desc: test ParseMapHead
48  * @tc.type: FUNC
49  */
50 HWTEST_F(SmapsStatsTest, TestParseMapHead1, TestSize.Level1)
51 {
52     std::string line = "00400000-00409000 \n";
53     SmapsStats plugin;
54     MapPiecesInfo expectMappic = {0x00400000, 0x00409000, ""};
55     MapPiecesInfo targetMappic = {0};
56     SmapsHeadInfo expectSmapsHeadInfo = {"00400000", "00409000", "", "", -1};
57     SmapsHeadInfo smapsHeadInfo = {};
58     ASSERT_FALSE(plugin.ParseMapHead(line, targetMappic, smapsHeadInfo));
59     // test result
60     EXPECT_EQ(expectMappic.startAddr, targetMappic.startAddr);
61     EXPECT_EQ(expectMappic.endAddr, targetMappic.endAddr);
62     EXPECT_STREQ(expectMappic.name.c_str(), targetMappic.name.c_str());
63     EXPECT_STREQ(expectSmapsHeadInfo.startAddrStr.c_str(), smapsHeadInfo.startAddrStr.c_str());
64     EXPECT_STREQ(expectSmapsHeadInfo.startAddrStr.c_str(), smapsHeadInfo.startAddrStr.c_str());
65     EXPECT_STREQ(expectSmapsHeadInfo.permission.c_str(), smapsHeadInfo.permission.c_str());
66     EXPECT_STREQ(expectSmapsHeadInfo.path.c_str(), smapsHeadInfo.path.c_str());
67     EXPECT_EQ(expectSmapsHeadInfo.iNode, smapsHeadInfo.iNode);
68 }
69 
70 /**
71  * @tc.name: smaps stats
72  * @tc.desc: test ParseMapHead
73  * @tc.type: FUNC
74  */
75 HWTEST_F(SmapsStatsTest, TestParseMapHead2, TestSize.Level1)
76 {
77     std::string line = "00400000-00409000 r-xp\n";
78     SmapsStats plugin;
79     MapPiecesInfo expectMappic = {0x00400000, 0x00409000, ""};
80     MapPiecesInfo targetMappic = {0};
81     SmapsHeadInfo expectSmapsHeadInfo = {"00400000", "00409000", "", "", -1};
82     SmapsHeadInfo smapsHeadInfo = {};
83     ASSERT_FALSE(plugin.ParseMapHead(line, targetMappic, smapsHeadInfo));
84     // test result
85     EXPECT_EQ(expectMappic.startAddr, targetMappic.startAddr);
86     EXPECT_EQ(expectMappic.endAddr, targetMappic.endAddr);
87     EXPECT_STREQ(expectMappic.name.c_str(), targetMappic.name.c_str());
88     EXPECT_STREQ(expectSmapsHeadInfo.startAddrStr.c_str(), smapsHeadInfo.startAddrStr.c_str());
89     EXPECT_STREQ(expectSmapsHeadInfo.startAddrStr.c_str(), smapsHeadInfo.startAddrStr.c_str());
90     EXPECT_STREQ(expectSmapsHeadInfo.permission.c_str(), smapsHeadInfo.permission.c_str());
91     EXPECT_STREQ(expectSmapsHeadInfo.path.c_str(), smapsHeadInfo.path.c_str());
92     EXPECT_EQ(expectSmapsHeadInfo.iNode, smapsHeadInfo.iNode);
93 }
94 
95 /**
96  * @tc.name: smaps stats
97  * @tc.desc: test ParseMapHead
98  * @tc.type: FUNC
99  */
100 HWTEST_F(SmapsStatsTest, TestParseMapHead3, TestSize.Level1)
101 {
102     std::string line = "00400000-00409000 r-xp 00000000\n";
103     SmapsStats plugin;
104     MapPiecesInfo expectMappic = {0x00400000, 0x00409000, ""};
105     MapPiecesInfo targetMappic = {0};
106     SmapsHeadInfo expectSmapsHeadInfo = {"00400000", "00409000", "r-x", "", -1};
107     SmapsHeadInfo smapsHeadInfo = {};
108     ASSERT_FALSE(plugin.ParseMapHead(line, targetMappic, smapsHeadInfo));
109     // test result
110     EXPECT_EQ(expectMappic.startAddr, targetMappic.startAddr);
111     EXPECT_EQ(expectMappic.endAddr, targetMappic.endAddr);
112     EXPECT_STREQ(expectMappic.name.c_str(), targetMappic.name.c_str());
113     EXPECT_STREQ(expectSmapsHeadInfo.startAddrStr.c_str(), smapsHeadInfo.startAddrStr.c_str());
114     EXPECT_STREQ(expectSmapsHeadInfo.startAddrStr.c_str(), smapsHeadInfo.startAddrStr.c_str());
115     EXPECT_STREQ(expectSmapsHeadInfo.permission.c_str(), smapsHeadInfo.permission.c_str());
116     EXPECT_STREQ(expectSmapsHeadInfo.path.c_str(), smapsHeadInfo.path.c_str());
117     EXPECT_EQ(expectSmapsHeadInfo.iNode, smapsHeadInfo.iNode);
118 }
119 
120 /**
121  * @tc.name: smaps stats
122  * @tc.desc: test ParseMapHead
123  * @tc.type: FUNC
124  */
125 HWTEST_F(SmapsStatsTest, TestParseMapHead4, TestSize.Level1)
126 {
127     std::string line = "00400000-00409000 r-xp 00000000 fc:00\n";
128     SmapsStats plugin;
129     MapPiecesInfo expectMappic = {0x00400000, 0x00409000, ""};
130     MapPiecesInfo targetMappic = {0};
131     SmapsHeadInfo expectSmapsHeadInfo = {"00400000", "00409000", "r-x", "", -1};
132     SmapsHeadInfo smapsHeadInfo = {};
133     ASSERT_FALSE(plugin.ParseMapHead(line, targetMappic, smapsHeadInfo));
134     // test result
135     EXPECT_EQ(expectMappic.startAddr, targetMappic.startAddr);
136     EXPECT_EQ(expectMappic.endAddr, targetMappic.endAddr);
137     EXPECT_STREQ(expectMappic.name.c_str(), targetMappic.name.c_str());
138     EXPECT_STREQ(expectSmapsHeadInfo.startAddrStr.c_str(), smapsHeadInfo.startAddrStr.c_str());
139     EXPECT_STREQ(expectSmapsHeadInfo.startAddrStr.c_str(), smapsHeadInfo.startAddrStr.c_str());
140     EXPECT_STREQ(expectSmapsHeadInfo.permission.c_str(), smapsHeadInfo.permission.c_str());
141     EXPECT_STREQ(expectSmapsHeadInfo.path.c_str(), smapsHeadInfo.path.c_str());
142     EXPECT_EQ(expectSmapsHeadInfo.iNode, smapsHeadInfo.iNode);
143 }
144 
145 /**
146  * @tc.name: smaps stats
147  * @tc.desc: test ParseMapHead
148  * @tc.type: FUNC
149  */
150 HWTEST_F(SmapsStatsTest, TestParseMapHead5, TestSize.Level1)
151 {
152     std::string line = "00400000-00409000 r-xp 00000000 fc:00 426998\n";
153     SmapsStats plugin;
154     MapPiecesInfo expectMappic = {0x00400000, 0x00409000, ""};
155     MapPiecesInfo targetMappic = {0};
156     SmapsHeadInfo expectSmapsHeadInfo = {"00400000", "00409000", "r-x", "", -1};
157     SmapsHeadInfo smapsHeadInfo = {};
158     ASSERT_FALSE(plugin.ParseMapHead(line, targetMappic, smapsHeadInfo));
159     // test result
160     EXPECT_EQ(expectMappic.startAddr, targetMappic.startAddr);
161     EXPECT_EQ(expectMappic.endAddr, targetMappic.endAddr);
162     EXPECT_STREQ(expectMappic.name.c_str(), targetMappic.name.c_str());
163     EXPECT_STREQ(expectSmapsHeadInfo.startAddrStr.c_str(), smapsHeadInfo.startAddrStr.c_str());
164     EXPECT_STREQ(expectSmapsHeadInfo.startAddrStr.c_str(), smapsHeadInfo.startAddrStr.c_str());
165     EXPECT_STREQ(expectSmapsHeadInfo.permission.c_str(), smapsHeadInfo.permission.c_str());
166     EXPECT_STREQ(expectSmapsHeadInfo.path.c_str(), smapsHeadInfo.path.c_str());
167     EXPECT_EQ(expectSmapsHeadInfo.iNode, smapsHeadInfo.iNode);
168 }
169 
170 /**
171  * @tc.name: smaps stats
172  * @tc.desc: test ParseMapHead
173  * @tc.type: FUNC
174  */
175 HWTEST_F(SmapsStatsTest, TestParseMapHead6, TestSize.Level1)
176 {
177     std::string line = "00400000-00409000 r-xp 00000000 fc:00 426998  /usr/lib/gvfs/gvfsd-http\n";
178     SmapsStats plugin;
179     MapPiecesInfo expectMappic = {0x00400000, 0x00409000, "/usr/lib/gvfs/gvfsd-http"};
180     MapPiecesInfo targetMappic = {0};
181     SmapsHeadInfo expectSmapsHeadInfo = {"00400000", "00409000", "r-x", "/usr/lib/gvfs/gvfsd-http", 426998};
182     SmapsHeadInfo smapsHeadInfo = {};
183     ASSERT_TRUE(plugin.ParseMapHead(line, targetMappic, smapsHeadInfo));
184     // test result
185     EXPECT_EQ(expectMappic.startAddr, targetMappic.startAddr);
186     EXPECT_EQ(expectMappic.endAddr, targetMappic.endAddr);
187     EXPECT_STREQ(expectMappic.name.c_str(), targetMappic.name.c_str());
188     EXPECT_STREQ(expectSmapsHeadInfo.startAddrStr.c_str(), smapsHeadInfo.startAddrStr.c_str());
189     EXPECT_STREQ(expectSmapsHeadInfo.startAddrStr.c_str(), smapsHeadInfo.startAddrStr.c_str());
190     EXPECT_STREQ(expectSmapsHeadInfo.permission.c_str(), smapsHeadInfo.permission.c_str());
191     EXPECT_STREQ(expectSmapsHeadInfo.path.c_str(), smapsHeadInfo.path.c_str());
192     EXPECT_EQ(expectSmapsHeadInfo.iNode, smapsHeadInfo.iNode);
193 }
194 
195 /**
196  * @tc.name: smaps stats
197  * @tc.desc: test ParseMapHead
198  * @tc.type: FUNC
199  */
200 HWTEST_F(SmapsStatsTest, TestParseMapHead7, TestSize.Level1)
201 {
202     std::string line = "00400000-00409000 r-xp 00000000 fc:00 426998  /usr/lib/gvfs/gvfsd-http";
203     SmapsStats plugin;
204     MapPiecesInfo expectMappic = {0x00400000, 0x00409000, "/usr/lib/gvfs/gvfsd-htt"};
205     MapPiecesInfo targetMappic = {0};
206     SmapsHeadInfo expectSmapsHeadInfo = {"00400000", "00409000", "r-x", "/usr/lib/gvfs/gvfsd-htt", 426998};
207     SmapsHeadInfo smapsHeadInfo = {};
208     ASSERT_TRUE(plugin.ParseMapHead(line, targetMappic, smapsHeadInfo));
209     // test result
210     EXPECT_EQ(expectMappic.startAddr, targetMappic.startAddr);
211     EXPECT_EQ(expectMappic.endAddr, targetMappic.endAddr);
212     EXPECT_STREQ(expectMappic.name.c_str(), targetMappic.name.c_str());
213     EXPECT_STREQ(expectSmapsHeadInfo.startAddrStr.c_str(), smapsHeadInfo.startAddrStr.c_str());
214     EXPECT_STREQ(expectSmapsHeadInfo.startAddrStr.c_str(), smapsHeadInfo.startAddrStr.c_str());
215     EXPECT_STREQ(expectSmapsHeadInfo.permission.c_str(), smapsHeadInfo.permission.c_str());
216     EXPECT_STREQ(expectSmapsHeadInfo.path.c_str(), smapsHeadInfo.path.c_str());
217     EXPECT_EQ(expectSmapsHeadInfo.iNode, smapsHeadInfo.iNode);
218 }
219 
220 /**
221  * @tc.name: smaps stats
222  * @tc.desc: test ParseMapHead
223  * @tc.type: FUNC
224  */
225 HWTEST_F(SmapsStatsTest, TestParseMapHead8, TestSize.Level1)
226 {
227     std::string line = "564045dbe000-564045ddf000 rw-p 00000000 00:00 0                          [heap]";
228     SmapsStats plugin;
229     MapPiecesInfo expectMappic = {0x564045dbe000, 0x564045ddf000, "[heap"};
230     MapPiecesInfo targetMappic = {0};
231     SmapsHeadInfo expectSmapsHeadInfo = {"564045dbe000", "564045ddf000", "rw-", "[heap", 0};
232     SmapsHeadInfo smapsHeadInfo = {};
233     ASSERT_TRUE(plugin.ParseMapHead(line, targetMappic, smapsHeadInfo));
234     // test result
235     EXPECT_EQ(expectMappic.startAddr, targetMappic.startAddr);
236     EXPECT_EQ(expectMappic.endAddr, targetMappic.endAddr);
237     EXPECT_STREQ(expectMappic.name.c_str(), targetMappic.name.c_str());
238     EXPECT_STREQ(expectSmapsHeadInfo.startAddrStr.c_str(), smapsHeadInfo.startAddrStr.c_str());
239     EXPECT_STREQ(expectSmapsHeadInfo.startAddrStr.c_str(), smapsHeadInfo.startAddrStr.c_str());
240     EXPECT_STREQ(expectSmapsHeadInfo.permission.c_str(), smapsHeadInfo.permission.c_str());
241     EXPECT_STREQ(expectSmapsHeadInfo.path.c_str(), smapsHeadInfo.path.c_str());
242     EXPECT_EQ(expectSmapsHeadInfo.iNode, smapsHeadInfo.iNode);
243 }
244 
245 /**
246  * @tc.name: smaps stats
247  * @tc.desc: test GetMemUsageField
248  * @tc.type: FUNC
249  */
250 HWTEST_F(SmapsStatsTest, TestGetMemUsageField1, TestSize.Level1)
251 {
252     std::string line = "Pss:                   4 kB";
253     SmapsStats plugin;
254     MemUsageInfo expect = {0, 0, 4};
255     MemUsageInfo target = {0};
256 
257     ASSERT_TRUE(plugin.GetMemUsageField(line, target));
258     // test result
259     EXPECT_EQ(expect.vss, target.vss);
260     EXPECT_EQ(expect.rss, target.rss);
261     EXPECT_EQ(expect.pss, target.pss);
262     EXPECT_EQ(expect.uss, target.uss);
263     EXPECT_EQ(expect.swap, target.swap);
264     EXPECT_EQ(expect.swapPss, target.swapPss);
265     EXPECT_EQ(expect.privateClean, target.privateClean);
266     EXPECT_EQ(expect.privateDirty, target.privateDirty);
267     EXPECT_EQ(expect.sharedClean, target.sharedClean);
268     EXPECT_EQ(expect.sharedDirty, target.sharedDirty);
269 }
270 
271 /**
272  * @tc.name: smaps stats
273  * @tc.desc: test GetMemUsageField
274  * @tc.type: FUNC
275  */
276 HWTEST_F(SmapsStatsTest, TestGetMemUsageField2, TestSize.Level1)
277 {
278     std::string line = "Private_Clean:         0 kB";
279     SmapsStats plugin;
280     MemUsageInfo expect = {0};
281     MemUsageInfo target = {0};
282 
283     ASSERT_TRUE(plugin.GetMemUsageField(line, target));
284     // test result
285     EXPECT_EQ(expect.vss, target.vss);
286     EXPECT_EQ(expect.rss, target.rss);
287     EXPECT_EQ(expect.pss, target.pss);
288     EXPECT_EQ(expect.uss, target.uss);
289     EXPECT_EQ(expect.swap, target.swap);
290     EXPECT_EQ(expect.swapPss, target.swapPss);
291     EXPECT_EQ(expect.privateClean, target.privateClean);
292     EXPECT_EQ(expect.privateDirty, target.privateDirty);
293     EXPECT_EQ(expect.sharedClean, target.sharedClean);
294     EXPECT_EQ(expect.sharedDirty, target.sharedDirty);
295 }
296 
297 /**
298  * @tc.name: smaps stats
299  * @tc.desc: test GetMemUsageField
300  * @tc.type: FUNC
301  */
302 HWTEST_F(SmapsStatsTest, TestGetMemUsageField3, TestSize.Level1)
303 {
304     std::string line = "Private_Dirty:         4 kB";
305     SmapsStats plugin;
306     uint64_t num = 4;
307     MemUsageInfo expect = {0};
308     MemUsageInfo target = {0};
309 
310     ASSERT_TRUE(plugin.GetMemUsageField(line, target));
311     // test result
312     expect.privateDirty = num;
313     expect.uss += num;
314     EXPECT_EQ(expect.vss, target.vss);
315     EXPECT_EQ(expect.rss, target.rss);
316     EXPECT_EQ(expect.pss, target.pss);
317     EXPECT_EQ(expect.uss, target.uss);
318     EXPECT_EQ(expect.swap, target.swap);
319     EXPECT_EQ(expect.swapPss, target.swapPss);
320     EXPECT_EQ(expect.privateClean, target.privateClean);
321     EXPECT_EQ(expect.privateDirty, target.privateDirty);
322     EXPECT_EQ(expect.sharedClean, target.sharedClean);
323     EXPECT_EQ(expect.sharedDirty, target.sharedDirty);
324 }
325 
326 /**
327  * @tc.name: smaps stats
328  * @tc.desc: test GetMemUsageField
329  * @tc.type: FUNC
330  */
331 HWTEST_F(SmapsStatsTest, TestGetMemUsageField4, TestSize.Level1)
332 {
333     std::string line = "Size:                  4 kB";
334     SmapsStats plugin;
335     uint64_t num = 4;
336     MemUsageInfo expect = {0};
337     MemUsageInfo target = {0};
338 
339     ASSERT_TRUE(plugin.GetMemUsageField(line, target));
340     // test result
341     expect.vss = num;
342     EXPECT_EQ(expect.vss, target.vss);
343     EXPECT_EQ(expect.rss, target.rss);
344     EXPECT_EQ(expect.pss, target.pss);
345     EXPECT_EQ(expect.uss, target.uss);
346     EXPECT_EQ(expect.swap, target.swap);
347     EXPECT_EQ(expect.swapPss, target.swapPss);
348     EXPECT_EQ(expect.privateClean, target.privateClean);
349     EXPECT_EQ(expect.privateDirty, target.privateDirty);
350     EXPECT_EQ(expect.sharedClean, target.sharedClean);
351     EXPECT_EQ(expect.sharedDirty, target.sharedDirty);
352 }
353 
354 /**
355  * @tc.name: smaps stats
356  * @tc.desc: test GetMemUsageField
357  * @tc.type: FUNC
358  */
359 HWTEST_F(SmapsStatsTest, TestGetMemUsageField5, TestSize.Level1)
360 {
361     std::string line = "Shared_Clean:          0 kB";
362     SmapsStats plugin;
363     MemUsageInfo expect = {0};
364     MemUsageInfo target = {0};
365 
366     ASSERT_TRUE(plugin.GetMemUsageField(line, target));
367     // test result
368     EXPECT_EQ(expect.vss, target.vss);
369     EXPECT_EQ(expect.rss, target.rss);
370     EXPECT_EQ(expect.pss, target.pss);
371     EXPECT_EQ(expect.uss, target.uss);
372     EXPECT_EQ(expect.swap, target.swap);
373     EXPECT_EQ(expect.swapPss, target.swapPss);
374     EXPECT_EQ(expect.privateClean, target.privateClean);
375     EXPECT_EQ(expect.privateDirty, target.privateDirty);
376     EXPECT_EQ(expect.sharedClean, target.sharedClean);
377     EXPECT_EQ(expect.sharedDirty, target.sharedDirty);
378 }
379 
380 /**
381  * @tc.name: smaps stats
382  * @tc.desc: test GetMemUsageField
383  * @tc.type: FUNC
384  */
385 HWTEST_F(SmapsStatsTest, TestGetMemUsageField6, TestSize.Level1)
386 {
387     std::string line = "Shared_Dirty:          0 kB";
388     SmapsStats plugin;
389     MemUsageInfo expect = {0};
390     MemUsageInfo target = {0};
391 
392     ASSERT_TRUE(plugin.GetMemUsageField(line, target));
393     // test result
394     EXPECT_EQ(expect.vss, target.vss);
395     EXPECT_EQ(expect.rss, target.rss);
396     EXPECT_EQ(expect.pss, target.pss);
397     EXPECT_EQ(expect.uss, target.uss);
398     EXPECT_EQ(expect.swap, target.swap);
399     EXPECT_EQ(expect.swapPss, target.swapPss);
400     EXPECT_EQ(expect.privateClean, target.privateClean);
401     EXPECT_EQ(expect.privateDirty, target.privateDirty);
402     EXPECT_EQ(expect.sharedClean, target.sharedClean);
403     EXPECT_EQ(expect.sharedDirty, target.sharedDirty);
404 }
405 
406 /**
407  * @tc.name: smaps stats
408  * @tc.desc: test GetMemUsageField
409  * @tc.type: FUNC
410  */
411 HWTEST_F(SmapsStatsTest, TestGetMemUsageField7, TestSize.Level1)
412 {
413     std::string line = "Swap:                  0 kB";
414     SmapsStats plugin;
415     MemUsageInfo expect = {0};
416     MemUsageInfo target = {0};
417 
418     ASSERT_TRUE(plugin.GetMemUsageField(line, target));
419     // test result
420     EXPECT_EQ(expect.vss, target.vss);
421     EXPECT_EQ(expect.rss, target.rss);
422     EXPECT_EQ(expect.pss, target.pss);
423     EXPECT_EQ(expect.uss, target.uss);
424     EXPECT_EQ(expect.swap, target.swap);
425     EXPECT_EQ(expect.swapPss, target.swapPss);
426     EXPECT_EQ(expect.privateClean, target.privateClean);
427     EXPECT_EQ(expect.privateDirty, target.privateDirty);
428     EXPECT_EQ(expect.sharedClean, target.sharedClean);
429     EXPECT_EQ(expect.sharedDirty, target.sharedDirty);
430 }
431 
432 /**
433  * @tc.name: smaps stats
434  * @tc.desc: test GetMemUsageField
435  * @tc.type: FUNC
436  */
437 HWTEST_F(SmapsStatsTest, TestGetMemUsageField8, TestSize.Level1)
438 {
439     std::string line = "SwapPss:               0 kB";
440     SmapsStats plugin;
441     MemUsageInfo expect = {0};
442     MemUsageInfo target = {0};
443 
444     ASSERT_TRUE(plugin.GetMemUsageField(line, target));
445     // test result
446     EXPECT_EQ(expect.vss, target.vss);
447     EXPECT_EQ(expect.rss, target.rss);
448     EXPECT_EQ(expect.pss, target.pss);
449     EXPECT_EQ(expect.uss, target.uss);
450     EXPECT_EQ(expect.swap, target.swap);
451     EXPECT_EQ(expect.swapPss, target.swapPss);
452     EXPECT_EQ(expect.privateClean, target.privateClean);
453     EXPECT_EQ(expect.privateDirty, target.privateDirty);
454     EXPECT_EQ(expect.sharedClean, target.sharedClean);
455     EXPECT_EQ(expect.sharedDirty, target.sharedDirty);
456 }
457 
458 /**
459  * @tc.name: smaps stats
460  * @tc.desc: test GetMemUsageField
461  * @tc.type: FUNC
462  */
463 HWTEST_F(SmapsStatsTest, TestGetMemUsageField9, TestSize.Level1)
464 {
465     std::string line = "Rss:                   4 kB";
466     SmapsStats plugin;
467     uint64_t num = 4;
468     MemUsageInfo expect = {0};
469     MemUsageInfo target = {0};
470 
471     ASSERT_TRUE(plugin.GetMemUsageField(line, target));
472     // test result
473     expect.rss = num;
474     EXPECT_EQ(expect.vss, target.vss);
475     EXPECT_EQ(expect.rss, target.rss);
476     EXPECT_EQ(expect.pss, target.pss);
477     EXPECT_EQ(expect.uss, target.uss);
478     EXPECT_EQ(expect.swap, target.swap);
479     EXPECT_EQ(expect.swapPss, target.swapPss);
480     EXPECT_EQ(expect.privateClean, target.privateClean);
481     EXPECT_EQ(expect.privateDirty, target.privateDirty);
482     EXPECT_EQ(expect.sharedClean, target.sharedClean);
483     EXPECT_EQ(expect.sharedDirty, target.sharedDirty);
484 }
485 
486 /**
487  * @tc.name: smaps stats
488  * @tc.desc: test GetMemUsageField
489  * @tc.type: FUNC
490  */
491 HWTEST_F(SmapsStatsTest, TestGetMemUsageField10, TestSize.Level1)
492 {
493     std::string line = "VmFlags: rd ex mr mw me dw sd";
494     SmapsStats plugin;
495     MemUsageInfo expect = {0};
496     MemUsageInfo target = {0};
497 
498     ASSERT_TRUE(plugin.GetMemUsageField(line, target));
499     // test result
500     EXPECT_EQ(expect.vss, target.vss);
501     EXPECT_EQ(expect.rss, target.rss);
502     EXPECT_EQ(expect.pss, target.pss);
503     EXPECT_EQ(expect.uss, target.uss);
504     EXPECT_EQ(expect.swap, target.swap);
505     EXPECT_EQ(expect.swapPss, target.swapPss);
506     EXPECT_EQ(expect.privateClean, target.privateClean);
507     EXPECT_EQ(expect.privateDirty, target.privateDirty);
508     EXPECT_EQ(expect.sharedClean, target.sharedClean);
509     EXPECT_EQ(expect.sharedDirty, target.sharedDirty);
510 }
511 
512 /**
513  * @tc.name: smaps stats
514  * @tc.desc: test GetMemUsageField
515  * @tc.type: FUNC
516  */
517 HWTEST_F(SmapsStatsTest, TestGetMemUsageField11, TestSize.Level1)
518 {
519     std::string line = "Anonymous:             0 kB";
520     SmapsStats plugin;
521     MemUsageInfo expect = {0};
522     MemUsageInfo target = {0};
523 
524     ASSERT_TRUE(plugin.GetMemUsageField(line, target));
525     // test result
526     EXPECT_EQ(expect.vss, target.vss);
527     EXPECT_EQ(expect.rss, target.rss);
528     EXPECT_EQ(expect.pss, target.pss);
529     EXPECT_EQ(expect.uss, target.uss);
530     EXPECT_EQ(expect.swap, target.swap);
531     EXPECT_EQ(expect.swapPss, target.swapPss);
532     EXPECT_EQ(expect.privateClean, target.privateClean);
533     EXPECT_EQ(expect.privateDirty, target.privateDirty);
534     EXPECT_EQ(expect.sharedClean, target.sharedClean);
535     EXPECT_EQ(expect.sharedDirty, target.sharedDirty);
536 }
537 
538 /**
539  * @tc.name: smaps stats
540  * @tc.desc: test GetMemUsageField
541  * @tc.type: FUNC
542  */
543 HWTEST_F(SmapsStatsTest, TestAbnormalGetMemUsageField1, TestSize.Level1)
544 {
545     std::string line = "Pss:";
546     SmapsStats plugin;
547     MemUsageInfo expect = {0};
548     MemUsageInfo target = {0};
549 
550     ASSERT_TRUE(plugin.GetMemUsageField(line, target));
551     // test result
552     EXPECT_EQ(expect.vss, target.vss);
553     EXPECT_EQ(expect.rss, target.rss);
554     EXPECT_EQ(expect.pss, target.pss);
555     EXPECT_EQ(expect.uss, target.uss);
556     EXPECT_EQ(expect.swap, target.swap);
557     EXPECT_EQ(expect.swapPss, target.swapPss);
558     EXPECT_EQ(expect.privateClean, target.privateClean);
559     EXPECT_EQ(expect.privateDirty, target.privateDirty);
560     EXPECT_EQ(expect.sharedClean, target.sharedClean);
561     EXPECT_EQ(expect.sharedDirty, target.sharedDirty);
562 }
563 
564 /**
565  * @tc.name: smaps stats
566  * @tc.desc: test GetMemUsageField
567  * @tc.type: FUNC
568  */
569 HWTEST_F(SmapsStatsTest, TestAbnormalGetMemUsageField2, TestSize.Level1)
570 {
571     std::string line = "Pss";
572     SmapsStats plugin;
573     MemUsageInfo expect = {0};
574     MemUsageInfo target = {0};
575 
576     ASSERT_FALSE(plugin.GetMemUsageField(line, target));
577     // test result
578     EXPECT_EQ(expect.vss, target.vss);
579     EXPECT_EQ(expect.rss, target.rss);
580     EXPECT_EQ(expect.pss, target.pss);
581     EXPECT_EQ(expect.uss, target.uss);
582     EXPECT_EQ(expect.swap, target.swap);
583     EXPECT_EQ(expect.swapPss, target.swapPss);
584     EXPECT_EQ(expect.privateClean, target.privateClean);
585     EXPECT_EQ(expect.privateDirty, target.privateDirty);
586     EXPECT_EQ(expect.sharedClean, target.sharedClean);
587     EXPECT_EQ(expect.sharedDirty, target.sharedDirty);
588 }
589 
590 namespace {
591 const char* SMAPS_FORMAT = R"(5637ebe15000-5637ebe16000 r-xp 00000000 08:01 4587541                    test/run
592 Size:                  4 kB
593 Rss:                   4 kB
594 Pss:                   4 kB
595 Shared_Clean:          0 kB
596 Shared_Dirty:          0 kB
597 Private_Clean:         4 kB
598 Private_Dirty:         0 kB
599 Anonymous:             0 kB
600 Swap:                  0 kB
601 SwapPss:               0 kB
602 LazyFree:              1 kB
603 AnonHugePages:         1 kB
604 ShmemPmdMapped:        1 kB
605 FilePmdMapped:        1 kB
606 Shared_Hugetlb:        1 kB
607 Private_Hugetlb:       1 kB
608 Locked:                1 kB
609 THPeligible:           1
610 VmFlags: rd ex mr mw me dw sd
611 5637ec015000-5637ec016000 r--p 00000000 08:01 4587541                    test/run
612 Size:                  4 kB
613 Rss:                   4 kB
614 Pss:                   4 kB
615 Shared_Clean:          0 kB
616 Shared_Dirty:          0 kB
617 Private_Clean:         0 kB
618 Private_Dirty:         4 kB
619 Anonymous:             4 kB
620 Swap:                  0 kB
621 SwapPss:               0 kB
622 VmFlags: rd mr mw me dw ac sd
623 5637ec016000-5637ec017000 rw-p 00001000 08:01 4587541                    test/run
624 Size:                  4 kB
625 Rss:                   4 kB
626 Pss:                   4 kB
627 Shared_Clean:          0 kB
628 Shared_Dirty:          0 kB
629 Private_Clean:         0 kB
630 Private_Dirty:         4 kB
631 Anonymous:             4 kB
632 Swap:                  0 kB
633 SwapPss:               0 kB
634 VmFlags: rd wr mr mw me dw ac sd
635 5637ec60f000-5637ec630000 rw-p 00000000 00:00 0                          [heap]
636 Size:                132 kB
637 Rss:                   4 kB
638 Pss:                   4 kB
639 Shared_Clean:          0 kB
640 Shared_Dirty:          0 kB
641 Private_Clean:         0 kB
642 Private_Dirty:         4 kB
643 Anonymous:             4 kB
644 Swap:                  0 kB
645 SwapPss:               0 kB
646 VmFlags: rd wr mr mw me ac sd
647 7fa384a9e000-7fa384c85000 r-xp 00000000 08:01 929310                     /lib/x86_64-linux-gnu/libc-2.27.so
648 Size:               1948 kB
649 Rss:                1200 kB
650 Pss:                  20 kB
651 Shared_Clean:       1200 kB
652 Shared_Dirty:          0 kB
653 Private_Clean:         0 kB
654 Private_Dirty:         0 kB
655 Anonymous:             0 kB
656 Swap:                  0 kB
657 SwapPss:               0 kB
658 VmFlags: rd ex mr mw me sd
659 7fa384c85000-7fa384e85000 ---p 001e7000 08:01 929310                     /lib/x86_64-linux-gnu/libc-2.27.so
660 Size:               2048 kB
661 Rss:                   0 kB
662 Pss:                   0 kB
663 Shared_Clean:          0 kB
664 Shared_Dirty:          0 kB
665 Private_Clean:         0 kB
666 Private_Dirty:         0 kB
667 Anonymous:             0 kB
668 Swap:                  0 kB
669 SwapPss:               0 kB
670 VmFlags: mr mw me sd
671 7fa384e85000-7fa384e89000 r--p 001e7000 08:01 929310                     /lib/x86_64-linux-gnu/libc-2.27.so
672 Size:                 16 kB
673 Rss:                  16 kB
674 Pss:                  16 kB
675 Shared_Clean:          0 kB
676 Shared_Dirty:          0 kB
677 Private_Clean:         0 kB
678 Private_Dirty:        16 kB
679 Anonymous:            16 kB
680 Swap:                  0 kB
681 SwapPss:               0 kB
682 VmFlags: rd mr mw me ac sd
683 7fa384e89000-7fa384e8b000 rw-p 001eb000 08:01 929310                     /lib/x86_64-linux-gnu/libc-2.27.so
684 Size:                  8 kB
685 Rss:                   8 kB
686 Pss:                   8 kB
687 Shared_Clean:          0 kB
688 Shared_Dirty:          0 kB
689 Private_Clean:         0 kB
690 Private_Dirty:         8 kB
691 Anonymous:             8 kB
692 Swap:                  0 kB
693 SwapPss:               0 kB
694 VmFlags: rd wr mr mw me ac sd
695 7fa384e8b000-7fa384e8f000 rw-p 00000000 00:00 0
696 Size:                 16 kB
697 Rss:                  12 kB
698 Pss:                  12 kB
699 Shared_Clean:          0 kB
700 Shared_Dirty:          0 kB
701 Private_Clean:         0 kB
702 Private_Dirty:        12 kB
703 Anonymous:            12 kB
704 Swap:                  0 kB
705 SwapPss:               0 kB
706 VmFlags: rd wr mr mw me ac sd
707 7fa384e8f000-7fa384eb8000 r-xp 00000000 08:01 927476                     /lib/x86_64-linux-gnu/ld-2.27.so
708 Size:                164 kB
709 Rss:                 164 kB
710 Pss:                   3 kB
711 Shared_Clean:        164 kB
712 Shared_Dirty:          0 kB
713 Private_Clean:         0 kB
714 Private_Dirty:         0 kB
715 Anonymous:             0 kB
716 Swap:                  0 kB
717 SwapPss:               0 kB
718 VmFlags: rd ex mr mw me dw sd
719 7fa3850a1000-7fa3850a3000 rw-p 00000000 00:00 0
720 Size:                  8 kB
721 Rss:                   8 kB
722 Pss:                   8 kB
723 Shared_Clean:          0 kB
724 Shared_Dirty:          0 kB
725 Private_Clean:         0 kB
726 Private_Dirty:         8 kB
727 Anonymous:             8 kB
728 Swap:                  0 kB
729 SwapPss:               0 kB
730 VmFlags: rd wr mr mw me ac sd
731 7fa3850b8000-7fa3850b9000 r--p 00029000 08:01 927476                     /lib/x86_64-linux-gnu/ld-2.27.so
732 Size:                  4 kB
733 Rss:                   4 kB
734 Pss:                   4 kB
735 Shared_Clean:          0 kB
736 Shared_Dirty:          0 kB
737 Private_Clean:         0 kB
738 Private_Dirty:         4 kB
739 Anonymous:             4 kB
740 Swap:                  0 kB
741 SwapPss:               0 kB
742 VmFlags: rd mr mw me dw ac sd
743 7fa3850b9000-7fa3850ba000 rw-p 0002a000 08:01 927476                     /lib/x86_64-linux-gnu/ld-2.27.so
744 Size:                  4 kB
745 Rss:                   4 kB
746 Pss:                   4 kB
747 Shared_Clean:          0 kB
748 Shared_Dirty:          0 kB
749 Private_Clean:         0 kB
750 Private_Dirty:         4 kB
751 Anonymous:             4 kB
752 Swap:                  0 kB
753 SwapPss:               0 kB
754 VmFlags: rd wr mr mw me dw ac sd
755 7fa3850ba000-7fa3850bb000 rw-p 00000000 00:00 0
756 Size:                  4 kB
757 Rss:                   4 kB
758 Pss:                   4 kB
759 Shared_Clean:          0 kB
760 Shared_Dirty:          0 kB
761 Private_Clean:         0 kB
762 Private_Dirty:         4 kB
763 Anonymous:             4 kB
764 Swap:                  0 kB
765 SwapPss:               0 kB
766 VmFlags: rd wr mr mw me ac sd
767 7ffc54ec0000-7ffc54ee1000 rw-p 00000000 00:00 0                          [stack]
768 Size:                132 kB
769 Rss:                  12 kB
770 Pss:                  12 kB
771 Shared_Clean:          0 kB
772 Shared_Dirty:          0 kB
773 Private_Clean:         0 kB
774 Private_Dirty:        12 kB
775 Anonymous:            12 kB
776 Swap:                  0 kB
777 SwapPss:               0 kB
778 VmFlags: rd wr mr mw me gd ac
779 7ffc54f1c000-7ffc54f1f000 r--p 00000000 00:00 0                          [vvar]
780 Size:                 12 kB
781 Rss:                   0 kB
782 Pss:                   0 kB
783 Shared_Clean:          0 kB
784 Shared_Dirty:          0 kB
785 Private_Clean:         0 kB
786 Private_Dirty:         0 kB
787 Anonymous:             0 kB
788 Swap:                  0 kB
789 SwapPss:               0 kB
790 VmFlags: rd mr pf io de dd sd
791 7ffc54f1f000-7ffc54f20000 r-xp 00000000 00:00 0                          [vdso]
792 Size:                  4 kB
793 Rss:                   4 kB
794 Pss:                   0 kB
795 Shared_Clean:          4 kB
796 Shared_Dirty:          0 kB
797 Private_Clean:         0 kB
798 Private_Dirty:         0 kB
799 Anonymous:             0 kB
800 Swap:                  0 kB
801 SwapPss:               0 kB
802 VmFlags: rd ex mr mw me de sd
803 ffffffffff600000-ffffffffff601000 --xp 00000000 00:00 0                  [vsyscall]
804 Size:                  4 kB
805 MMUPageSize:           4 kB
806 Rss:                   0 kB
807 Pss:                   0 kB
808 Shared_Clean:          0 kB
809 Shared_Dirty:          0 kB
810 Private_Clean:         0 kB
811 Private_Dirty:         0 kB
812 Anonymous:             0 kB
813 Swap:                  0 kB
814 SwapPss:               0 kB
815 VmFlags: ex)";
816 }
817 
818 /**
819  * @tc.name: smaps stats
820  * @tc.desc: test ReadVmemareasFile
821  * @tc.type: FUNC
822  */
823 HWTEST_F(SmapsStatsTest, TestFramework, TestSize.Level1)
824 {
825     bool findMapHead = false;
826     MapPiecesInfo mappic = {0};
827     MemUsageInfo memusage = {0};
828     SmapsHeadInfo smapsHeadInfo = {};
829     // 3036, 4256, 288, 748, 0, 1388
830     uint64_t prevEnd = 0;
831     int prevHeap = 0;
832     uint64_t java_heap = 0;
833     uint64_t native_heap = 4;
834     uint64_t code = 48;
835     uint64_t stack = 12;
836     uint64_t graphics = 0;
837     uint64_t private_other = 20;
838     SmapsStats plugin;
839     std::istringstream ss(SMAPS_FORMAT);
840     std::string line;
841 
842     while (std::getline(ss, line)) {
843         line += '\n';
844         if (!findMapHead) {
845             ASSERT_TRUE(plugin.ParseMapHead(line, mappic, smapsHeadInfo));
846             findMapHead = true;
847             continue;
848         }
849         if (findMapHead) {
850             if (line.substr(0, strlen("VmFlags:")) != std::string("VmFlags:")) {
851                 ASSERT_TRUE(plugin.GetMemUsageField(line, memusage));
852                 continue;
853             }
854         }
855         plugin.CollectVmemAreasData(mappic, memusage, prevEnd, prevHeap);
856         findMapHead = false;
857     }
858     plugin.ReviseStatsData();
859 
860     // test result
861     EXPECT_EQ(java_heap, (uint64_t)(plugin.GetProcessJavaHeap()));
862     EXPECT_EQ(native_heap, (uint64_t)(plugin.GetProcessNativeHeap()));
863     EXPECT_EQ(code, (uint64_t)(plugin.GetProcessCode()));
864     EXPECT_EQ(stack, (uint64_t)(plugin.GetProcessStack()));
865     EXPECT_EQ(graphics, (uint64_t)(plugin.GetProcessGraphics()));
866     EXPECT_EQ(private_other, (uint64_t)(plugin.GetProcessPrivateOther()));
867 }
868 
869 /**
870  * @tc.name: smaps stats
871  * @tc.desc: test ParseMaps
872  * @tc.type: FUNC
873  */
874 HWTEST_F(SmapsStatsTest, TestFrameworkForPath, TestSize.Level1)
875 {
876     // 3036, 4256, 288, 748, 0, 1388
877     int pid = 2;
878     uint64_t java_heap = 0;
879     uint64_t native_heap = 4;
880     uint64_t code = 48;
881     uint64_t stack = 12;
882     uint64_t graphics = 0;
883     uint64_t private_other = 20;
884 
885     uint64_t size = 4;
886     uint64_t rss = 4;
887     uint64_t pss = 4;
888     uint64_t dirty = 0;
889     uint64_t swapper = 0;
890     double reside = static_cast<double>(rss) / size * PERCENT;
891     uint64_t dirty2 = 4;
892     uint64_t privateClean = 4;
893     uint64_t privateDirty = 0;
894     uint64_t sharedClean = 0;
895     uint64_t sharedDirty = 0;
896     uint64_t swap = 0;
897     uint64_t swapPss = 0;
898     uint64_t privateClean2 = 0;
899     uint64_t privateDirty2 = 4;
900     uint64_t sharedClean2 = 0;
901     uint64_t sharedDirty2 = 0;
902     uint64_t swap2 = 0;
903     uint64_t swapPss2 = 0;
904 
905     ASSERT_EQ(access(DEFAULT_TEST_PATH.c_str(), F_OK), 0);
906     SmapsStats plugin(DEFAULT_TEST_PATH + std::string("proc/"));
907 
908     // test result
909     ProcessMemoryInfo processMemoryInfo;
910     ASSERT_TRUE(plugin.ParseMaps(pid, processMemoryInfo, true, true));
911     EXPECT_EQ(java_heap, (uint64_t)(plugin.GetProcessJavaHeap()));
912     EXPECT_EQ(native_heap, (uint64_t)(plugin.GetProcessNativeHeap()));
913     EXPECT_EQ(code, (uint64_t)(plugin.GetProcessCode()));
914     EXPECT_EQ(stack, (uint64_t)(plugin.GetProcessStack()));
915     EXPECT_EQ(graphics, (uint64_t)(plugin.GetProcessGraphics()));
916     EXPECT_EQ(private_other, (uint64_t)(plugin.GetProcessPrivateOther()));
917 
918     EXPECT_EQ(size, processMemoryInfo.smapinfo(0).size());
919     EXPECT_EQ(rss, processMemoryInfo.smapinfo(0).rss());
920     EXPECT_EQ(pss, processMemoryInfo.smapinfo(0).pss());
921     EXPECT_EQ(dirty, processMemoryInfo.smapinfo(0).dirty());
922     EXPECT_EQ(swapper, processMemoryInfo.smapinfo(0).swapper());
923     EXPECT_EQ(privateClean, processMemoryInfo.smapinfo(0).private_clean());
924     EXPECT_EQ(privateDirty, processMemoryInfo.smapinfo(0).private_dirty());
925     EXPECT_EQ(sharedClean, processMemoryInfo.smapinfo(0).shared_clean());
926     EXPECT_EQ(sharedDirty, processMemoryInfo.smapinfo(0).shared_dirty());
927     EXPECT_EQ(swap, processMemoryInfo.smapinfo(0).swap());
928     EXPECT_EQ(swapPss, processMemoryInfo.smapinfo(0).swap_pss());
929     EXPECT_EQ(reside, processMemoryInfo.smapinfo(0).reside());
930     EXPECT_EQ(size, processMemoryInfo.smapinfo(1).size());
931     EXPECT_EQ(rss, processMemoryInfo.smapinfo(1).rss());
932     EXPECT_EQ(pss, processMemoryInfo.smapinfo(1).pss());
933     EXPECT_EQ(dirty2, processMemoryInfo.smapinfo(1).dirty());
934     EXPECT_EQ(swapper, processMemoryInfo.smapinfo(1).swapper());
935     EXPECT_EQ(privateClean2, processMemoryInfo.smapinfo(1).private_clean());
936     EXPECT_EQ(privateDirty2, processMemoryInfo.smapinfo(1).private_dirty());
937     EXPECT_EQ(sharedClean2, processMemoryInfo.smapinfo(1).shared_clean());
938     EXPECT_EQ(sharedDirty2, processMemoryInfo.smapinfo(1).shared_dirty());
939     EXPECT_EQ(swap2, processMemoryInfo.smapinfo(1).swap());
940     EXPECT_EQ(swapPss2, processMemoryInfo.smapinfo(1).swap_pss());
941     EXPECT_EQ(reside, processMemoryInfo.smapinfo(1).reside());
942 }
943 
944 /**
945  * @tc.name: smaps stats
946  * @tc.desc: test check framework
947  * @tc.type: FUNC
948  */
949 HWTEST_F(SmapsStatsTest, TestCheckFramework, TestSize.Level1)
950 {
951     bool findMapHead = false;
952     MapPiecesInfo mappic = {0};
953     MemUsageInfo memusage = {0};
954     SmapsHeadInfo smapsHeadInfo = {};
955     uint64_t prevEnd = 0;
956     int prevHeap = 0;
957     SmapsStats testPlugin;
958     int pid = 2;
959     std::istringstream ss(SMAPS_FORMAT);
960     std::string line;
961 
962     while (std::getline(ss, line)) {
963         line += '\n';
964         if (!findMapHead) {
965             ASSERT_TRUE(testPlugin.ParseMapHead(line, mappic, smapsHeadInfo));
966             findMapHead = true;
967             continue;
968         }
969         if (findMapHead) {
970             if (line.substr(0, strlen("VmFlags:")) != std::string("VmFlags:")) {
971                 ASSERT_TRUE(testPlugin.GetMemUsageField(line, memusage));
972                 continue;
973             }
974         }
975         testPlugin.CollectVmemAreasData(mappic, memusage, prevEnd, prevHeap);
976         findMapHead = false;
977     }
978     testPlugin.ReviseStatsData();
979 
980     ASSERT_EQ(access(DEFAULT_TEST_PATH.c_str(), F_OK), 0);
981     SmapsStats targetPlugin(DEFAULT_TEST_PATH + std::string("proc/"));
982     ProcessMemoryInfo processMemoryInfo;
983     ASSERT_TRUE(targetPlugin.ParseMaps(pid, processMemoryInfo, true, false));
984 
985     // test result
986     EXPECT_EQ(testPlugin.GetProcessJavaHeap(), targetPlugin.GetProcessJavaHeap());
987     EXPECT_EQ(testPlugin.GetProcessNativeHeap(), targetPlugin.GetProcessNativeHeap());
988     EXPECT_EQ(testPlugin.GetProcessCode(), targetPlugin.GetProcessCode());
989     EXPECT_EQ(testPlugin.GetProcessStack(), targetPlugin.GetProcessStack());
990     EXPECT_EQ(testPlugin.GetProcessGraphics(), targetPlugin.GetProcessGraphics());
991     EXPECT_EQ(testPlugin.GetProcessPrivateOther(), targetPlugin.GetProcessPrivateOther());
992 }
993 } // namespace