Testing Chips with Mesh-Based Network-on-Chip