Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: base/win/event_trace_consumer_unittest.cc

Issue 401423002: clang/win: Fix calling delete[] on void* in base. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Unit tests for event trace consumer base class. 5 // Unit tests for event trace consumer base class.
6 #include "base/win/event_trace_consumer.h" 6 #include "base/win/event_trace_consumer.h"
7 7
8 #include <list> 8 #include <list>
9 9
10 #include <objbase.h> 10 #include <objbase.h>
(...skipping 27 matching lines...) Expand all
38 } 38 }
39 39
40 ~TestConsumer() { 40 ~TestConsumer() {
41 ClearQueue(); 41 ClearQueue();
42 sank_event_.Close(); 42 sank_event_.Close();
43 } 43 }
44 44
45 void ClearQueue() { 45 void ClearQueue() {
46 for (EventQueue::const_iterator it(events_.begin()), end(events_.end()); 46 for (EventQueue::const_iterator it(events_.begin()), end(events_.end());
47 it != end; ++it) { 47 it != end; ++it) {
48 delete[] it->MofData; 48 delete[] reinterpret_cast<char*>(it->MofData);
49 } 49 }
50 50
51 events_.clear(); 51 events_.clear();
52 } 52 }
53 53
54 static void EnqueueEvent(EVENT_TRACE* event) { 54 static void EnqueueEvent(EVENT_TRACE* event) {
55 events_.push_back(*event); 55 events_.push_back(*event);
56 EVENT_TRACE& back = events_.back(); 56 EVENT_TRACE& back = events_.back();
57 57
58 if (event->MofData != NULL && event->MofLength != 0) { 58 if (event->MofData != NULL && event->MofLength != 0) {
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 return; 356 return;
357 } 357 }
358 ASSERT_HRESULT_SUCCEEDED(hr) << "RoundTripEvent failed"; 358 ASSERT_HRESULT_SUCCEEDED(hr) << "RoundTripEvent failed";
359 ASSERT_TRUE(trace != NULL); 359 ASSERT_TRUE(trace != NULL);
360 ASSERT_EQ(sizeof(kData), trace->MofLength); 360 ASSERT_EQ(sizeof(kData), trace->MofLength);
361 ASSERT_STREQ(kData, reinterpret_cast<const char*>(trace->MofData)); 361 ASSERT_STREQ(kData, reinterpret_cast<const char*>(trace->MofData));
362 } 362 }
363 363
364 } // namespace win 364 } // namespace win
365 } // namespace base 365 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698