MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / TEST

Function TEST

test/sort_by_key.cpp:123–142  ·  view source on GitHub ↗

///////////////////////////////// CPP ///////////////////////////////

Source from the content-addressed store, hash-verified

121////////////////////////////////////// CPP ///////////////////////////////
122//
123TEST(SortByKey, CPPDim0) {
124 const bool dir = true;
125 const unsigned resultIdx0 = 0;
126 const unsigned resultIdx1 = 1;
127
128 vector<dim4> numDims;
129 vector<vector<float>> in;
130 vector<vector<float>> tests;
131 readTests<float, float, int>(string(TEST_DIR "/sort/sort_by_key_tiny.test"),
132 numDims, in, tests);
133
134 dim4 idims = numDims[0];
135 array keys(idims, &(in[0].front()));
136 array vals(idims, &(in[1].front()));
137 array out_keys, out_vals;
138 sort(out_keys, out_vals, keys, vals, 0, dir);
139
140 ASSERT_VEC_ARRAY_EQ(tests[resultIdx0], idims, out_keys);
141 ASSERT_VEC_ARRAY_EQ(tests[resultIdx1], idims, out_vals);
142}
143
144TEST(SortByKey, CPPDim1) {
145 const bool dir = true;

Callers

nothing calls this directly

Calls 2

sortFunction · 0.50
reorderFunction · 0.50

Tested by

no test coverage detected