TEST _tax_uniqueness_test(void) { s32 country_count = country::get_count(); for (s32 i = 0; i < country_count; i++) { tax_rate* trb1 = (tax_rate*)memops::alloc(sizeof(tax_rate) * 500); u32 trc1 = country::get_available_tax_rates(country::get_code_by_index(i), trb1, 500); // check for duplicates in country. for (u32 x1 = 0; x1 < trc1; x1++) { for (u32 x2 = 0; x2 < trc1; x2++) { if (x1 == x2) continue; if (strops::equals(trb1[x1].internal_code, trb1[x2].internal_code)) { FAIL(); } } } // cross check with other countries. for (s32 x = 0; x < country_count; x++) { if (x==i) continue; tax_rate* trb2 = (tax_rate*)memops::alloc(sizeof(tax_rate) * 500); u32 trc2 = country::get_available_tax_rates(country::get_code_by_index(x), trb2, 500); for (u32 x1 = 0; x1 < trc1; x1++) { for (u32 x2 = 0; x2 < trc2; x2++) { if (strops::equals(trb1[x1].internal_code, trb2[x2].internal_code)) { FAIL(); } } } } } PASS(); } SUITE(tax_generic_tests) { RUN_TEST(_tax_uniqueness_test); }