Rizin
unix-like reverse engineering framework and cli tools
test-lz4-list.TestNonVerbose Class Reference
Inheritance diagram for test-lz4-list.TestNonVerbose:

Public Member Functions

def setUpClass (self)
 
def test_frames (self)
 
def test_frame_types (self)
 
def test_block (self)
 
def test_compressed_size (self)
 
def test_ratio (self)
 
def test_uncompressed_size (self)
 

Public Attributes

 nvinfo_list
 

Detailed Description

Definition at line 35 of file test-lz4-list.py.

Member Function Documentation

◆ setUpClass()

def test-lz4-list.TestNonVerbose.setUpClass (   self)

Definition at line 37 of file test-lz4-list.py.

37  def setUpClass(self):
38  self.nvinfo_list = []
39  for i, line in enumerate(execute("{} --list -m {}/test_list_*.lz4".format(LZ4, TEMP), print_output=True)):
40  if i > 0:
41  self.nvinfo_list.append(NVerboseFileInfo(line))
42 
#define append(x, y)
Definition: cmd_print.c:1740
def execute(command, print_command=True, print_output=False, print_error=True, param_shell=True)

◆ test_block()

def test-lz4-list.TestNonVerbose.test_block (   self)

Definition at line 67 of file test-lz4-list.py.

67  def test_block(self):
68  for nvinfo in self.nvinfo_list:
69  # if "-leg" in nvinfo.filename or "-skip" in nvinfo.filename:
70  # self.assertEqual(nvinfo.block, "-", nvinfo.line)
71  if "--BD" in nvinfo.filename:
72  self.assertRegex(nvinfo.block, "^B[0-9]+D$", nvinfo.line)
73  elif "--BI" in nvinfo.filename:
74  self.assertRegex(nvinfo.block, "^B[0-9]+I$", nvinfo.line)
75 

References test-lz4-list.TestNonVerbose.nvinfo_list.

◆ test_compressed_size()

def test-lz4-list.TestNonVerbose.test_compressed_size (   self)

Definition at line 76 of file test-lz4-list.py.

76  def test_compressed_size(self):
77  for nvinfo in self.nvinfo_list:
78  self.assertEqual(nvinfo.compressed, to_human(nvinfo.exp_comp_size), nvinfo.line)
79 
def to_human(size)

References test-lz4-list.TestNonVerbose.nvinfo_list, and test-lz4-list.to_human().

◆ test_frame_types()

def test-lz4-list.TestNonVerbose.test_frame_types (   self)

Definition at line 58 of file test-lz4-list.py.

58  def test_frame_types(self):
59  for nvinfo in self.nvinfo_list:
60  if "-lz4f-" in nvinfo.filename:
61  self.assertEqual(nvinfo.type, "LZ4Frame", nvinfo.line)
62  elif "-legc-" in nvinfo.filename:
63  self.assertEqual(nvinfo.type, "LegacyFrame", nvinfo.line)
64  elif "-skip-" in nvinfo.filename:
65  self.assertEqual(nvinfo.type, "SkippableFrame", nvinfo.line)
66 

References test-lz4-list.TestNonVerbose.nvinfo_list.

◆ test_frames()

def test-lz4-list.TestNonVerbose.test_frames (   self)

Definition at line 43 of file test-lz4-list.py.

43  def test_frames(self):
44  all_concat_frames = 0
45  all_concat_index = None
46  for i, nvinfo in enumerate(self.nvinfo_list):
47  if "concat-all" in nvinfo.filename:
48  all_concat_index = i
49  elif "2f--content-size" in nvinfo.filename:
50  self.assertEqual("2", nvinfo.frames, nvinfo.line)
51  all_concat_frames += 2
52  else:
53  self.assertEqual("1", nvinfo.frames, nvinfo.line)
54  all_concat_frames += 1
55  self.assertNotEqual(None, all_concat_index, "Couldn't find concat-all file index.")
56  self.assertEqual(self.nvinfo_list[all_concat_index].frames, str(all_concat_frames), self.nvinfo_list[all_concat_index].line)
57 

References test-lz4-list.TestNonVerbose.nvinfo_list, and cmd_descs_generate.str.

◆ test_ratio()

def test-lz4-list.TestNonVerbose.test_ratio (   self)

Definition at line 80 of file test-lz4-list.py.

80  def test_ratio(self):
81  for nvinfo in self.nvinfo_list:
82  if "--content-size" in nvinfo.filename:
83  self.assertEqual(nvinfo.ratio, "{:.2f}%".format(float(nvinfo.exp_comp_size) / float(nvinfo.exp_unc_size) * 100), nvinfo.line)
84 

References test-lz4-speed.float, and test-lz4-list.TestNonVerbose.nvinfo_list.

◆ test_uncompressed_size()

def test-lz4-list.TestNonVerbose.test_uncompressed_size (   self)

Definition at line 85 of file test-lz4-list.py.

85  def test_uncompressed_size(self):
86  for nvinfo in self.nvinfo_list:
87  if "--content-size" in nvinfo.filename:
88  self.assertEqual(nvinfo.uncompressed, to_human(nvinfo.exp_unc_size), nvinfo.line)
89 
90 

References test-lz4-list.TestNonVerbose.nvinfo_list, and test-lz4-list.to_human().

Member Data Documentation

◆ nvinfo_list


The documentation for this class was generated from the following file: