MCPcopy Index your code
hub / github.com/apache/orc / TEST

Function TEST

tools/test/TestFileContents.cc:27–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25#include "wrap/gtest-wrapper.h"
26
27TEST(TestFileContents, testRaw) {
28 const std::string pgm = findProgram("tools/src/orc-contents");
29 const std::string file = findExample("TestOrcFile.test1.orc");
30 const std::string expected =
31 "{\"boolean1\": false, \"byte1\": 1, \"short1\": 1024, \"int1\": 65536, "
32 "\"long1\": 9223372036854775807, \"float1\": 1, \"double1\": -15,"
33 " \"bytes1\": [0, 1, 2, 3, 4], \"string1\": \"hi\", \"middle\": "
34 "{\"list\": [{\"int1\": 1, \"string1\": \"bye\"}, {\"int1\": 2, "
35 "\"string1\": \"sigh\"}]}, \"list\": [{\"int1\": 3, \"string1\": "
36 "\"good\"}, {\"int1\": 4, \"string1\": \"bad\"}], \"map\": []}\n"
37 "{\"boolean1\": true, \"byte1\": 100, \"short1\": 2048, \"int1\": 65536,"
38 " \"long1\": 9223372036854775807, \"float1\": 2, \"double1\": -5, "
39 "\"bytes1\": [], \"string1\": \"bye\", \"middle\": {\"list\": "
40 "[{\"int1\": 1, \"string1\": \"bye\"}, {\"int1\": 2, \"string1\":"
41 " \"sigh\"}]}, \"list\": [{\"int1\": 100000000, \"string1\": \"cat\"},"
42 " {\"int1\": -100000, \"string1\": \"in\"}, {\"int1\": 1234, "
43 "\"string1\": \"hat\"}], \"map\": [{\"key\": \"chani\", \"value\": "
44 "{\"int1\": 5, \"string1\": \"chani\"}}, {\"key\": \"mauddib\", "
45 "\"value\": {\"int1\": 1, \"string1\": \"mauddib\"}}]}\n";
46
47 std::string output;
48 std::string error;
49
50 EXPECT_EQ(0, runProgram({pgm, file}, output, error));
51 EXPECT_EQ(expected, output);
52 EXPECT_EQ("", error);
53}
54
55TEST(TestFileContents, testSelectedColumns) {
56 const std::string pgm = findProgram("tools/src/orc-contents");

Callers

nothing calls this directly

Calls 3

findProgramFunction · 0.85
findExampleFunction · 0.85
runProgramFunction · 0.85

Tested by

no test coverage detected