diff --git a/applications/test/ListOps/Test-ListOps.C b/applications/test/ListOps/Test-ListOps.C index e722ced197..c4fb44a0f5 100644 --- a/applications/test/ListOps/Test-ListOps.C +++ b/applications/test/ListOps/Test-ListOps.C @@ -125,7 +125,6 @@ int main(int argc, char *argv[]) ) << nl << endl; - test6.append(identity(13)); // Randomize the list @@ -135,6 +134,45 @@ int main(int argc, char *argv[]) inplaceUniqueSort(test6); Info<< "Unique : " << flatOutput(test6) << endl; + + // List reorder + labelList oldToNew(identity(40)); + std::random_shuffle(oldToNew.begin(), oldToNew.end()); + + // Force a few -1: + oldToNew[4] = oldToNew[8] = -1; + + Info<<"Test reorder - oldToNew:" << nl + << flatOutput(oldToNew) << nl << nl; + + PackedBoolList bitset + ( + ListOps::createWithValue + ( + 25, + labelList({8, 12, 15, 22, 4}), + true + ) + ); + + Info<<"bitset input: " << flatOutput(bitset) << nl; + inplaceReorder(oldToNew, bitset); + Info<<" reorder: " << flatOutput(bitset) << nl << nl; + + PackedList<2> packed + ( + ListOps::createWithValue