MCPcopy Create free account
hub / github.com/Kitware/VTK / TestPrintArrayValues

Function TestPrintArrayValues

Common/Core/Testing/Cxx/TestPrintArrayValues.cxx:11–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9#include <iostream>
10
11int TestPrintArrayValues(int, char*[])
12{
13 {
14 vtkNew<vtkTypeUInt32Array> uint32Array;
15 for (int i = 0; i < 10; ++i)
16 {
17 uint32Array->InsertNextValue(i);
18 }
19 std::ostringstream oss;
20 uint32Array->PrintValues(oss);
21 if (oss.str() != "0 1 2 3 4 5 6 7 8 9 ")
22 {
23 std::cerr << oss.str() << " != 0 1 2 3 4 5 6 7 8 9\n";
24 return EXIT_FAILURE;
25 }
26 }
27 {
28 vtkNew<vtkStringArray> stringArray;
29 stringArray->InsertNextValue("VTK");
30 stringArray->InsertNextValue("vtk");
31 std::ostringstream oss;
32 stringArray->PrintValues(oss);
33 if (oss.str() != "VTK vtk ")
34 {
35 std::cerr << oss.str() << " != VTK vtk\n";
36 return EXIT_FAILURE;
37 }
38 }
39 return EXIT_SUCCESS;
40}

Callers

nothing calls this directly

Calls 3

PrintValuesMethod · 0.80
InsertNextValueMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected