v8  3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
test-strings.cc File Reference
#include <stdlib.h>
#include "v8.h"
#include "api.h"
#include "factory.h"
#include "objects.h"
#include "cctest.h"
Include dependency graph for test-strings.cc:

Go to the source code of this file.

Data Structures

class  MyRandomNumberGenerator
 
class  Resource
 
class  AsciiResource
 
class  ConsStringStats
 
class  ConsStringGenerationData
 
class  AsciiVectorResource
 
class  DummyResource
 
class  DummyOneByteResource
 

Macros

#define INVALID_STRING_TEST(FUN, TYPE)
 

Functions

void AccumulateStats (ConsString *cons_string, ConsStringStats *stats)
 
void AccumulateStats (Handle< String > cons_string, ConsStringStats *stats)
 
void AccumulateStatsWithOperator (ConsString *cons_string, ConsStringStats *stats)
 
void VerifyConsString (Handle< String > root, ConsStringGenerationData *data)
 
 TEST (Traverse)
 
template<typename BuildString >
void TestStringCharacterStream (BuildString build, int test_cases)
 
 TEST (StringCharacterStreamEdgeCases)
 
 TEST (StringCharacterStreamRandom)
 
 TEST (DeepAscii)
 
 TEST (Utf8Conversion)
 
 TEST (ExternalShortStringAdd)
 
 TEST (JSONStringifySliceMadeExternal)
 
 TEST (CachedHashOverflow)
 
 TEST (SliceFromCons)
 
 TEST (SliceFromExternal)
 
 TEST (TrivialSlice)
 
 TEST (SliceFromSlice)
 
 TEST (AsciiArrayJoin)
 
 TEST (RobustSubStringStub)
 
 TEST (StringReplaceAtomTwoByteResult)
 
 TEST (IsAscii)
 
 TEST (Latin1IgnoreCase)
 
 TEST (InvalidExternalString)
 

Macro Definition Documentation

#define INVALID_STRING_TEST (   FUN,
  TYPE 
)
Value:
TEST(StringOOM##FUN) { \
LocalContext context; \
Isolate* isolate = CcTest::i_isolate(); \
STATIC_ASSERT(String::kMaxLength < kMaxInt); \
static const int invalid = String::kMaxLength + 1; \
HandleScope scope(isolate); \
Vector<TYPE> dummy = Vector<TYPE>::New(invalid); \
CHECK(isolate->factory()->FUN(Vector<const TYPE>::cast(dummy)).is_null()); \
memset(dummy.start(), 0x20, dummy.length() * sizeof(TYPE)); \
CHECK(isolate->has_pending_exception()); \
isolate->clear_pending_exception(); \
dummy.Dispose(); \
}
const int kMaxInt
Definition: globals.h:248
#define CHECK(condition)
Definition: checks.h:75
static i::Isolate * i_isolate()
Definition: cctest.h:102
TEST(Traverse)
static void InitializeVM()
Definition: cctest.h:116
#define STATIC_ASSERT(test)
Definition: checks.h:341

Definition at line 1391 of file test-strings.cc.

Function Documentation

void AccumulateStats ( Handle< String cons_string,
ConsStringStats stats 
)

Definition at line 347 of file test-strings.cc.

References AccumulateStats(), ConsString::cast(), and ConsStringStats::chars_.

TEST ( Traverse  )
TEST ( StringCharacterStreamEdgeCases  )

Definition at line 765 of file test-strings.cc.

References TestStringCharacterStream().

TEST ( StringCharacterStreamRandom  )

Definition at line 846 of file test-strings.cc.

References TestStringCharacterStream().

TEST ( RobustSubStringStub  )
TEST ( StringReplaceAtomTwoByteResult  )
TEST ( IsAscii  )

Definition at line 1295 of file test-strings.cc.

References CHECK, String::IsAscii(), String::IsOneByte(), and v8::internal::NULL.

TEST ( Latin1IgnoreCase  )

Definition at line 1323 of file test-strings.cc.

References CHECK_EQ, and v8::internal::Min().

void TestStringCharacterStream ( BuildString  build,
int  test_cases 
)