Home
last modified time | relevance | path

Searched refs:array (Results 1 – 25 of 93) sorted by relevance

1234

/ndk/sources/cxx-stl/llvm-libc++/test/algorithms/alg.modifying.operations/alg.partitions/
Dstable_partition.pass.cpp43 P array[] = in test() local
56 const unsigned size = sizeof(array)/sizeof(array[0]); in test()
57 Iter r = std::stable_partition(Iter(array), Iter(array+size), odd_first()); in test()
58 assert(base(r) == array + 4); in test()
59 assert(array[0] == P(1, 1)); in test()
60 assert(array[1] == P(1, 2)); in test()
61 assert(array[2] == P(3, 1)); in test()
62 assert(array[3] == P(3, 2)); in test()
63 assert(array[4] == P(0, 1)); in test()
64 assert(array[5] == P(0, 2)); in test()
[all …]
/ndk/tests/device/test-gnustl-full/unit/
Dbind_test.cpp55 int array [3] = { 1, 2, 3 }; in bind1st1() local
56 int* p = remove_if((int*)array, (int*)array + 3, bind1st(less<int>(), 2)); in bind1st1()
58 CPPUNIT_ASSERT(p == &array[2]); in bind1st1()
59 CPPUNIT_ASSERT(array[0] == 1); in bind1st1()
60 CPPUNIT_ASSERT(array[1] == 2); in bind1st1()
62 for_each((int*)array, (int*)array + 3, bind1st(pre_increment(), 1)); in bind1st1()
63 CPPUNIT_ASSERT(array[0] == 2); in bind1st1()
64 CPPUNIT_ASSERT(array[1] == 3); in bind1st1()
65 CPPUNIT_ASSERT(array[2] == 4); in bind1st1()
67 for_each((int*)array, (int*)array + 3, bind2nd(post_increment(), 1)); in bind1st1()
[all …]
Dfinsert_test.cpp33 char const* array [] = { "laurie", "jennifer", "leisa" }; in finsert1() local
36 fit = copy(array, array + 3, front_insert_iterator<deque <char const*> >(names)); in finsert1()
38 CPPUNIT_ASSERT(names[0]==array[2]); in finsert1()
39 CPPUNIT_ASSERT(names[1]==array[1]); in finsert1()
40 CPPUNIT_ASSERT(names[2]==array[0]); in finsert1()
42 copy(array, array + 3, fit); in finsert1()
43 CPPUNIT_ASSERT(names[3]==array[2]); in finsert1()
44 CPPUNIT_ASSERT(names[4]==array[1]); in finsert1()
45 CPPUNIT_ASSERT(names[5]==array[0]); in finsert1()
50 char const* array [] = { "laurie", "jennifer", "leisa" }; in finsert2() local
[all …]
Dless_test.cpp33 int array [4] = { 3, 1, 4, 2 }; in lesst() local
34 sort(array, array + 4, less<int>()); in lesst()
36 CPPUNIT_ASSERT(array[0]==1); in lesst()
37 CPPUNIT_ASSERT(array[1]==2); in lesst()
38 CPPUNIT_ASSERT(array[2]==3); in lesst()
39 CPPUNIT_ASSERT(array[3]==4); in lesst()
43 int array [4] = { 3, 1, 4, 2 }; in lesseqt() local
44 sort(array, array + 4, less_equal<int>()); in lesseqt()
46 CPPUNIT_ASSERT(array[0]==1); in lesseqt()
47 CPPUNIT_ASSERT(array[1]==2); in lesseqt()
[all …]
Dgreater_test.cpp33 int array[4] = { 3, 1, 4, 2 }; in greatert() local
34 sort(array, array + 4, greater<int>() ); in greatert()
36 CPPUNIT_ASSERT(array[0]==4); in greatert()
37 CPPUNIT_ASSERT(array[1]==3); in greatert()
38 CPPUNIT_ASSERT(array[2]==2); in greatert()
39 CPPUNIT_ASSERT(array[3]==1); in greatert()
43 int array [4] = { 3, 1, 4, 2 }; in greatereq() local
44 sort(array, array + 4, greater_equal<int>()); in greatereq()
45 CPPUNIT_ASSERT(array[0]==4); in greatereq()
46 CPPUNIT_ASSERT(array[1]==3); in greatereq()
[all …]
Dbinsert_test.cpp32 const char* array [] = { "laurie", "jennifer", "leisa" }; in binsert1() local
35 bit = copy(array, array + 3, bit); in binsert1()
37 CPPUNIT_ASSERT(!strcmp(names[0],array[0])); in binsert1()
38 CPPUNIT_ASSERT(!strcmp(names[1],array[1])); in binsert1()
39 CPPUNIT_ASSERT(!strcmp(names[2],array[2])); in binsert1()
41 copy(array, array + 3, bit); in binsert1()
42 CPPUNIT_ASSERT(!strcmp(names[3],array[0])); in binsert1()
43 CPPUNIT_ASSERT(!strcmp(names[4],array[1])); in binsert1()
44 CPPUNIT_ASSERT(!strcmp(names[5],array[2])); in binsert1()
48 const char* array [] = { "laurie", "jennifer", "leisa" }; in binsert2() local
[all …]
Dbnegate_test.cpp32 int array [4] = { 4, 9, 7, 1 }; in bnegate1() local
34 sort(array, array + 4, binary_negate<greater<int> >(greater<int>())); in bnegate1()
35 CPPUNIT_ASSERT(array[0]==1); in bnegate1()
36 CPPUNIT_ASSERT(array[1]==4); in bnegate1()
37 CPPUNIT_ASSERT(array[2]==7); in bnegate1()
38 CPPUNIT_ASSERT(array[3]==9); in bnegate1()
42 int array [4] = { 4, 9, 7, 1 }; in bnegate2() local
43 sort(array, array + 4, not2(greater<int>())); in bnegate2()
44 CPPUNIT_ASSERT(array[0]==1); in bnegate2()
45 CPPUNIT_ASSERT(array[1]==4); in bnegate2()
[all …]
Dunary_test.cpp46 int array [3] = { 1, 2, 3 }; in unegate1() local
48 int* p = find_if((int*)array, (int*)array + 3, unary_negate<odd>(odd())); in unegate1()
49 CPPUNIT_ASSERT((p != array + 3)); in unegate1()
54 int array [3] = { 1, 2, 3 }; in unegate2() local
55 int* p = find_if((int*)array, (int*)array + 3, not1(odd())); in unegate2()
56 CPPUNIT_ASSERT(p != array + 3); in unegate2()
66 int array [3] = { 1, 2, 3 }; in unegate3() local
67 int* p = find_if((int*)array, (int*)array + 3, not1(ptr_fun(test_func))); in unegate3()
68 CPPUNIT_ASSERT(p != array + 3); in unegate3()
Dbcompos_test.cpp36 int array [6] = { -2, -1, 0, 1, 2, 3 }; in bcompos1() local
41 int* p = find_if((int*)array, (int*)array + 6, b); in bcompos1()
42 CPPUNIT_ASSERT(p != array + 6); in bcompos1()
49 int array [6] = { -2, -1 , 0, 1, 2, 3 }; in bcompos2() local
51 int* p = find_if((int*)array, (int*)array + 6, in bcompos2()
53 CPPUNIT_ASSERT(p != array + 6); in bcompos2()
Dreviter_test.cpp35 int array [] = { 1, 5, 2, 3 }; in reviter1() local
37 vector<int> v(array, array + 4); in reviter1()
50 int array [] = { 1, 5, 2, 3 }; in reviter2() local
52 vector<int> v(array, array + 4); in reviter2()
63 int array [] = { 1, 5, 2, 3 }; in revbit1() local
65 list<int> v(array, array + 4); in revbit1()
/ndk/tests/device/test-stlport/unit/
Dbind_test.cpp55 int array [3] = { 1, 2, 3 }; in bind1st1() local
56 int* p = remove_if((int*)array, (int*)array + 3, bind1st(less<int>(), 2)); in bind1st1()
58 CPPUNIT_ASSERT(p == &array[2]); in bind1st1()
59 CPPUNIT_ASSERT(array[0] == 1); in bind1st1()
60 CPPUNIT_ASSERT(array[1] == 2); in bind1st1()
62 for_each((int*)array, (int*)array + 3, bind1st(pre_increment(), 1)); in bind1st1()
63 CPPUNIT_ASSERT(array[0] == 2); in bind1st1()
64 CPPUNIT_ASSERT(array[1] == 3); in bind1st1()
65 CPPUNIT_ASSERT(array[2] == 4); in bind1st1()
67 for_each((int*)array, (int*)array + 3, bind2nd(post_increment(), 1)); in bind1st1()
[all …]
Dfinsert_test.cpp33 char const* array [] = { "laurie", "jennifer", "leisa" }; in finsert1() local
36 fit = copy(array, array + 3, front_insert_iterator<deque <char const*> >(names)); in finsert1()
38 CPPUNIT_ASSERT(names[0]==array[2]); in finsert1()
39 CPPUNIT_ASSERT(names[1]==array[1]); in finsert1()
40 CPPUNIT_ASSERT(names[2]==array[0]); in finsert1()
42 copy(array, array + 3, fit); in finsert1()
43 CPPUNIT_ASSERT(names[3]==array[2]); in finsert1()
44 CPPUNIT_ASSERT(names[4]==array[1]); in finsert1()
45 CPPUNIT_ASSERT(names[5]==array[0]); in finsert1()
50 char const* array [] = { "laurie", "jennifer", "leisa" }; in finsert2() local
[all …]
Dgreater_test.cpp33 int array[4] = { 3, 1, 4, 2 }; in greatert() local
34 sort(array, array + 4, greater<int>() ); in greatert()
36 CPPUNIT_ASSERT(array[0]==4); in greatert()
37 CPPUNIT_ASSERT(array[1]==3); in greatert()
38 CPPUNIT_ASSERT(array[2]==2); in greatert()
39 CPPUNIT_ASSERT(array[3]==1); in greatert()
43 int array [4] = { 3, 1, 4, 2 }; in greatereq() local
44 sort(array, array + 4, greater_equal<int>()); in greatereq()
45 CPPUNIT_ASSERT(array[0]==4); in greatereq()
46 CPPUNIT_ASSERT(array[1]==3); in greatereq()
[all …]
Dless_test.cpp33 int array [4] = { 3, 1, 4, 2 }; in lesst() local
34 sort(array, array + 4, less<int>()); in lesst()
36 CPPUNIT_ASSERT(array[0]==1); in lesst()
37 CPPUNIT_ASSERT(array[1]==2); in lesst()
38 CPPUNIT_ASSERT(array[2]==3); in lesst()
39 CPPUNIT_ASSERT(array[3]==4); in lesst()
43 int array [4] = { 3, 1, 4, 2 }; in lesseqt() local
44 sort(array, array + 4, less_equal<int>()); in lesseqt()
46 CPPUNIT_ASSERT(array[0]==1); in lesseqt()
47 CPPUNIT_ASSERT(array[1]==2); in lesseqt()
[all …]
Dbinsert_test.cpp32 const char* array [] = { "laurie", "jennifer", "leisa" }; in binsert1() local
35 bit = copy(array, array + 3, bit); in binsert1()
37 CPPUNIT_ASSERT(!strcmp(names[0],array[0])); in binsert1()
38 CPPUNIT_ASSERT(!strcmp(names[1],array[1])); in binsert1()
39 CPPUNIT_ASSERT(!strcmp(names[2],array[2])); in binsert1()
41 copy(array, array + 3, bit); in binsert1()
42 CPPUNIT_ASSERT(!strcmp(names[3],array[0])); in binsert1()
43 CPPUNIT_ASSERT(!strcmp(names[4],array[1])); in binsert1()
44 CPPUNIT_ASSERT(!strcmp(names[5],array[2])); in binsert1()
48 const char* array [] = { "laurie", "jennifer", "leisa" }; in binsert2() local
[all …]
Dbnegate_test.cpp32 int array [4] = { 4, 9, 7, 1 }; in bnegate1() local
34 sort(array, array + 4, binary_negate<greater<int> >(greater<int>())); in bnegate1()
35 CPPUNIT_ASSERT(array[0]==1); in bnegate1()
36 CPPUNIT_ASSERT(array[1]==4); in bnegate1()
37 CPPUNIT_ASSERT(array[2]==7); in bnegate1()
38 CPPUNIT_ASSERT(array[3]==9); in bnegate1()
42 int array [4] = { 4, 9, 7, 1 }; in bnegate2() local
43 sort(array, array + 4, not2(greater<int>())); in bnegate2()
44 CPPUNIT_ASSERT(array[0]==1); in bnegate2()
45 CPPUNIT_ASSERT(array[1]==4); in bnegate2()
[all …]
Dunary_test.cpp46 int array [3] = { 1, 2, 3 }; in unegate1() local
48 int* p = find_if((int*)array, (int*)array + 3, unary_negate<odd>(odd())); in unegate1()
49 CPPUNIT_ASSERT((p != array + 3)); in unegate1()
54 int array [3] = { 1, 2, 3 }; in unegate2() local
55 int* p = find_if((int*)array, (int*)array + 3, not1(odd())); in unegate2()
56 CPPUNIT_ASSERT(p != array + 3); in unegate2()
66 int array [3] = { 1, 2, 3 }; in unegate3() local
67 int* p = find_if((int*)array, (int*)array + 3, not1(ptr_fun(test_func))); in unegate3()
68 CPPUNIT_ASSERT(p != array + 3); in unegate3()
Dbcompos_test.cpp36 int array [6] = { -2, -1, 0, 1, 2, 3 }; in bcompos1() local
41 int* p = find_if((int*)array, (int*)array + 6, b); in bcompos1()
42 CPPUNIT_ASSERT(p != array + 6); in bcompos1()
49 int array [6] = { -2, -1 , 0, 1, 2, 3 }; in bcompos2() local
51 int* p = find_if((int*)array, (int*)array + 6, in bcompos2()
53 CPPUNIT_ASSERT(p != array + 6); in bcompos2()
Dreviter_test.cpp35 int array [] = { 1, 5, 2, 3 }; in reviter1() local
37 vector<int> v(array, array + 4); in reviter1()
50 int array [] = { 1, 5, 2, 3 }; in reviter2() local
52 vector<int> v(array, array + 4); in reviter2()
63 int array [] = { 1, 5, 2, 3 }; in revbit1() local
65 list<int> v(array, array + 4); in revbit1()
/ndk/sources/cxx-stl/llvm-libc++/test/algorithms/alg.sorting/alg.sort/stable.sort/
Dstable_sort.pass.cpp80 int* array = new int[N]; in test_larger_sorts() local
84 array[i] = x; in test_larger_sorts()
89 std::stable_sort(array, array+N); in test_larger_sorts()
90 assert(std::is_sorted(array, array+N)); in test_larger_sorts()
92 std::random_shuffle(array, array+N); in test_larger_sorts()
93 std::stable_sort(array, array+N); in test_larger_sorts()
94 assert(std::is_sorted(array, array+N)); in test_larger_sorts()
96 std::stable_sort(array, array+N); in test_larger_sorts()
97 assert(std::is_sorted(array, array+N)); in test_larger_sorts()
99 std::reverse(array, array+N); in test_larger_sorts()
[all …]
/ndk/sources/cxx-stl/llvm-libc++/test/algorithms/alg.sorting/alg.sort/sort/
Dsort.pass.cpp80 int* array = new int[N]; in test_larger_sorts() local
84 array[i] = x; in test_larger_sorts()
89 std::sort(array, array+N); in test_larger_sorts()
90 assert(std::is_sorted(array, array+N)); in test_larger_sorts()
92 std::random_shuffle(array, array+N); in test_larger_sorts()
93 std::sort(array, array+N); in test_larger_sorts()
94 assert(std::is_sorted(array, array+N)); in test_larger_sorts()
96 std::sort(array, array+N); in test_larger_sorts()
97 assert(std::is_sorted(array, array+N)); in test_larger_sorts()
99 std::reverse(array, array+N); in test_larger_sorts()
[all …]
/ndk/sources/cxx-stl/llvm-libc++/include/
Darray2 //===---------------------------- array -----------------------------------===//
15 array synopsis
20 struct array
37 void swap(array& a) noexcept(noexcept(swap(declval<T&>(), declval<T&>())));
76 bool operator==(const array<T,N>& x, const array<T,N>& y);
78 bool operator!=(const array<T,N>& x, const array<T,N>& y);
80 bool operator<(const array<T,N>& x, const array<T,N>& y);
82 bool operator>(const array<T,N>& x, const array<T,N>& y);
84 bool operator<=(const array<T,N>& x, const array<T,N>& y);
86 bool operator>=(const array<T,N>& x, const array<T,N>& y);
[all …]
/ndk/sources/cxx-stl/llvm-libc++/test/algorithms/alg.sorting/alg.nth.element/
Dnth_element.pass.cpp26 int* array = new int[N]; in test_one() local
28 array[i] = i; in test_one()
29 std::random_shuffle(array, array+N); in test_one()
30 std::nth_element(array, array+M, array+N); in test_one()
31 assert(array[M] == M); in test_one()
32 delete [] array; in test_one()
Dnth_element_comp.pass.cpp39 int* array = new int[N]; in test_one() local
41 array[i] = i; in test_one()
42 std::random_shuffle(array, array+N); in test_one()
43 std::nth_element(array, array+M, array+N, std::greater<int>()); in test_one()
44 assert(array[M] == N-M-1); in test_one()
45 delete [] array; in test_one()
/ndk/sources/cxx-stl/llvm-libc++/test/algorithms/alg.sorting/alg.sort/partial.sort/
Dpartial_sort.pass.cpp25 int* array = new int[N]; in test_larger_sorts() local
27 array[i] = i; in test_larger_sorts()
28 std::random_shuffle(array, array+N); in test_larger_sorts()
29 std::partial_sort(array, array+M, array+N); in test_larger_sorts()
31 assert(array[i] == i); in test_larger_sorts()
32 delete [] array; in test_larger_sorts()

1234