Home
last modified time | relevance | path

Searched refs:ASSERT_EQ (Results 1 – 25 of 136) sorted by relevance

123456

/bionic/tests/
Darpa_inet_test.cpp24 ASSERT_EQ((htonl)(0x7f000001), inet_addr("127.0.0.1")); in TEST()
32 ASSERT_EQ(1, inet_aton("127.1.2.3", &a)); in TEST()
33 ASSERT_EQ((htonl)(0x7f010203), a.s_addr); in TEST()
37 ASSERT_EQ(1, inet_aton("127.1.2", &a)); in TEST()
38 ASSERT_EQ((htonl)(0x7f010002), a.s_addr); in TEST()
42 ASSERT_EQ(1, inet_aton("127.1", &a)); in TEST()
43 ASSERT_EQ((htonl)(0x7f000001), a.s_addr); in TEST()
47 ASSERT_EQ(1, inet_aton("0x7f000001", &a)); in TEST()
48 ASSERT_EQ((htonl)(0x7f000001), a.s_addr); in TEST()
52 ASSERT_EQ(1, inet_aton("0xFf.0.0.1", &a)); in TEST()
[all …]
Dstrings_test.cpp30 ASSERT_EQ( 0, ffs(0x00000000)); in TEST()
31 ASSERT_EQ( 1, ffs(0x00000001)); in TEST()
32 ASSERT_EQ( 6, ffs(0x00000020)); in TEST()
33 ASSERT_EQ(11, ffs(0x00000400)); in TEST()
34 ASSERT_EQ(16, ffs(0x00008000)); in TEST()
35 ASSERT_EQ(17, ffs(0x00010000)); in TEST()
36 ASSERT_EQ(22, ffs(0x00200000)); in TEST()
37 ASSERT_EQ(27, ffs(0x04000000)); in TEST()
38 ASSERT_EQ(32, ffs(0x80000000)); in TEST()
42 ASSERT_EQ( 0, ffsl(0x00000000L)); in TEST()
[all …]
Dfenv_test.cpp33 ASSERT_EQ(expectation2, x); in TestRounding()
44 ASSERT_EQ(FE_TONEAREST, fegetround()); in TEST()
50 ASSERT_EQ(FE_TOWARDZERO, fegetround()); in TEST()
56 ASSERT_EQ(FE_UPWARD, fegetround()); in TEST()
62 ASSERT_EQ(FE_DOWNWARD, fegetround()); in TEST()
69 ASSERT_EQ(0, fetestexcept(FE_ALL_EXCEPT)); in TEST()
84 ASSERT_EQ(0, fetestexcept(FE_ALL_EXCEPT)); in TEST()
88 ASSERT_EQ(0, fesetenv(FE_DFL_ENV)); in TEST()
93 ASSERT_EQ(0, fetestexcept(FE_ALL_EXCEPT)); in TEST()
95 ASSERT_EQ(0, feraiseexcept(FE_DIVBYZERO | FE_OVERFLOW)); in TEST()
[all …]
Dcomplex_test.cpp61 ASSERT_EQ(0.0, cabs(0)); in TEST()
65 ASSERT_EQ(0.0, cabsf(0)); in TEST()
69 ASSERT_EQ(0.0, cabsl(0)); in TEST()
73 ASSERT_EQ(M_PI_2, cacos(0.0)); in TEST()
77 ASSERT_EQ(static_cast<float>(M_PI_2), cacosf(0.0)); in TEST()
81 ASSERT_EQ(M_PI_2l, cacosl(0.0)); in TEST()
85 ASSERT_EQ(0.0, cacosh(1.0)); in TEST()
89 ASSERT_EQ(0.0, cacoshl(1.0)); in TEST()
93 ASSERT_EQ(0.0, cacoshf(1.0)); in TEST()
97 ASSERT_EQ(0.0, carg(0)); in TEST()
[all …]
Dsemaphore_test.cpp39 ASSERT_EQ(0, sem_init(&s, 0, 0)); in TEST()
40 ASSERT_EQ(0, sem_init(&s, 0, 1)); in TEST()
41 ASSERT_EQ(0, sem_init(&s, 0, 123)); in TEST()
45 ASSERT_EQ(-1, sem_init(&s, 0, -1)); in TEST()
48 ASSERT_EQ(SEM_VALUE_MAX, sysconf(_SC_SEM_VALUE_MAX)); in TEST()
51 ASSERT_EQ(0, sem_init(&s, 0, SEM_VALUE_MAX)); in TEST()
55 ASSERT_EQ(-1, sem_init(&s, 0, static_cast<unsigned>(SEM_VALUE_MAX) + 1)); in TEST()
58 ASSERT_EQ(0, sem_destroy(&s)); in TEST()
63 ASSERT_EQ(0, sem_init(&s, 0, 3)); in TEST()
64 ASSERT_EQ(0, sem_trywait(&s)); in TEST()
[all …]
Dpthread_test.cpp55 ASSERT_EQ(0, pthread_key_create(&key, nullptr)); in TEST()
56 ASSERT_EQ(0, pthread_key_delete(key)); in TEST()
58 ASSERT_EQ(EINVAL, pthread_key_delete(key)); in TEST()
68 ASSERT_EQ(sysconf_max, PTHREAD_KEYS_MAX); in TEST()
86 ASSERT_EQ(0, pthread_key_create(&key, nullptr)) << i << " of " << nkeys; in TEST()
88 ASSERT_EQ(0, pthread_setspecific(key, reinterpret_cast<void*>(i))); in TEST()
92 ASSERT_EQ(reinterpret_cast<void*>(i), pthread_getspecific(keys.back())); in TEST()
95 ASSERT_EQ(0, pthread_key_delete(key)); in TEST()
123 ASSERT_EQ(EAGAIN, rv); in TEST()
129 ASSERT_EQ(0, pthread_key_create(&key, nullptr)); in TEST()
[all …]
Dspawn_test.cpp42 ASSERT_EQ(0, posix_spawnattr_init(&sa)); in TEST()
43 ASSERT_EQ(0, posix_spawnattr_destroy(&sa)); in TEST()
48 ASSERT_EQ(0, posix_spawnattr_init(&sa)); in TEST()
49 ASSERT_EQ(EINVAL, posix_spawnattr_setflags(&sa, ~0)); in TEST()
50 ASSERT_EQ(0, posix_spawnattr_destroy(&sa)); in TEST()
55 ASSERT_EQ(0, posix_spawnattr_init(&sa)); in TEST()
57 ASSERT_EQ(0, posix_spawnattr_setflags(&sa, POSIX_SPAWN_RESETIDS)); in TEST()
59 ASSERT_EQ(0, posix_spawnattr_getflags(&sa, &flags)); in TEST()
60 ASSERT_EQ(POSIX_SPAWN_RESETIDS, flags); in TEST()
65 ASSERT_EQ(0, posix_spawnattr_setflags(&sa, all_flags)); in TEST()
[all …]
Dthreads_test.cpp77 ASSERT_EQ(1, g_call_once_call_count); in TEST()
86 ASSERT_EQ(thrd_success, mtx_init(&m, mtx_plain)); in TEST()
89 ASSERT_EQ(thrd_success, cnd_init(&c)); in TEST()
94 ASSERT_EQ(thrd_success, mtx_lock(&m)); in TEST()
95 while (i != 1) ASSERT_EQ(thrd_success, cnd_wait(&c, &m)); in TEST()
96 ASSERT_EQ(thrd_success, mtx_unlock(&m)); in TEST()
102 ASSERT_EQ(thrd_success, mtx_lock(&m)); in TEST()
104 ASSERT_EQ(thrd_success, mtx_unlock(&m)); in TEST()
106 ASSERT_EQ(thrd_success, cnd_broadcast(&c)); in TEST()
122 ASSERT_EQ(thrd_success, cnd_init(&c)); in TEST()
[all …]
Dthread_local_test.cpp57 ASSERT_EQ(local_var, 1000); in TEST()
58 ASSERT_EQ(shared_var, 2000); in TEST()
61 ASSERT_EQ(run_one_thread(inc_shared_var), 2001); in TEST()
62 ASSERT_EQ(local_var, 1000); in TEST()
63 ASSERT_EQ(shared_var, 2001); in TEST()
65 ASSERT_EQ(run_one_thread(inc_shared_var), 2002); in TEST()
66 ASSERT_EQ(local_var, 1000); in TEST()
67 ASSERT_EQ(shared_var, 2002); in TEST()
69 ASSERT_EQ(run_one_thread(inc_shared_var), 2003); in TEST()
70 ASSERT_EQ(local_var, 1000); in TEST()
[all …]
Dsys_resource_test.cpp23 ASSERT_EQ(sizeof(rlimit), sizeof(rlimit64)); in TEST()
24 ASSERT_EQ(8U, sizeof(rlim_t)); in TEST()
27 ASSERT_EQ(4U, sizeof(rlim_t)); in TEST()
29 ASSERT_EQ(8U, sizeof(rlim64_t)); in TEST()
35 ASSERT_EQ(0, getrlimit(RLIMIT_CORE, &l32_)); in SetUp()
36 ASSERT_EQ(0, getrlimit64(RLIMIT_CORE, &l64_)); in SetUp()
37 ASSERT_EQ(0, prlimit(0, RLIMIT_CORE, nullptr, &pr_l32_)); in SetUp()
38 ASSERT_EQ(0, prlimit64(0, RLIMIT_CORE, nullptr, &pr_l64_)); in SetUp()
51 ASSERT_EQ(0, getrlimit(RLIMIT_CORE, &l32_)); in CheckResourceLimits()
52 ASSERT_EQ(0, getrlimit64(RLIMIT_CORE, &l64_)); in CheckResourceLimits()
[all …]
Dfortify_test.cpp670 ASSERT_EQ(10, snprintf(nullptr, 0, "0123456789")); in TEST()
682 ASSERT_EQ(buf, res); in TEST()
683 ASSERT_EQ('a', buf[0]); in TEST()
684 ASSERT_EQ('0', buf[1]); in TEST()
685 ASSERT_EQ('1', buf[2]); in TEST()
686 ASSERT_EQ('2', buf[3]); in TEST()
687 ASSERT_EQ('3', buf[4]); in TEST()
688 ASSERT_EQ('4', buf[5]); in TEST()
689 ASSERT_EQ('\0', buf[6]); in TEST()
690 ASSERT_EQ('A', buf[7]); in TEST()
[all …]
Dendian_test.cpp40 ASSERT_EQ(__LITTLE_ENDIAN, __BYTE_ORDER); in TEST()
45 ASSERT_EQ(be16, htons(le16)); in TEST()
46 ASSERT_EQ(be32, htonl(le32)); in TEST()
47 ASSERT_EQ(be64, htonq(le64)); in TEST()
55 ASSERT_EQ(le16, ntohs(be16)); in TEST()
56 ASSERT_EQ(le32, ntohl(be32)); in TEST()
57 ASSERT_EQ(le64, ntohq(be64)); in TEST()
64 ASSERT_EQ(be16, htobe16(le16)); in TEST()
65 ASSERT_EQ(be32, htobe32(le32)); in TEST()
66 ASSERT_EQ(be64, htobe64(le64)); in TEST()
[all …]
Deventfd_test.cpp32 ASSERT_EQ(0, eventfd_read(fd, &value)); in TEST()
33 ASSERT_EQ(kInitialValue, value); in TEST()
36 ASSERT_EQ(-1, eventfd_read(fd, &value)); in TEST()
40 ASSERT_EQ(0, eventfd_write(fd, 1)); in TEST()
41 ASSERT_EQ(0, eventfd_write(fd, 1)); in TEST()
42 ASSERT_EQ(0, eventfd_write(fd, 1)); in TEST()
44 ASSERT_EQ(0, eventfd_read(fd, &value)); in TEST()
45 ASSERT_EQ(3U, value); in TEST()
57 ASSERT_EQ(0, eventfd_read(fd, &value)); in TEST()
58 ASSERT_EQ(kInitialValue, value); in TEST()
[all …]
Dsys_types_test.cpp24 ASSERT_EQ(4U, sizeof(gid_t)); in TEST()
25 ASSERT_EQ(4U, sizeof(pid_t)); in TEST()
26 ASSERT_EQ(4U, sizeof(uid_t)); in TEST()
28 ASSERT_EQ(4U, sizeof(id_t)); in TEST()
33 ASSERT_EQ(8U, sizeof(dev_t)); in TEST()
34 ASSERT_EQ(8U, sizeof(off_t)); in TEST()
35 ASSERT_EQ(8U, sizeof(time_t)); in TEST()
37 ASSERT_EQ(4U, sizeof(dev_t)); in TEST()
38 ASSERT_EQ(4U, sizeof(off_t)); in TEST()
39 ASSERT_EQ(4U, sizeof(time_t)); in TEST()
[all …]
Dstdint_test.cpp22 ASSERT_EQ(1U, sizeof(int_fast8_t)); in TEST()
23 ASSERT_EQ(8U, sizeof(int_fast64_t)); in TEST()
24 ASSERT_EQ(1U, sizeof(uint_fast8_t)); in TEST()
25 ASSERT_EQ(8U, sizeof(uint_fast64_t)); in TEST()
27 ASSERT_EQ(8U, sizeof(int_fast16_t)); in TEST()
28 ASSERT_EQ(8U, sizeof(int_fast32_t)); in TEST()
29 ASSERT_EQ(8U, sizeof(uint_fast16_t)); in TEST()
30 ASSERT_EQ(8U, sizeof(uint_fast32_t)); in TEST()
32 ASSERT_EQ(4U, sizeof(int_fast16_t)); in TEST()
33 ASSERT_EQ(4U, sizeof(int_fast32_t)); in TEST()
[all …]
Dsys_stat_test.cpp47 ASSERT_EQ(0, futimens(fd, times)) << strerror(errno); in TEST()
50 ASSERT_EQ(0, fstat(fd, &sb)); in TEST()
51 ASSERT_EQ(times[0].tv_sec, static_cast<long>(sb.st_atime)); in TEST()
52 ASSERT_EQ(times[1].tv_sec, static_cast<long>(sb.st_mtime)); in TEST()
63 ASSERT_EQ(-1, futimens(-1, times)); in TEST()
69 ASSERT_EQ(-1, mkfifo("/", 0666)); in TEST()
75 ASSERT_EQ(-1, mkfifoat(-2, "x", 0666)); in TEST()
88 ASSERT_EQ(0, mkfifo(path.c_str(), 0666)); in TEST()
90 ASSERT_EQ(0, stat(path.c_str(), &sb)); in TEST()
101 ASSERT_EQ(0, stat64("/proc/version", &sb)); in TEST()
[all …]
Dglob_test.cpp30 #define ASSERT_MATCH_COUNT(n_,g_) ASSERT_EQ(n_, g_.gl_matchc)
75 ASSERT_EQ(GLOB_NOMATCH, glob("/will/match/nothing", 0, nullptr, &g)); in TEST()
76 ASSERT_EQ(0U, g.gl_pathc); in TEST()
82 ASSERT_EQ(0, glob("/proc/version", 0, nullptr, &g)); in TEST()
83 ASSERT_EQ(1U, g.gl_pathc); in TEST()
86 ASSERT_EQ(nullptr, g.gl_pathv[1]); in TEST()
87 ASSERT_EQ(0, glob("/proc/version", GLOB_APPEND, nullptr, &g)); in TEST()
88 ASSERT_EQ(2U, g.gl_pathc); in TEST()
92 ASSERT_EQ(nullptr, g.gl_pathv[2]); in TEST()
99 ASSERT_EQ(0, glob("/proc/version", GLOB_DOOFFS, nullptr, &g)); in TEST()
[all …]
Dsignal_test.cpp58 ASSERT_EQ(-1, fn(set_ptr)); in TestSigSet1()
64 ASSERT_EQ(0, fn(&set)); in TestSigSet1()
73 ASSERT_EQ(-1, fn(set_ptr, SIGSEGV)); in TestSigSet2()
80 ASSERT_EQ(-1, fn(&set, 0)); in TestSigSet2()
85 ASSERT_EQ(-1, fn(&set, SIGNAL_MAX(&set) + 1)); in TestSigSet2()
90 ASSERT_EQ(0, fn(&set, SIGNAL_MIN())); in TestSigSet2()
92 ASSERT_EQ(0, fn(&set, SIGNAL_MAX(&set))); in TestSigSet2()
148 ASSERT_EQ(-1, raise(-1)); in TEST()
153 ASSERT_EQ(SIGALRM, signal_number); in raise_in_signal_handler_helper()
174 ASSERT_EQ(0, sigprocmask(SIG_BLOCK, &just_SIGALRM, nullptr)); in TEST()
[all …]
Dsearch_test.cpp36 ASSERT_EQ(nullptr, lfind(&needle, xs, &x_size, sizeof(xs[0]), int_cmp)); in TEST()
37 ASSERT_EQ(0U, x_size); in TEST()
40 ASSERT_EQ(&xs[0], lsearch(&needle, xs, &x_size, sizeof(xs[0]), int_cmp)); in TEST()
41 ASSERT_EQ(2, xs[0]); in TEST()
42 ASSERT_EQ(1U, x_size); in TEST()
45 ASSERT_EQ(&xs[0], lfind(&needle, xs, &x_size, sizeof(xs[0]), int_cmp)); in TEST()
46 ASSERT_EQ(1U, x_size); in TEST()
49 ASSERT_EQ(&xs[0], lsearch(&needle, xs, &x_size, sizeof(xs[0]), int_cmp)); in TEST()
50 ASSERT_EQ(1U, x_size); in TEST()
88 ASSERT_EQ(nullptr, tfind(&n1, &root, node_cmp)); in TEST()
[all …]
Dsys_uio_test.cpp36 ASSERT_EQ(10, writev(tf.fd, ios, 2)); in TEST()
38 ASSERT_EQ(0, lseek(tf.fd, 0, SEEK_SET)); in TEST()
43 ASSERT_EQ(10, readv(tf.fd, ios, 2)); in TEST()
56 ASSERT_EQ(5, write_fn(tf.fd, ios, 1, 5)); in TestPreadVPwriteV()
57 ASSERT_EQ(0, lseek(tf.fd, 0, SEEK_CUR)); in TestPreadVPwriteV()
60 ASSERT_EQ(5, write_fn(tf.fd, ios, 1, 0)); in TestPreadVPwriteV()
61 ASSERT_EQ(0, lseek(tf.fd, 0, SEEK_CUR)); in TestPreadVPwriteV()
63 ASSERT_EQ(5, read_fn(tf.fd, ios, 1, 5)); in TestPreadVPwriteV()
65 ASSERT_EQ(5, read_fn(tf.fd, ios, 1, 0)); in TestPreadVPwriteV()
84 ASSERT_EQ(5, write_fn(tf.fd, ios, 1, 5, 0)) << strerror(errno); in TestPreadV2PwriteV2()
[all …]
Dstdio_ext_test.cpp40 ASSERT_EQ(0U, __fbufsize(fp)); in TEST()
45 ASSERT_EQ(1024U, __fbufsize(fp)); in TEST()
47 ASSERT_EQ(0, setvbuf(fp, buf, _IOFBF, 1)); in TEST()
48 ASSERT_EQ(1U, __fbufsize(fp)); in TEST()
50 ASSERT_EQ(0, setvbuf(fp, buf, _IOFBF, 8)); in TEST()
51 ASSERT_EQ(8U, __fbufsize(fp)); in TEST()
62 ASSERT_EQ(0, setvbuf(fp, buf, _IOLBF, sizeof(buf))); in TEST()
71 ASSERT_EQ(0U, __fpending(fp)); in TEST()
72 ASSERT_EQ('x', fputc('x', fp)); in TEST()
73 ASSERT_EQ(1U, __fpending(fp)); in TEST()
[all …]
/bionic/linker/
Dlinker_utils_test.cpp42 ASSERT_EQ("LIBlib32${LIB42SDKVER$TEST$", str_smoke); in TEST()
48 ASSERT_EQ("/root/dir/dir2/zipfile!/dir/afile", output); in TEST()
51 ASSERT_EQ("/root/dir/dir2/somedir/.../zipfile!/.dir/afile", output); in TEST()
54 ASSERT_EQ("/", output); in TEST()
57 ASSERT_EQ("/root/", output); in TEST()
60 ASSERT_EQ("/b", output); in TEST()
63 ASSERT_EQ("/", output); in TEST()
67 ASSERT_EQ("unchanged", output); in TEST()
99 ASSERT_EQ("/zip/path/file.zip", zip_path); in TEST()
100 ASSERT_EQ("path/in/zip", entry_path); in TEST()
[all …]
Dlinked_list_test.cpp75 ASSERT_EQ("", test_list_to_string(list)); in TEST()
81 ASSERT_EQ("a", test_list_to_string(list)); in TEST()
83 ASSERT_EQ("ba", test_list_to_string(list)); in TEST()
86 ASSERT_EQ("dcba", test_list_to_string(list)); in TEST()
97 ASSERT_EQ("dba", test_list_to_string(list)); in TEST()
104 ASSERT_EQ("dba", test_list_to_string(list)); in TEST()
108 ASSERT_EQ("", test_list_to_string(list)); in TEST()
115 ASSERT_EQ("ab", test_list_to_string(list)); in TEST()
117 ASSERT_EQ("abc", test_list_to_string(list)); in TEST()
119 ASSERT_EQ("bc", test_list_to_string(list)); in TEST()
[all …]
/bionic/tests/libs/
Delftls_dtv_resize_helper.cpp61 #define ASSERT_EQ(val1, val2) check(__LINE__, #val1, val1, #val2, val2, std::equal_to()) macro
102 ASSERT_EQ(42, g_tls_var_placeholder); in main()
126 ASSERT_EQ(0u, zero_dtv->count); in main()
127 ASSERT_EQ(nullptr, zero_dtv->next); in main()
128 ASSERT_EQ(kTlsGenerationNone, zero_dtv->generation); in main()
132 ASSERT_EQ(zero_dtv, dtv()); in main()
133 ASSERT_EQ(first_filler_modid, highest_loaded_modid()); in main()
137 ASSERT_EQ(101, func1()); in main()
139 ASSERT_EQ(5u, dtv()->count); in main()
140 ASSERT_EQ(zero_dtv, initial_dtv->next); in main()
[all …]
/bionic/libc/malloc_debug/tests/
Dmalloc_debug_config_tests.cpp123 ASSERT_EQ(BACKTRACE | TRACK_ALLOCS, config->options()); in TEST_F()
124 ASSERT_EQ(10U, config->backtrace_frames()); in TEST_F()
132 ASSERT_EQ(BACKTRACE | TRACK_ALLOCS, config->options()); in TEST_F()
133 ASSERT_EQ(10U, config->backtrace_frames()); in TEST_F()
141 ASSERT_EQ(BACKTRACE | TRACK_ALLOCS, config->options()); in TEST_F()
142 ASSERT_EQ(64U, config->backtrace_frames()); in TEST_F()
150 ASSERT_EQ(BACKTRACE | TRACK_ALLOCS | FRONT_GUARD, config->options()); in TEST_F()
151 ASSERT_EQ(64U, config->backtrace_frames()); in TEST_F()
152 ASSERT_EQ(48U, config->front_guard_bytes()); in TEST_F()
160 ASSERT_EQ(FRONT_GUARD | TRACK_ALLOCS, config->options()); in TEST_F()
[all …]

123456