(t *testing.T)
| 169 | } |
| 170 | |
| 171 | func TestStackwalkDecoratorFlush(t *testing.T) { |
| 172 | q := NewQueue(50, false, true) |
| 173 | q.RegisterListener(&DummyListener{}) |
| 174 | cd := NewStackwalkDecorator(q) |
| 175 | defer cd.Stop() |
| 176 | |
| 177 | e := &Event{ |
| 178 | Type: CreateFile, |
| 179 | Tid: 2484, |
| 180 | PID: 859, |
| 181 | CPU: 1, |
| 182 | Seq: 2, |
| 183 | Name: "CreateFile", |
| 184 | Timestamp: time.Now(), |
| 185 | Category: File, |
| 186 | Params: Params{ |
| 187 | params.FileObject: {Name: params.FileObject, Type: params.Uint64, Value: uint64(12456738026482168384)}, |
| 188 | params.FilePath: {Name: params.FilePath, Type: params.UnicodeString, Value: "C:\\Windows\\system32\\user32.dll"}, |
| 189 | params.FileType: {Name: params.FileType, Type: params.AnsiString, Value: "file"}, |
| 190 | params.FileOperation: {Name: params.FileOperation, Type: params.Enum, Value: uint32(1), Enum: fs.FileCreateDispositions}, |
| 191 | }, |
| 192 | } |
| 193 | |
| 194 | cd.Push(e) |
| 195 | assert.Len(t, cd.buckets[e.StackID()], 1) |
| 196 | time.Sleep(time.Millisecond * 3100) |
| 197 | |
| 198 | evt := <-q.Events() |
| 199 | assert.Len(t, cd.buckets[e.StackID()], 0) |
| 200 | assert.Equal(t, CreateFile, evt.Type) |
| 201 | assert.False(t, evt.Params.Contains(params.Callstack)) |
| 202 | } |
nothing calls this directly
no test coverage detected