File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
main/java/org/metafacture/biblio/iso2709
test/java/org/metafacture/biblio/iso2709 Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ void setSystemChars(final char[] systemChars) {
124
124
125
125
void setSystemChar (final int index , final char value ) {
126
126
assert 0 <= index && index < SYSTEM_CHARS_LENGTH ;
127
- buffer .setWritePosition (SYSTEM_CHARS_LENGTH + index );
127
+ buffer .setWritePosition (SYSTEM_CHARS_START + index );
128
128
buffer .writeChar (value );
129
129
}
130
130
Original file line number Diff line number Diff line change @@ -183,6 +183,18 @@ public void shouldThrowExceptionIfSystemCharsIsNull() {
183
183
builder .setSystemChars (null ); // Exception expected
184
184
}
185
185
186
+ @ Test
187
+ public void shouldWriteSystemCharToRecordLabel () {
188
+ builder .setSystemChar (0 , 'U' );
189
+ builder .setSystemChar (1 , 'S' );
190
+ builder .setSystemChar (2 , 'C' );
191
+
192
+ final byte [] record = builder .build ();
193
+
194
+ assertEquals (0x55 , record [17 ]);
195
+ assertEquals (0x53 , record [18 ]);
196
+ assertEquals (0x43 , record [19 ]);
197
+ }
186
198
@ Test (expected = IllegalArgumentException .class )
187
199
public void shouldThrowExceptionIfSystemCharIndexGreaterThan2 () {
188
200
builder .setSystemChar (3 , '1' );
You can’t perform that action at this time.
0 commit comments