| 37 | }; |
| 38 | |
| 39 | void Process2(vtkMultiProcessController* contr, void* vtkNotUsed(arg)) |
| 40 | { |
| 41 | vtkCommunicator* comm = contr->GetCommunicator(); |
| 42 | |
| 43 | int i, retVal = 1; |
| 44 | |
| 45 | // Test receiving all supported types of arrays |
| 46 | vtkIntArray* ia = vtkIntArray::New(); |
| 47 | if (!comm->Receive(ia, 0, 11)) |
| 48 | { |
| 49 | std::cerr << "Server error: Error receiving data." << std::endl; |
| 50 | retVal = 0; |
| 51 | } |
| 52 | for (i = 0; i < ia->GetNumberOfTuples(); i++) |
| 53 | { |
| 54 | if (ia->GetValue(i) != i) |
| 55 | { |
| 56 | std::cerr << "Server error: Corrupt integer array." << std::endl; |
| 57 | retVal = 0; |
| 58 | break; |
| 59 | } |
| 60 | } |
| 61 | ia->Delete(); |
| 62 | |
| 63 | vtkUnsignedLongArray* ula = vtkUnsignedLongArray::New(); |
| 64 | if (!comm->Receive(ula, 0, 22)) |
| 65 | { |
| 66 | std::cerr << "Server error: Error receiving data." << std::endl; |
| 67 | retVal = 0; |
| 68 | } |
| 69 | for (i = 0; i < ula->GetNumberOfTuples(); i++) |
| 70 | { |
| 71 | if (ula->GetValue(i) != static_cast<unsigned long>(i)) |
| 72 | { |
| 73 | std::cerr << "Server error: Corrupt unsigned long array." << std::endl; |
| 74 | retVal = 0; |
| 75 | break; |
| 76 | } |
| 77 | } |
| 78 | ula->Delete(); |
| 79 | |
| 80 | vtkCharArray* ca = vtkCharArray::New(); |
| 81 | if (!comm->Receive(ca, 0, 33)) |
| 82 | { |
| 83 | std::cerr << "Server error: Error receiving data." << std::endl; |
| 84 | retVal = 0; |
| 85 | } |
| 86 | for (i = 0; i < ca->GetNumberOfTuples(); i++) |
| 87 | { |
| 88 | if (ca->GetValue(i) != static_cast<char>(i)) |
| 89 | { |
| 90 | std::cerr << "Server error: Corrupt char array." << std::endl; |
| 91 | retVal = 0; |
| 92 | break; |
| 93 | } |
| 94 | } |
| 95 | ca->Delete(); |
| 96 |
nothing calls this directly
no test coverage detected