From 6e0a01e2da2388266fdb4a7e4a3eae6428db7216 Mon Sep 17 00:00:00 2001 From: zhangcui Date: Wed, 21 Sep 2022 10:13:38 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E7=90=86codex=E5=91=8A=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangcui --- script/hiperf_utils.py | 1 + script/recv_binary_cache.py | 4 ++-- script/test/test_utils.py | 5 +---- test/unittest/common/native/ring_buffer_test.cpp | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/script/hiperf_utils.py b/script/hiperf_utils.py index ed624f1..8864a35 100644 --- a/script/hiperf_utils.py +++ b/script/hiperf_utils.py @@ -346,6 +346,7 @@ class LocalLibDownload: else: elf_struct.path = path + @classmethod def __get_need_architectures(self, device_arch): if device_arch == 'x86_64': return ['x86', 'x86_64'] diff --git a/script/recv_binary_cache.py b/script/recv_binary_cache.py index b187663..9f91800 100644 --- a/script/recv_binary_cache.py +++ b/script/recv_binary_cache.py @@ -169,10 +169,10 @@ class GetLibFiles(object): if (self.hdc.run_hdc_cmd(['shell', 'cp', device_path, '/data/local/tmp']) and self.hdc.run_hdc_cmd(['file recv', - '/data/local/tmp/' + filename, + os.path.join('/data/local/tmp/', filename), host_path])): self.hdc.run_hdc_cmd(['shell', 'rm', - '/data/local/tmp/' + filename]) + os.path.join('/data/local/tmp/', filename)]) return True print('failed to pull %s from device' % device_path) return False diff --git a/script/test/test_utils.py b/script/test/test_utils.py index 1625f8e..6c12c1a 100644 --- a/script/test/test_utils.py +++ b/script/test/test_utils.py @@ -25,9 +25,6 @@ from hiperf_utils import executable_file_available from hiperf_utils import find_tool_path -SO = 'libhiperf_report.z.so' - - class TestUtils(unittest.TestCase): def setUp(self): @@ -42,7 +39,7 @@ class TestUtils(unittest.TestCase): self.assertEqual(result, True) def test_is_elf_file(self): - result = is_elf_file(SO) + result = is_elf_file('libhiperf_report.z.so') self.assertEqual(result, True) def test_remove(self): diff --git a/test/unittest/common/native/ring_buffer_test.cpp b/test/unittest/common/native/ring_buffer_test.cpp index 1286791..fbb813e 100644 --- a/test/unittest/common/native/ring_buffer_test.cpp +++ b/test/unittest/common/native/ring_buffer_test.cpp @@ -60,7 +60,7 @@ void RingBufferTest::ReadBufferAndCheck(RingBuffer &buf) uint8_t *p = nullptr; while ((p = buf.GetReadData()) != nullptr) { ASSERT_EQ(memcpy_s(&readData, sizeof(perf_event_header), p, sizeof(perf_event_header)), 0); - ASSERT_EQ(checkSize, readData.size) + ASSERT_EQ(checkSize, readData.size) \ << " read data size " << readData.size << " expect data size " << checkSize; p += sizeof(perf_event_header); uint8_t data = static_cast(checkSize & U8MASK);