Test Chern number calculation