add a test (Close #24)

Issue #24 has been fixed by the following commits:
 * b9fba1dc63ccb42a86e934011b468e6022fabb74
 * c1fc76b9bd463948ffc5058bc352bf93732f0314
 * a0efc0a200f7108ca3d5ac3039c8f952e0051619

Segmentation fault might occur before the fix.