Skip to content

Commit

Permalink
update pcinfo tests now that --output is no longer supported -- use >…
Browse files Browse the repository at this point in the history
… for just dumping to stdout as you need
  • Loading branch information
hobu committed Jul 12, 2012
1 parent 44e2179 commit 3ac5974
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 4 deletions.
46 changes: 46 additions & 0 deletions test/data/apps/pcinfo_stats.txt
Expand Up @@ -609,6 +609,29 @@
}
},
"sample": "1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 3 1 3 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 2 1 1 1 1 1 1 1 1 2 2 2 2 1 1 2 1 1 1 1 1 1 1 1 1 1 2 2 4 1 1 1 1 2 1 1 1 1 3 1 1 2 1 1 1 1 1 1 1 2 2 1 1 1 1 1 1 1 1 2 2 2 1 1 1 1 2 1 1 1 1 1 2 1 3 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 2 1 2 1 2 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 4 1 1 1 1 1 1 2 3 1 1 1 1 1 2 1 1 1 1 1 1 2 1 1 1 1 1 1 2 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 1 1 1 1 1 2 1 1 1 3 2 1 1 1 1 2 1 1 2 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 3 2 1 1 1 1 2 1 1 1 1 2 1 1 1 1 1 1 1 2 2 2 1 2 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 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1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 ",
"counts":
{
"count-1":
{
"value": "1",
"count": "925"
},
"count-2":
{
"value": "2",
"count": "114"
},
"count-3":
{
"value": "3",
"count": "21"
},
"count-4":
{
"value": "4",
"count": "5"
}
},
"position": "4"
},
"NumberOfReturns":
Expand Down Expand Up @@ -731,6 +754,29 @@
}
},
"sample": "1 2 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 2 1 1 3 1 2 1 1 1 3 1 1 1 1 2 1 1 1 1 1 1 1 2 1 1 3 1 1 1 3 1 3 1 2 1 1 1 1 1 1 2 1 1 1 2 2 1 1 1 1 1 2 2 2 2 1 1 1 1 1 2 1 1 2 2 3 3 2 1 3 2 1 1 1 2 3 1 1 1 2 3 2 4 1 1 1 1 2 1 2 1 1 3 1 1 2 2 1 1 3 1 1 1 2 2 1 1 1 1 1 1 1 1 2 2 3 1 1 1 1 2 1 1 1 1 1 2 1 3 1 2 1 1 1 1 1 1 1 1 1 3 1 1 1 1 2 2 3 2 1 3 1 2 1 1 1 2 1 3 2 2 2 1 1 1 3 1 1 1 1 1 1 1 2 2 2 1 1 3 1 1 1 1 1 1 2 2 1 1 4 4 1 2 2 3 1 3 2 3 1 3 1 1 3 2 1 1 1 1 2 1 3 1 1 1 1 1 1 2 2 1 1 2 1 2 2 1 1 2 2 2 1 1 1 2 1 1 1 2 2 1 1 2 1 1 2 1 2 1 3 3 1 1 3 1 2 1 1 2 1 1 1 1 1 2 2 2 1 1 1 2 2 2 1 1 2 3 2 1 1 2 3 2 1 1 1 3 2 2 1 1 2 2 1 1 2 3 2 1 2 2 1 1 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 2 2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 1 1 2 3 3 2 2 1 1 2 2 1 2 1 1 2 2 2 2 1 1 2 1 2 1 1 1 1 2 2 1 1 3 1 2 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 2 1 3 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 4 1 2 2 1 1 1 3 2 2 2 1 1 1 1 1 1 1 2 1 1 1 1 ",
"counts":
{
"count-1":
{
"value": "1",
"count": "789"
},
"count-2":
{
"value": "2",
"count": "195"
},
"count-3":
{
"value": "3",
"count": "71"
},
"count-4":
{
"value": "4",
"count": "10"
}
},
"position": "5"
},
"ScanDirectionFlag":
Expand Down
14 changes: 10 additions & 4 deletions test/unit/apps/pcinfoTest.cpp
Expand Up @@ -148,19 +148,21 @@ BOOST_AUTO_TEST_CASE(pcinfo_test_dumps)
// dump a single point to json

std::string pt_test = Support::temppath("pcinfo_point.txt");
command << cmd + " --output=" + pt_test + " --point=1 " + inputLas;
command << cmd + " --point=1 " + inputLas + " > " + pt_test;
stat = Support::run_command(command.str(), output);
BOOST_CHECK_EQUAL(stat, 0);
were_equal = Support::compare_text_files(pt_test, Support::datapath("apps/pcinfo_point.txt"));
BOOST_CHECK(were_equal);
if (were_equal)
pdal::FileUtils::deleteFile(pt_test);
else
std::cout << command.str() << std::endl;

// dump summary of all points to json
command.str("");

std::string stats_test = Support::temppath("pcinfo_stats.txt");
command << cmd + " --output=" + stats_test + " --stats " + inputLas + " --seed 1234";
command << cmd + " --stats " + inputLas + " --seed 1234" +" > " + stats_test;
stat = Support::run_command(command.str(), output);
BOOST_CHECK_EQUAL(stat, 0);
#if defined(PDAL_PLATFORM_WIN32) // && (PDAL_BUILD_TYPE=="Debug")
Expand All @@ -178,19 +180,21 @@ BOOST_AUTO_TEST_CASE(pcinfo_test_dumps)
command.str("");

std::string schema_test = Support::temppath("pcinfo_schema.txt");
command << cmd + " --output=" + schema_test + " --schema " + inputLas;
command << cmd + " --schema " + inputLas +" > " + schema_test;
stat = Support::run_command(command.str(), output);
BOOST_CHECK_EQUAL(stat, 0);
were_equal = Support::compare_text_files(schema_test, Support::datapath("apps/pcinfo_schema.txt"));
BOOST_CHECK(were_equal);
if (were_equal)
pdal::FileUtils::deleteFile(schema_test);
else
std::cout << command.str() << std::endl;

// dump stage info to json
command.str("");

std::string stage_test = Support::temppath("pcinfo_stage.txt");
command << cmd + " --output=" + stage_test + " --stage " + inputLas;
command << cmd + " --stage " + inputLas +" > " + stage_test;
stat = Support::run_command(command.str(), output);
BOOST_CHECK_EQUAL(stat, 0);

Expand All @@ -203,6 +207,8 @@ BOOST_AUTO_TEST_CASE(pcinfo_test_dumps)
#endif
if (check == 0u)
pdal::FileUtils::deleteFile(stage_test);
else
std::cout << command.str() << std::endl;

return;
}
Expand Down

0 comments on commit 3ac5974

Please sign in to comment.