mirror of
https://github.com/august-alt/gpui.git
synced 2025-03-14 12:58:39 +03:00
chore: add PRegParser
header test (endianness)
This commit is contained in:
parent
a63b57c998
commit
c5c9487589
@ -132,6 +132,21 @@ void PolTest::autogenerateCases(size_t seed)
|
||||
auto test = parser->parse(file);
|
||||
QCOMPARE(policyFile, test);
|
||||
}
|
||||
|
||||
void PolTest::testPRegHeader()
|
||||
{
|
||||
std::stringstream stream;
|
||||
pol::PolicyFile file;
|
||||
auto parser = pol::createPregParser();
|
||||
|
||||
parser->write(stream, file);
|
||||
|
||||
std::vector<uint8_t> result(8), expected = { 0x50, 0x52, 0x65, 0x67, 0x01, 0x00, 0x00, 0x00};
|
||||
|
||||
stream.read(reinterpret_cast<char*>(result.data()), 8);
|
||||
QCOMPARE(result, expected);
|
||||
}
|
||||
|
||||
} // namespace tests
|
||||
|
||||
QTEST_MAIN(tests::PolTest)
|
||||
|
@ -39,6 +39,8 @@ private slots:
|
||||
|
||||
void testCase(QString filename);
|
||||
void autogenerateCases(size_t seed);
|
||||
|
||||
void testPRegHeader();
|
||||
};
|
||||
} // namespace tests
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user