Home
last modified time | relevance | path

Searched refs:ret (Results 1 – 25 of 101) sorted by relevance

12345

/commonlibrary/c_utils/base/test/unittest/common/
Dutils_ashmem_test.cpp71 bool ret = ashmem->MapAshmem(PROT_READ | PROT_WRITE); variable
72 ASSERT_TRUE(ret);
88 bool ret = ashmem->MapReadAndWriteAshmem(); variable
89 ASSERT_TRUE(ret);
91 ret = ashmem->WriteToAshmem(MEMORY_CONTENT.c_str(), sizeof(MEMORY_CONTENT), 0);
92 ASSERT_TRUE(ret);
94ret = ashmem->WriteToAshmem(MEMORY_CONTENT.c_str(), sizeof(MEMORY_CONTENT), sizeof(MEMORY_CONTENT)…
95 ASSERT_TRUE(ret);
123 bool ret = ashmem->MapReadAndWriteAshmem(); variable
124 ASSERT_TRUE(ret);
[all …]
Dutils_directory_test.cpp170 bool ret = ForceCreateDirectory(dirpath); variable
171 EXPECT_EQ(ret, true);
172 ret = IsEmptyFolder(dirpath);
173 EXPECT_EQ(ret, true);
183 bool ret = ForceRemoveDirectory(dirpath); variable
184 EXPECT_EQ(ret, true);
194 bool ret = ForceRemoveDirectory(dirpath); variable
195 EXPECT_EQ(ret, false);
209 bool ret = ForceCreateDirectory(dirpath); variable
210 EXPECT_EQ(ret, true);
[all …]
Dutils_file_test.cpp93 bool ret = LoadBufferFromFile(filename, buff); variable
94 EXPECT_TRUE(ret);
276 bool ret = SaveStringToFile(path, newContent); variable
277 EXPECT_EQ(ret, true);
315 bool ret = SaveStringToFile(path, newContent, true); variable
316 EXPECT_EQ(ret, true);
319 ret = LoadStringFromFile(path, loadResult);
321 EXPECT_EQ(ret, true);
335 bool ret = SaveStringToFile(path, newContent, false); variable
336 EXPECT_EQ(ret, true);
[all …]
Dutils_timer_test.cpp100 uint32_t ret = timer.Setup(); variable
101 EXPECT_EQ(Utils::TIMER_ERR_OK, ret);
117 uint32_t ret = timer.Setup(); variable
118 EXPECT_EQ(Utils::TIMER_ERR_OK, ret);
135 uint32_t ret = timer.Setup(); variable
136 EXPECT_EQ(Utils::TIMER_ERR_OK, ret);
215 uint32_t ret = timer.Setup(); variable
216 EXPECT_EQ(Utils::TIMER_ERR_OK, ret);
239 uint32_t ret = timer.Setup(); variable
240 EXPECT_EQ(Utils::TIMER_ERR_OK, ret);
[all …]
Dutils_datetime_test.cpp77 bool ret = GetSystemCurrentTime(&curTime); variable
78 EXPECT_EQ(ret, true);
79 ret = GetSystemCurrentTime(nullptr);
80 EXPECT_EQ(ret, false);
117 bool ret = GetSystemCurrentTime(&curTime); variable
118 EXPECT_EQ(ret, true);
123 ret = GetSystemCurrentTime(&curTime2);
124 EXPECT_EQ(ret, true);
136 bool ret = GetLocalTimeZone(timezone); variable
137 EXPECT_EQ(ret, true);
/commonlibrary/rust/ylong_runtime/ylong_runtime/tests/
Dasync_fs.rs111 let ret = file.write_all(&buf).await; in sdv_async_fs_rw() localVariable
112 assert!(ret.is_ok()); in sdv_async_fs_rw()
125 let mut ret = file.read(&mut buf).await.unwrap(); in sdv_async_fs_rw() localVariable
126 while ret == 0 { in sdv_async_fs_rw()
127 ret = file.read(&mut buf).await.unwrap(); in sdv_async_fs_rw()
129 assert_eq!(ret, 3); in sdv_async_fs_rw()
132 let ret = file.read(&mut buf).await.unwrap(); in sdv_async_fs_rw() localVariable
133 assert_eq!(ret, 2); in sdv_async_fs_rw()
136 let mut ret = file.read_to_end(&mut buf).await.unwrap(); in sdv_async_fs_rw() localVariable
137 while ret == 0 { in sdv_async_fs_rw()
[all …]
Dspawn.rs40 let ret = ylong_runtime::block_on(handle); in sdv_one_core_test() localVariable
41 assert_eq!(ret.unwrap(), times); in sdv_one_core_test()
57 let ret = ylong_runtime::block_on(handle); in sdv_two_core_test() localVariable
58 assert_eq!(ret.unwrap(), times); in sdv_two_core_test()
74 let ret = ylong_runtime::block_on(handle); in sdv_three_core_test() localVariable
75 assert_eq!(ret.unwrap(), times); in sdv_three_core_test()
91 let ret = ylong_runtime::block_on(handle); in sdv_four_core_test() localVariable
92 assert_eq!(ret.unwrap(), times); in sdv_four_core_test()
108 let ret = ylong_runtime::block_on(handle); in sdv_eight_core_test() localVariable
109 assert_eq!(ret.unwrap(), times); in sdv_eight_core_test()
[all …]
Dsingleton_runtime.rs53 let ret = ylong_runtime::block_on(handle); in sdv_concurrently_runtime_spawn_async_in_async_task() localVariable
54 assert_eq!(ret.unwrap(), (times, times + 1)); in sdv_concurrently_runtime_spawn_async_in_async_task()
81 let ret = ylong_runtime::block_on(handle); in sdv_concurrently_spawn_async_in_async_task() localVariable
82 assert_eq!(ret.unwrap(), (times, times + 1)); in sdv_concurrently_spawn_async_in_async_task()
110 let ret = ylong_runtime::block_on(handle); in sdv_concurrently_task_builder_spawn_async_in_async_task() localVariable
111 assert_eq!(ret.unwrap(), (times, times + 1)); in sdv_concurrently_task_builder_spawn_async_in_async_task()
131 let ret = ylong_runtime::block_on(async move { in sdv_global_block_on() localVariable
135 assert_eq!(ret, 0) in sdv_global_block_on()
147 let ret = RuntimeBuilder::new_multi_thread() in sdv_build_global_failed() localVariable
150 assert!(ret.is_err()); in sdv_build_global_failed()
Djoin_set.rs40 let ret = ylong_runtime::block_on(set.join_next()).unwrap().unwrap(); in sdv_join_set_spawn_simple() localVariable
41 assert_eq!(ret, 1); in sdv_join_set_spawn_simple()
77 let ret = ylong_runtime::block_on(set.join_next()).unwrap().unwrap(); in sdv_join_set_spawn_pending() localVariable
78 assert_eq!(ret, 1); in sdv_join_set_spawn_pending()
143 let ret = set.join_next().await.unwrap().unwrap(); in sdv_join_set_spawn_multiple() localVariable
144 assert_eq!(ret, 1); in sdv_join_set_spawn_multiple()
199 let ret = set.join_next().await.unwrap().unwrap_err(); in sdv_join_set_cancel_one() localVariable
200 assert_eq!(ret.kind(), ErrorKind::TaskCanceled); in sdv_join_set_cancel_one()
228 let ret = set.join_next().await.unwrap().unwrap_err(); in sdv_join_set_cancel_all() localVariable
229 assert_eq!(ret.kind(), ErrorKind::TaskCanceled); in sdv_join_set_cancel_all()
[all …]
Dasync_buf_read.rs38 let ret = buf_reader.read_until(b':', &mut res).await.unwrap(); in sdv_buf_reader_read_until() localVariable
39 assert_eq!(ret, 4); in sdv_buf_reader_read_until()
43 let ret = buf_reader.read(&mut buf).await.unwrap(); in sdv_buf_reader_read_until() localVariable
44 assert_eq!(ret, 3); in sdv_buf_reader_read_until()
82 let ret = buf_reader.read_line(&mut res).await.unwrap(); in sdv_buf_reader_read_line() localVariable
83 assert_eq!(ret, 6); in sdv_buf_reader_read_line()
85 let ret = buf_reader.read_line(&mut res).await.unwrap(); in sdv_buf_reader_read_line() localVariable
86 assert_eq!(ret, 4); in sdv_buf_reader_read_line()
219 let ret = buf_reader.read_until(b'-', &mut res).await.unwrap(); in sdv_buf_reader_seek() localVariable
220 assert_eq!(ret, 6); in sdv_buf_reader_seek()
[all …]
Dasync_buf_write.rs36 let ret = stream.read(&mut buf).await.unwrap(); in sdv_buf_writer_write() localVariable
37 assert_eq!(ret, 6); in sdv_buf_writer_write()
75 let ret = stream.read(&mut buf).await.unwrap(); in sdv_buf_writer_write_vectored() localVariable
76 assert_eq!(ret, 17); in sdv_buf_writer_write_vectored()
130 let ret = buf_writer.read(&mut buf).await.unwrap(); in sdv_buf_writer_seek() localVariable
132 assert_eq!(ret, 12); in sdv_buf_writer_seek()
138 let ret = buf_writer.read(&mut buf).await.unwrap(); in sdv_buf_writer_seek() localVariable
140 assert_eq!(ret, 5); in sdv_buf_writer_seek()
145 let ret = buf_writer.read(&mut buf).await.unwrap(); in sdv_buf_writer_seek() localVariable
147 assert_eq!(ret, 5); in sdv_buf_writer_seek()
/commonlibrary/c_utils/base/test/unittest/rust/
Drust_utils_directory_test.rs126 let mut ret = directory_ex::ffi::ForceCreateDirectory(&dirpath); in test_force_create_directory_001() localVariable
127 assert!(ret); in test_force_create_directory_001()
128 ret = directory_ex::ffi::IsEmptyFolder(&dirpath); in test_force_create_directory_001()
129 assert!(ret); in test_force_create_directory_001()
137 let ret = directory_ex::ffi::ForceRemoveDirectory(&dirpath); in test_force_remove_directory_001() localVariable
138 assert!(ret); in test_force_remove_directory_001()
145 let ret = directory_ex::ffi::ForceRemoveDirectory(&dirpath); in test_force_remove_directory_002() localVariable
146 assert!(!ret); in test_force_remove_directory_002()
153 let mut ret = directory_ex::ffi::ForceCreateDirectory(&dirpath); in test_remove_file_001() localVariable
154 assert!(ret); in test_remove_file_001()
[all …]
Drust_utils_file_test.rs61 let ret = file_ex::ffi::RustLoadBufferFromFile(&filename, &mut buff); in test_load_string_from_file_001() localVariable
62 assert!(ret); in test_load_string_from_file_001()
199 let ret = file_ex::ffi::RustSaveStringToFile(&path, &new_content, true); in test_save_string_to_file_001() localVariable
200 assert!(ret); in test_save_string_to_file_001()
233 let ret = file_ex::ffi::RustLoadStringFromFile(&path, &mut load_result); in test_save_string_to_file_003() localVariable
235 assert!(ret); in test_save_string_to_file_003()
248 let ret = file_ex::ffi::RustLoadStringFromFile(&path, &mut load_result); in test_save_string_to_file_004() localVariable
250 assert!(ret); in test_save_string_to_file_004()
264 let ret = file_ex::ffi::RustLoadStringFromFile(&path, &mut load_result); in test_save_string_to_file_005() localVariable
266 assert!(ret); in test_save_string_to_file_005()
[all …]
/commonlibrary/utils_lite/js/builtin/filekit/src/
Dnativeapi_fs.cpp100 int ret = GetFullPath(src, g_uriFullPath, sizeof(g_uriFullPath)); in ExecuteCopyFile() local
102 if (ret != NATIVE_SUCCESS) { in ExecuteCopyFile()
103 NativeapiCommon::FailCallBack(thisVal, args, ret); in ExecuteCopyFile()
111 ret = GetFullPath(dest, destFullPath, FILE_NAME_MAX_LEN + 1); in ExecuteCopyFile()
112 if (ret != NATIVE_SUCCESS) { in ExecuteCopyFile()
113 NativeapiCommon::FailCallBack(thisVal, args, ret); in ExecuteCopyFile()
116 ret = CopyFileImpl(g_uriFullPath, destFullPath); in ExecuteCopyFile()
117 if (ret != NATIVE_SUCCESS) { in ExecuteCopyFile()
118 NativeapiCommon::FailCallBack(thisVal, args, ret); in ExecuteCopyFile()
122 ret = DeleteFileImpl(g_uriFullPath); in ExecuteCopyFile()
[all …]
Dnativeapi_fs_impl.c70 int ret = ERROR_CODE_GENERAL; in RmdirRecursive() local
73 return ret; in RmdirRecursive()
96 ret = RmdirRecursive(fullPath); in RmdirRecursive()
98 ret = unlink(fullPath); in RmdirRecursive()
100 if (ret != NATIVE_SUCCESS) { in RmdirRecursive()
105 ret = rmdir(fileName); in RmdirRecursive()
111 return ret; in RmdirRecursive()
125 int ret = NATIVE_SUCCESS; in MakeParent() local
139 ret = mkdir(fullPath); in MakeParent()
141 ret = mkdir(fullPath, S_IRUSR | S_IWUSR | S_IXUSR); in MakeParent()
[all …]
/commonlibrary/utils_lite/js/builtin/kvstorekit/src/
Dnativeapi_kv.cpp75 int ret = GetFullPath(dataPath, key); in GetValueInner() local
76 if (ret != NATIVE_SUCCESS) { in GetValueInner()
77 return ret; in GetValueInner()
84 int ret = GetFullPath(dataPath, key); in SetValueInner() local
85 if (ret != NATIVE_SUCCESS) { in SetValueInner()
86 return ret; in SetValueInner()
93 int ret = GetFullPath(dataPath, key); in DeleteValueInner() local
94 if (ret != NATIVE_SUCCESS) { in DeleteValueInner()
95 return ret; in DeleteValueInner()
129 int ret = ERROR_CODE_GENERAL; in ExecuteGet() local
[all …]
Dnativeapi_kv_impl.c81 int ret = GetKvFolder(dataPath); in InitKv() local
82 if (ret != NATIVE_SUCCESS) { in InitKv()
83 return ret; in InitKv()
148 int ret = write(fd, value, strlen(value)); in SetValue() local
150 return (ret < 0) ? ERROR_CODE_IO : NATIVE_SUCCESS; in SetValue()
166 int ret = GetKvFolder(dataPath); in ClearKVStore() local
167 if (ret != NATIVE_SUCCESS) { in ClearKVStore()
168 return ret; in ClearKVStore()
170 ret = ERROR_CODE_GENERAL; in ClearKVStore()
173 return ret; in ClearKVStore()
[all …]
/commonlibrary/utils_lite/js/builtin/common/src/
Dnativeapi_common.cpp22 void NativeapiCommon::FailCallBack(const JSIValue thisVal, const JSIValue args, int ret) in FailCallBack() argument
28 if (ret == ERROR_CODE_IO) { in FailCallBack()
30 ret = (-ERROR_CODE_IO); in FailCallBack()
31 } else if ((ret == ERROR_CODE_PARAM) || (ret == ERROR_DIR_NOT_EMPTY)) { in FailCallBack()
33 ret = (-ERROR_CODE_PARAM); in FailCallBack()
34 } else if (ret == ERROR_FR_NO_FILE) { in FailCallBack()
36 ret = (-ERROR_CODE_NO_FILE); in FailCallBack()
37 } else if (ret == ERROR_CODE_READ_TOO_LONG) { in FailCallBack()
39 ret = (-ERROR_CODE_READ_TOO_LONG); in FailCallBack()
42 ret = (-ERROR_CODE_GENERAL); in FailCallBack()
[all …]
/commonlibrary/c_utils/base/src/
Dashmem.cpp76 int ret = TEMP_FAILURE_RETRY(fstat(fd, &st)); in AshmemOpenLocked() local
77 if (ret < 0) { in AshmemOpenLocked()
78 UTILS_LOGE("%{public}s: Failed to exec fstat, ret = %{public}d", __func__, ret); in AshmemOpenLocked()
80 return ret; in AshmemOpenLocked()
106 int ret; in AshmemCreate() local
115 ret = strcpy_s(buf, sizeof(buf), name); in AshmemCreate()
116 if (ret != EOK) { in AshmemCreate()
117 …OGE("%{public}s: Failed to exec strcpy_s, name= %{public}s, ret= %{public}d", __func__, name, ret); in AshmemCreate()
121 ret = TEMP_FAILURE_RETRY(ioctl(fd, ASHMEM_SET_NAME, buf)); in AshmemCreate()
122 if (ret < 0) { in AshmemCreate()
[all …]
Devent_reactor.cpp53 …uint32_t ret = demultiplexer_->StartUp(); // return TIME_ERR_OK, if demultiplexer has been started. in SetUp() local
54 if (ret != 0) { in SetUp()
56 return ret; in SetUp()
100 uint32_t ret = handler->Initialize(); in ScheduleTimer() local
101 if (ret != TIMER_ERR_OK) { in ScheduleTimer()
103 return ret; in ScheduleTimer()
/commonlibrary/memory_utils/libdmabufheap/src/
Ddmabuf_alloc.c62 errno_t ret = strcat_s(heapPath, HEAP_PATH_LEN, heapName); in DmabufHeapOpen() local
63 if (ret != EOK) { in DmabufHeapOpen()
64 HILOG_ERROR(LOG_CORE, "strcat_s is wrong, heapName = %s, ret = %d.", heapName, ret); in DmabufHeapOpen()
88 int ret = ioctl(heapFd, DMA_HEAP_IOCTL_ALLOC, &data); in DmabufHeapBufferAlloc() local
89 if (ret < 0) { in DmabufHeapBufferAlloc()
90 HILOG_ERROR(LOG_CORE, "alloc buffer failed, size = %zu, ret = %d.", buffer->size, ret); in DmabufHeapBufferAlloc()
91 return ret; in DmabufHeapBufferAlloc()
95 return ret; in DmabufHeapBufferAlloc()
/commonlibrary/c_utils/base/include/
Dsafe_map.h101 auto ret = map_.insert(std::pair<K, V>(key, value)); in Insert() local
102 return ret.second; in Insert()
116 auto ret = map_.insert(std::pair<K, V>(key, value)); in EnsureInsert() local
118 if (!ret.second) { in EnsureInsert()
119 map_.erase(ret.first); in EnsureInsert()
136 bool ret = false; in Find() local
142 ret = true; in Find()
145 return ret; in Find()
159 bool ret = false; in FindOldAndSetNew() local
167 ret = true; in FindOldAndSetNew()
[all …]
/commonlibrary/memory_utils/libpurgeablemem/test/
Dpurgeable_cpp_test.cpp209 int ret = 1; variable
212 ret = strncmp(alphabet, static_cast<char *>(pobj->GetContent()), 26);
221 EXPECT_EQ(ret, 0);
237 int ret = 1; variable
240 ret = strncmp(alphabet, static_cast<char *>(pobj->GetContent()), 26);
249 EXPECT_EQ(ret, 0);
269 int ret = 1; variable
272 ret = strncmp(alphabet, static_cast<char *>(pobj->GetContent()), 26);
281 EXPECT_EQ(ret, 0);
298 int ret = 1; variable
[all …]
Dpurgeableashmem_test.cpp267 int ret = 1; variable
270 ret = strncmp(alphabet, static_cast<char *>(pobj->GetContent()), 26);
279 EXPECT_EQ(ret, 0);
296 int ret = 1; variable
299 ret = strncmp(alphabet, static_cast<char *>(pobj->GetContent()), 26);
308 EXPECT_EQ(ret, 0);
329 int ret = 1; variable
332 ret = strncmp(alphabet, static_cast<char *>(pobj->GetContent()), 26);
341 EXPECT_EQ(ret, 0);
359 int ret = 1; variable
[all …]
/commonlibrary/utils_lite/kal/timer/src/
Dkal.c67 int ret = timer_create(CLOCK_REALTIME, &evp, &timer); in KalTimerCreate() local
68 if (ret != 0) { in KalTimerCreate()
89 int ret = timer_settime(tmpPtr->timerPtr, 0, &ts, NULL); in KalTimerStart() local
90 if (ret != 0) { in KalTimerStart()
112 int ret = timer_settime(tmpPtr->timerPtr, 0, &ts, NULL); in KalTimerChange() local
113 if (ret != 0) { in KalTimerChange()
131 int ret = timer_settime(tmpPtr->timerPtr, 0, &ts, NULL); in KalTimerStop() local
132 if (ret != 0) { in KalTimerStop()
145 int ret = timer_delete(tmpPtr->timerPtr); in KalTimerDelete() local
147 return (ret != 0) ? KAL_ERR_INNER : KAL_OK; in KalTimerDelete()

12345