MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / CheckFormOfHighLevelVersion

Function CheckFormOfHighLevelVersion

test/software_version_test.cpp:29–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27using ::testing::StartsWith;
28
29void CheckFormOfHighLevelVersion(const std::string& version) {
30 std::istringstream s(version);
31 char v = 'x';
32 int year = -1;
33 char period = 'x';
34 int index = -1;
35 s >> v >> year >> period >> index;
36 EXPECT_THAT(v, Eq('v'));
37 EXPECT_THAT(year, Ge(2016));
38 EXPECT_THAT(period, Eq('.'));
39 EXPECT_THAT(index, Ge(0));
40 EXPECT_TRUE(s.good() || s.eof());
41
42 std::string rest;
43 s >> rest;
44 EXPECT_THAT(rest, AnyOf("", "-dev"));
45}
46
47TEST(SoftwareVersion, ShortIsCorrectForm) {
48 SCOPED_TRACE("short form");

Callers 1

TESTFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected