echo 'Deleted row rand: ' . $res[0]['rand'] . '<br><br>'; foreach ($data as $k => $v) { if ($v['bad_rand'] != $bad_rand) { continue; } unset($data[$k]); if ($deleted_res2[0]['id'] != $k) { die('Invalid deleted ID.'); } break; } echo 'Doing third SELECT.<br>'; $res = $db->select(TABLE, array('col' => 'id,rand,bad_rand,data', 'order' => 'id', 'limit' => '0,' . $rows, 'cond' => 'bad_rand = ' . $bad_rand)); $third = sizeof($res); echo 'Rows acquired: ' . $third . '<br><br>'; check_consistency(); if ($first - 2 != $third) { die('Test failed'); } } $TIERs_time[$J] = microtime(true) - $start; } $times = array(); foreach ($TIERs_time as $k => $v) { $times[] = 'tier ' . $k . ' -- ' . round($v, 1) . ' sec'; } echo '<script>alert("All tests passed [' . implode(',', $times) . ', total ' . round(microtime(true) - START, 1) . ' sec]!");</script>'; break; case 'clean': system('rm -rf data/*'); break;
// fi not really, but very close $lang['se'] = ['no', 'sv', 'fi', 'rus']; $lang['fi'] = ['se', 'rus', 'et', 'sv']; $lang['et'] = ['fi', 'rus', 'lv']; $lang['bg'] = ['sq', 'bcs', 'ron', 'tur', 'el']; $lang['ron'] = ['bcs', 'hun', 'ukr', 'bg']; $lang['cs'] = ['deu', 'pol', 'sk']; $lang['sk'] = ['cs', 'pol', 'ukr', 'hun', 'deu']; $lang['hun'] = ['deu', 'sk', 'ukr', 'ron', 'bcs', 'sl']; $lang['sl'] = ['rm', 'deu', 'ita', 'hun', 'bcs']; $lang['bcs'] = ['sl', 'hun', 'ron', 'bg', 'sq']; $lang['sq'] = ['bcs', 'bg', 'el']; $lang['el'] = ['sq', 'bg', 'tur']; $lang['tur'] = ['bg', 'el']; $lang['kv'] = ['rus']; $lang['udm'] = ['rus', 'tt']; $lang['tt'] = ['rus', 'udm', 'chm', 'cv', 'ba']; $lang['ba'] = ['tt', 'rus', 'cv']; $lang['cv'] = ['rus', 'chm', 'tt', 'ba']; $lang['chm'] = ['cv', 'tt', 'rus']; check_consistency($lang); function check_consistency(array $matrix) { foreach ($matrix as $code => $neighbors) { foreach ($neighbors as $neighbor) { if (!in_array($code, $matrix[$neighbor])) { throw new Exception($neighbor . ' present in ' . $code . ', but not vice versa'); } } } }