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

Side by Side Diff: base/android/jni_array_unittest.cc

Issue 1543293003: Switch to standard integer types in base/android/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « base/android/jni_array.cc ('k') | base/android/jni_generator/jni_generator_helper.h » ('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) 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 "base/android/jni_array.h" 5 #include "base/android/jni_array.h"
6 6
7 #include <stddef.h>
7 #include <stdint.h> 8 #include <stdint.h>
8 9
9 #include <limits> 10 #include <limits>
10 11
11 #include "base/android/jni_android.h" 12 #include "base/android/jni_android.h"
12 #include "base/android/scoped_java_ref.h" 13 #include "base/android/scoped_java_ref.h"
14 #include "base/macros.h"
13 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
14 16
15 namespace base { 17 namespace base {
16 namespace android { 18 namespace android {
17 19
18 TEST(JniArray, BasicConversions) { 20 TEST(JniArray, BasicConversions) {
19 const uint8_t kBytes[] = {0, 1, 2, 3}; 21 const uint8_t kBytes[] = {0, 1, 2, 3};
20 const size_t kLen = arraysize(kBytes); 22 const size_t kLen = arraysize(kBytes);
21 JNIEnv* env = AttachCurrentThread(); 23 JNIEnv* env = AttachCurrentThread();
22 ScopedJavaLocalRef<jbyteArray> bytes = ToJavaByteArray(env, kBytes, kLen); 24 ScopedJavaLocalRef<jbyteArray> bytes = ToJavaByteArray(env, kBytes, kLen);
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 293
292 EXPECT_EQ(kNumItems, out.size()); 294 EXPECT_EQ(kNumItems, out.size());
293 CheckIntArrayConversion(env, int_array0, out[0], kLen0); 295 CheckIntArrayConversion(env, int_array0, out[0], kLen0);
294 CheckIntArrayConversion(env, int_array1, out[1], kLen1); 296 CheckIntArrayConversion(env, int_array1, out[1], kLen1);
295 CheckIntArrayConversion(env, int_array2, out[2], kLen2); 297 CheckIntArrayConversion(env, int_array2, out[2], kLen2);
296 CheckIntArrayConversion(env, int_array3, out[3], kLen3); 298 CheckIntArrayConversion(env, int_array3, out[3], kLen3);
297 } 299 }
298 300
299 } // namespace android 301 } // namespace android
300 } // namespace base 302 } // namespace base
OLDNEW
« no previous file with comments | « base/android/jni_array.cc ('k') | base/android/jni_generator/jni_generator_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698