| 16 | } |
| 17 | |
| 18 | static void testRoundtrip() |
| 19 | { |
| 20 | AppleSingle t; |
| 21 | t.data = Bytes("This is the data fork"); |
| 22 | t.rsrc = Bytes("This is the resource fork"); |
| 23 | t.creator = Bytes("CREA"); |
| 24 | t.type = Bytes("TYPE"); |
| 25 | |
| 26 | Bytes tb = t.render(); |
| 27 | AppleSingle s; |
| 28 | s.parse(tb); |
| 29 | |
| 30 | AssertThat(s.data, Equals(t.data)); |
| 31 | AssertThat(s.rsrc, Equals(t.rsrc)); |
| 32 | AssertThat(s.creator, Equals(t.creator)); |
| 33 | AssertThat(s.type, Equals(t.type)); |
| 34 | } |
| 35 | |
| 36 | int main(void) |
| 37 | { |