int teste2 (int vetor[], int n){ int i; for (i = 0; i < n; i++) if (teste1(vetor,n,i+1) == 0) return 0; return 1; }
//@tests void tests(){ cerr << "#open selection_sort PRATA IF FOR" << endl; vector<int> v1 ({1}); vector<int> v2 ({2,1}); vector<int> v3 ({5,4,3,2,1}); vector<int> v4 ({1,9,2,8,3,7,5, 6, 4}); vector<int> teste1 ({1}); vector<int> teste2 ({1,2}); vector<int> teste3 ({1,2,3,4,5}); vector<int> teste4 ({1,2,3,4,5,6,7,8,9}); cerr << (teste1 == ordenar(v1)); cerr << (teste2 == ordenar(v2)); cerr << (teste3 == ordenar(v3)); cerr << (teste4 == ordenar(v4)); }