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

Side by Side Diff: webkit/glue/cpp_variant_unittest.cc

Issue 6300001: Clang: enable -Wbool-conversions and -Wunused-variables on Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase, undo indent Created 9 years, 11 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 | « views/view_unittest.cc ('k') | webkit/plugins/npapi/webplugin_impl_unittest.cc » ('j') | 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "base/compiler_specific.h" 5 #include "base/compiler_specific.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 #include "third_party/WebKit/WebKit/chromium/public/WebBindings.h" 7 #include "third_party/WebKit/WebKit/chromium/public/WebBindings.h"
8 #include "webkit/glue/cpp_variant.h" 8 #include "webkit/glue/cpp_variant.h"
9 9
10 using WebKit::WebBindings; 10 using WebKit::WebBindings;
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 cpp.Set(np); 266 cpp.Set(np);
267 // Use this or WebBindings::releaseObject but NOT both. 267 // Use this or WebBindings::releaseObject but NOT both.
268 WebBindings::releaseVariantValue(&np); 268 WebBindings::releaseVariantValue(&np);
269 CheckObject(cpp); 269 CheckObject(cpp);
270 } 270 }
271 271
272 TEST(CppVariantTest, SetsSimpleTypesAndValues) { 272 TEST(CppVariantTest, SetsSimpleTypesAndValues) {
273 CppVariant cpp; 273 CppVariant cpp;
274 cpp.Set(true); 274 cpp.Set(true);
275 EXPECT_EQ(NPVariantType_Bool, cpp.type); 275 EXPECT_EQ(NPVariantType_Bool, cpp.type);
276 EXPECT_EQ(true, cpp.value.boolValue); 276 EXPECT_TRUE(cpp.value.boolValue);
277 277
278 cpp.Set(5); 278 cpp.Set(5);
279 EXPECT_EQ(NPVariantType_Int32, cpp.type); 279 EXPECT_EQ(NPVariantType_Int32, cpp.type);
280 EXPECT_EQ(5, cpp.value.intValue); 280 EXPECT_EQ(5, cpp.value.intValue);
281 281
282 cpp.Set(1.234); 282 cpp.Set(1.234);
283 EXPECT_EQ(NPVariantType_Double, cpp.type); 283 EXPECT_EQ(NPVariantType_Double, cpp.type);
284 EXPECT_EQ(1.234, cpp.value.doubleValue); 284 EXPECT_EQ(1.234, cpp.value.doubleValue);
285 285
286 // C string 286 // C string
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 EXPECT_FALSE(cpp.isDouble()); 417 EXPECT_FALSE(cpp.isDouble());
418 EXPECT_FALSE(cpp.isNumber()); 418 EXPECT_FALSE(cpp.isNumber());
419 EXPECT_FALSE(cpp.isString()); 419 EXPECT_FALSE(cpp.isString());
420 EXPECT_FALSE(cpp.isVoid()); 420 EXPECT_FALSE(cpp.isVoid());
421 EXPECT_FALSE(cpp.isNull()); 421 EXPECT_FALSE(cpp.isNull());
422 EXPECT_FALSE(cpp.isEmpty()); 422 EXPECT_FALSE(cpp.isEmpty());
423 EXPECT_TRUE(cpp.isObject()); 423 EXPECT_TRUE(cpp.isObject());
424 WebBindings::releaseObject(obj); 424 WebBindings::releaseObject(obj);
425 CheckObject(cpp); 425 CheckObject(cpp);
426 } 426 }
OLDNEW
« no previous file with comments | « views/view_unittest.cc ('k') | webkit/plugins/npapi/webplugin_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698