3 int main(int argc,char **argv)
11 void *t1 = (void*)123;
13 vmlog_thread_log *tlog;
14 vmlog_log_entry logent;
16 vml = vmlog_log_new(NULL,1);
19 vmlog_file_open(&(vml->idxfile),"TESTIDX",vmlogTruncateAppend);
20 vmlog_file_open(&(vml->strfile),"TESTSTR",vmlogTruncateAppend);
22 tlog = vmlog_get_thread_log(vml,t1);
23 vmlog_file_open(&(tlog->logfile),"TESTLOG1",vmlogTruncateAppend);
25 vmlog_log_enter(vml,t1,"foo(II)V",8);
26 name = "bar(Ljava/lang/Object;)Z"; vmlog_log_enter(vml,t1,name,strlen(name));
27 name = "bar(Ljava/lang/Object;)Z"; vmlog_log_leave(vml,t1,name,strlen(name));
28 vmlog_log_leave(vml,t1,"foo(II)V",8);
33 fd = open("TESTLOG1",O_RDONLY);
37 IS(st.st_size,4*sizeof(vmlog_log_entry));
39 r = read(fd,&logent,sizeof(vmlog_log_entry));
40 TRUE(r == sizeof(vmlog_log_entry));
41 IS(logent.tag,VMLOG_TAG_ENTER);
43 r = read(fd,&logent,sizeof(vmlog_log_entry));
44 TRUE(r == sizeof(vmlog_log_entry));
45 IS(logent.tag,VMLOG_TAG_ENTER);
47 r = read(fd,&logent,sizeof(vmlog_log_entry));
48 TRUE(r == sizeof(vmlog_log_entry));
49 IS(logent.tag,VMLOG_TAG_LEAVE);
51 r = read(fd,&logent,sizeof(vmlog_log_entry));
52 TRUE(r == sizeof(vmlog_log_entry));
53 IS(logent.tag,VMLOG_TAG_LEAVE);
60 /* vim: noet ts=8 sw=8