#include "src/api/api-inl.h"
#include "src/base/strings.h"
#include "src/objects/js-array-buffer-inl.h"
#include "src/objects/js-array-buffer.h"
#include "test/cctest/heap/heap-utils.h"
#include "test/cctest/test-api.h"
Array;
Context;
Local;
Value;
namespace {
void CheckElementValue(i::Isolate* isolate, int expected,
i::Handle<i::Object> obj, int offset) { … }
template <class ElementType>
void ObjectWithExternalArrayTestHelper(Local<Context> context,
v8::Local<v8::TypedArray> obj,
int element_count,
i::ExternalArrayType array_type,
int64_t low, int64_t high) { … }
template <typename ElementType, typename TypedArray, class ArrayBufferType>
void TypedArrayTestHelper(i::ExternalArrayType array_type, int64_t low,
int64_t high) { … }
}
THREADED_TEST(Uint8Array) { … }
THREADED_TEST(Int8Array) { … }
THREADED_TEST(Uint16Array) { … }
THREADED_TEST(Int16Array) { … }
THREADED_TEST(Uint32Array) { … }
THREADED_TEST(Int32Array) { … }
THREADED_TEST(Float32Array) { … }
THREADED_TEST(Float64Array) { … }
THREADED_TEST(Uint8ClampedArray) { … }
THREADED_TEST(DataView) { … }
THREADED_TEST(SharedUint8Array) { … }
THREADED_TEST(SharedInt8Array) { … }
THREADED_TEST(SharedUint16Array) { … }
THREADED_TEST(SharedInt16Array) { … }
THREADED_TEST(SharedUint32Array) { … }
THREADED_TEST(SharedInt32Array) { … }
THREADED_TEST(SharedFloat32Array) { … }
THREADED_TEST(SharedFloat64Array) { … }
THREADED_TEST(SharedUint8ClampedArray) { … }
THREADED_TEST(SharedDataView) { … }
#define IS_ARRAY_BUFFER_VIEW_TEST …
IS_ARRAY_BUFFER_VIEW_TEST
IS_ARRAY_BUFFER_VIEW_TEST
IS_ARRAY_BUFFER_VIEW_TEST
IS_ARRAY_BUFFER_VIEW_TEST
IS_ARRAY_BUFFER_VIEW_TEST
IS_ARRAY_BUFFER_VIEW_TEST
IS_ARRAY_BUFFER_VIEW_TEST
IS_ARRAY_BUFFER_VIEW_TEST
IS_ARRAY_BUFFER_VIEW_TEST
IS_ARRAY_BUFFER_VIEW_TEST
#undef IS_ARRAY_BUFFER_VIEW_TEST
TEST(InternalFieldsOnTypedArray) { … }
TEST(InternalFieldsOnDataView) { … }
namespace {
void TestOnHeapHasBuffer(const char* array_name, size_t elem_size) { … }
void TestOffHeapHasBuffer(const char* array_name, size_t elem_size) { … }
}
#define TEST_HAS_BUFFER …
TEST_HAS_BUFFER(Uint8, 1)
TEST_HAS_BUFFER(Int8, 1)
TEST_HAS_BUFFER(Uint16, 2)
TEST_HAS_BUFFER(Int16, 2)
TEST_HAS_BUFFER(Uint32, 4)
TEST_HAS_BUFFER(Int32, 4)
TEST_HAS_BUFFER(Float32, 4)
TEST_HAS_BUFFER(Float64, 8)
#undef TEST_HAS_BUFFER