1 ## Check how obj2yaml produces SHT_HASH section descriptions.
3 ## Check that obj2yaml uses "Bucket" and "Chain" tags to describe
4 ## a SHT_HASH section when it has content of a correct size.
5 ## I.e. data size == 4 * (2 + nbucket + nchain).
7 # RUN: yaml2obj --docnum=1 %s -o %t1
8 # RUN: obj2yaml %t1 | FileCheck %s --check-prefix=CHAIN-BUCKET
10 # CHAIN-BUCKET: - Name: .hash1
11 # CHAIN-BUCKET-NEXT: Type: SHT_HASH
12 # CHAIN-BUCKET-NEXT: Bucket: [ 3 ]
13 # CHAIN-BUCKET-NEXT: Chain: [ 4, 5 ]
14 # CHAIN-BUCKET: - Name: .hash2
15 # CHAIN-BUCKET-NEXT: Type: SHT_HASH
16 # CHAIN-BUCKET-NEXT: Bucket: [ ]
17 # CHAIN-BUCKET-NEXT: Chain: [ ]
26 ## Case 1: A non-empty hash table: nbucket == 1, nchain == 2.
29 Content: '0100000002000000030000000400000005000000'
30 ## Case 2: An empty hash table: nbucket == 0, nchain == 0.
33 Content: '0000000000000000'
35 ## Check that obj2yaml falls back to using the "Content" tag when
36 ## hash sections are broken.
38 # RUN: yaml2obj --docnum=2 %s -o %t2
39 # RUN: obj2yaml %t2 | FileCheck %s --check-prefix=CONTENT
41 # CONTENT: - Name: .empty_hash
42 # CONTENT-NEXT: Type: SHT_HASH
43 # CONTENT-NEXT: Content: ''
44 # CONTENT-NEXT: - Name: .invalid_header
45 # CONTENT-NEXT: Type: SHT_HASH
46 # CONTENT-NEXT: Content: '00'
47 # CONTENT-NEXT: - Name: .truncated
48 # CONTENT-NEXT: Type: SHT_HASH
49 # CONTENT-NEXT: Content: '01000000020000000300000004000000'
50 # CONTENT-NEXT: - Name: .oversized
51 # CONTENT-NEXT: Type: SHT_HASH
52 # CONTENT-NEXT: Content: '0100000002000000030000000400000000'
61 ## Case 1: section has no data.
65 ## Case 2: section size is less than 2 * 4.
66 - Name: .invalid_header
69 ## Case 3: nbucket == 1, nchain == 2.
70 ## Section size is less than (2 * nbucket + nchain) * 4.
73 Content: '01000000020000000300000004000000'
74 ## Case 4: nbucket == 1, nchain == 2.
75 ## Section size is greater than (2 * nbucket + nchain) * 4.
78 Content: '0100000002000000030000000400000000'