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

Function TEST

test/unit/FileSpecTest.cpp:10–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8using namespace pdal;
9
10TEST(FileSpecTest, create)
11{
12 // create from string
13 std::string inFile = "foo.laz";
14 FileSpec spec;
15 Utils::StatusWithReason status = spec.ingest(inFile);
16 EXPECT_EQ(status, true);
17 EXPECT_EQ(spec.u8string(), inFile);
18
19 // create from json
20 NL::json json{};
21 json["path"] = inFile;
22 json["headers"] = {{"some_header_key","some_header_val"}};
23 json["query"] = {{"some_query_key","some_query_val"}};
24
25 StringMap headersMap = json.at("headers").get<StringMap>();
26 StringMap queryMap = json.at("query").get<StringMap>();
27
28 spec = FileSpec(json.dump());
29 EXPECT_EQ(status, true);
30 EXPECT_EQ(spec.u8string(), inFile);
31 EXPECT_EQ(spec.headers(), headersMap);
32 EXPECT_EQ(spec.query(), queryMap);
33}
34
35TEST(FileSpecTest, parse_errors)
36{

Callers

nothing calls this directly

Calls 10

FileSpecClass · 0.85
ingestMethod · 0.80
u8stringMethod · 0.80
atMethod · 0.80
headersMethod · 0.80
queryMethod · 0.80
parseFunction · 0.50
dumpMethod · 0.45
whatMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected