File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ {
2+ "files.associations" : {
3+ "*.ejs" : " html" ,
4+ "memtool.h" : " c"
5+ }
6+ }
Original file line number Diff line number Diff line change 22#include <stdio.h>
33#include "memtool.h"
44
5+ #include "memtool.h"
6+
7+ process_id_t get_process_id () {
8+ #ifdef PLATFORM_WINDOWS
9+ return GetCurrentProcessId ();
10+ #else
11+ return getpid ();
12+ #endif
13+ }
14+
15+
516void test_open_process () {
6- process_id_t pid = 1 ; // Example PID
17+ printf ("Testing open_process...\n" );
18+ //grab own process id
19+ process_id_t pid = get_process_id ();
20+ printf ("PID: %d\n" , pid );
721 ProcessHandle * handle = open_process (pid );
22+ printf ("Handle: %p\n" , handle );
823 assert (handle != NULL );
924 close_process (handle );
1025}
1126
1227void test_read_process_maps () {
13- process_id_t pid = 1 ; // Example PID
28+ printf ("Testing read_process_maps...\n" );
29+ process_id_t pid = get_process_id ();
30+ printf ("PID: %d\n" , pid );
1431 ProcessMap * map = read_process_maps (pid );
32+ printf ("Map: %p\n" , map );
1533 assert (map != NULL );
1634 free (map );
1735}
You can’t perform that action at this time.
0 commit comments