Test for buildIndex