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) {
124124
125125 void setSystemChar (final int index , final char value ) {
126126 assert 0 <= index && index < SYSTEM_CHARS_LENGTH ;
127- buffer .setWritePosition (SYSTEM_CHARS_LENGTH + index );
127+ buffer .setWritePosition (SYSTEM_CHARS_START + index );
128128 buffer .writeChar (value );
129129 }
130130
Original file line number Diff line number Diff line change @@ -183,6 +183,18 @@ public void shouldThrowExceptionIfSystemCharsIsNull() {
183183 builder .setSystemChars (null ); // Exception expected
184184 }
185185
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+ }
186198 @ Test (expected = IllegalArgumentException .class )
187199 public void shouldThrowExceptionIfSystemCharIndexGreaterThan2 () {
188200 builder .setSystemChar (3 , '1' );
You can’t perform that action at this time.
0 commit comments