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

Side by Side Diff: dbus/values_util_unittest.cc

Issue 10440131: dbus: Fix a crash in dbus_unittests that happens on Ubuntu 11.10 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 #include "dbus/values_util.h" 5 #include "dbus/values_util.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/float_util.h" 9 #include "base/float_util.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 21 matching lines...) Expand all
32 const int64 kInt64Value = -47; 32 const int64 kInt64Value = -47;
33 writer.AppendInt64(kInt64Value); 33 writer.AppendInt64(kInt64Value);
34 const uint64 kUint64Value = 48; 34 const uint64 kUint64Value = 48;
35 writer.AppendUint64(kUint64Value); 35 writer.AppendUint64(kUint64Value);
36 const double kDoubleValue = 4.9; 36 const double kDoubleValue = 4.9;
37 writer.AppendDouble(kDoubleValue); 37 writer.AppendDouble(kDoubleValue);
38 const std::string kStringValue = "fifty"; 38 const std::string kStringValue = "fifty";
39 writer.AppendString(kStringValue); 39 writer.AppendString(kStringValue);
40 const std::string kEmptyStringValue; 40 const std::string kEmptyStringValue;
41 writer.AppendString(kEmptyStringValue); 41 writer.AppendString(kEmptyStringValue);
42 const dbus::ObjectPath kObjectPathValue("ObjectPath"); 42 const dbus::ObjectPath kObjectPathValue("/ObjectPath");
43 writer.AppendObjectPath(kObjectPathValue); 43 writer.AppendObjectPath(kObjectPathValue);
44 44
45 dbus::MessageReader reader(response.get()); 45 dbus::MessageReader reader(response.get());
46 scoped_ptr<Value> value; 46 scoped_ptr<Value> value;
47 scoped_ptr<Value> expected_value; 47 scoped_ptr<Value> expected_value;
48 // Pop a byte. 48 // Pop a byte.
49 value.reset(dbus::PopDataAsValue(&reader)); 49 value.reset(dbus::PopDataAsValue(&reader));
50 ASSERT_TRUE(value.get() != NULL); 50 ASSERT_TRUE(value.get() != NULL);
51 expected_value.reset(Value::CreateIntegerValue(kByteValue)); 51 expected_value.reset(Value::CreateIntegerValue(kByteValue));
52 EXPECT_TRUE(value->Equals(expected_value.get())); 52 EXPECT_TRUE(value->Equals(expected_value.get()));
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 value.reset(dbus::PopDataAsValue(&reader)); 435 value.reset(dbus::PopDataAsValue(&reader));
436 ASSERT_TRUE(value.get() != NULL); 436 ASSERT_TRUE(value.get() != NULL);
437 EXPECT_TRUE(value->Equals(&kIntegerValue)); 437 EXPECT_TRUE(value->Equals(&kIntegerValue));
438 value.reset(dbus::PopDataAsValue(&reader)); 438 value.reset(dbus::PopDataAsValue(&reader));
439 ASSERT_TRUE(value.get() != NULL); 439 ASSERT_TRUE(value.get() != NULL);
440 EXPECT_TRUE(value->Equals(&kDoubleValue)); 440 EXPECT_TRUE(value->Equals(&kDoubleValue));
441 value.reset(dbus::PopDataAsValue(&reader)); 441 value.reset(dbus::PopDataAsValue(&reader));
442 ASSERT_TRUE(value.get() != NULL); 442 ASSERT_TRUE(value.get() != NULL);
443 EXPECT_TRUE(value->Equals(&kStringValue)); 443 EXPECT_TRUE(value->Equals(&kStringValue));
444 } 444 }
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