File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 16
16
<projectUrl >https://github.com/SiddiqSoft/WinProcessInfo</projectUrl >
17
17
<requireLicenseAcceptance >true</requireLicenseAcceptance >
18
18
<license type =" expression" >BSD-3-Clause</license >
19
- <icon >docs\Siddiq-Software-Avatar.png</icon >
20
- <readme >docs\README.md</readme >
19
+ <icon >docs\Siddiq-Software-Avatar.png</icon >
20
+ <readme >docs\README.md</readme >
21
21
<releaseNotes ></releaseNotes >
22
22
<copyright >Copyright (c) 2021 Siddiq Software LLC</copyright >
23
23
<!-- Dependencies -->
36
36
<file src =" ..\src\*.hpp" target =" build\native\include\siddiqsoft\" />
37
37
<file src =" Siddiq-Software-Avatar.png" target =" docs\" />
38
38
<file src =" ..\README.md" target =" docs\" />
39
-
39
+
40
40
<!-- MSBuild .targets files -->
41
41
<file src =" SiddiqSoft.WinProcessInfo.targets" target =" build\native" />
42
42
</files >
Original file line number Diff line number Diff line change @@ -76,3 +76,22 @@ TEST(examples, Example2)
76
76
EXPECT_TRUE (false ) << e.what (); // if we throw then the test fails.
77
77
}
78
78
}
79
+
80
+ TEST (examples, Example3)
81
+ {
82
+ try
83
+ {
84
+ siddiqsoft::WinProcessInfo procInfo;
85
+
86
+ // We must perform the snapshot to obtain memory and thread usage
87
+ procInfo.snapshot ();
88
+
89
+ std::cerr << nlohmann::json (procInfo).dump (4 ) << std::endl;
90
+ EXPECT_EQ (GetCurrentProcessId (), nlohmann::json (procInfo).value (" processId" , 0 ));
91
+ std::cerr << std::format (" {} - Contents:{}\n " , __func__, procInfo);
92
+ }
93
+ catch (std::exception& e)
94
+ {
95
+ EXPECT_TRUE (false ) << e.what (); // if we throw then the test fails.
96
+ }
97
+ }
You can’t perform that action at this time.
0 commit comments