leptris 1.9.352.0-arm-linux → 1.9.353.0-arm-linux
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/Rakefile +1 -1
- data/lib/leptris/version.rb +1 -1
- data/lib/leptris/xml/element.rb +56 -0
- data/lib/leptris/xml/ffi.rb +9 -0
- data/lib/libleptris.so +0 -0
- data/vendor-src/README.md +1 -1
- data/vendor-src/libleptris/CHANGELOG.md +45 -0
- data/vendor-src/libleptris/CMakeLists.txt +1 -1
- data/vendor-src/libleptris/scripts/gen_xsd_manifest.py +88 -0
- data/vendor-src/libleptris/src/include/leptris.h +44 -0
- data/vendor-src/libleptris/src/leptris/dom/element_query.c +100 -0
- data/vendor-src/libleptris/src/leptris/xsd/compile.c +147 -56
- data/vendor-src/libleptris/test/dom/test_dom.cpp +140 -0
- data/vendor-src/libleptris/test/xsd/libxml2-cases/MANIFEST.tsv +1058 -0
- data/vendor-src/libleptris/test/xsd/test_xsd_compile.cpp +91 -4
- data/vendor-src/libleptris/vcpkg.json +1 -1
- metadata +3 -1
|
@@ -142,12 +142,16 @@ TEST(Libxml2Corpus, EveryFixtureCompilesOrFailsCleanly) {
|
|
|
142
142
|
leptris_xsd_free(s);
|
|
143
143
|
}
|
|
144
144
|
EXPECT_GE(ok + failed, 160u) << "fixture set shrank";
|
|
145
|
-
//
|
|
146
|
-
//
|
|
147
|
-
//
|
|
145
|
+
// Compile floor: was 163/163 when compile was unconditional —
|
|
146
|
+
// the structure check (#1691) now legitimately rejects the
|
|
147
|
+
// schema-error fixtures (bad required attrs, occurrence
|
|
148
|
+
// ordering), so the floor is 159. The differential expectations
|
|
149
|
+
// live in XsdConformance (MANIFEST.tsv); this floor still
|
|
150
|
+
// catches crashes/shrinking sets. Monotonic per structure-check
|
|
151
|
+
// coverage.
|
|
148
152
|
RecordProperty("ok", std::to_string(ok));
|
|
149
153
|
RecordProperty("failed", std::to_string(failed));
|
|
150
|
-
EXPECT_GE(ok,
|
|
154
|
+
EXPECT_GE(ok, 159u) << "compile-success floor regressed";
|
|
151
155
|
}
|
|
152
156
|
|
|
153
157
|
} // namespace
|
|
@@ -1935,3 +1939,86 @@ TEST(XsdErrorContext, ContentModelErrorCarriesPosition) {
|
|
|
1935
1939
|
}
|
|
1936
1940
|
|
|
1937
1941
|
} // namespace
|
|
1942
|
+
|
|
1943
|
+
/* ---- #1075: the differential conformance lane ---------------------
|
|
1944
|
+
*
|
|
1945
|
+
* MANIFEST.tsv is generated by scripts/gen_xsd_manifest.py: the
|
|
1946
|
+
* system libxml2 oracle (the Nokogiri-parity target, 2.9.13 at
|
|
1947
|
+
* generation) verdicts every (schema, instance) pair in the corpus —
|
|
1948
|
+
* valid / invalid / schema-error. The engine must converge on the
|
|
1949
|
+
* oracle. The pass floor is pinned from the first measured run and
|
|
1950
|
+
* is monotonic: raising it is progress, lowering it is a regression.
|
|
1951
|
+
*/
|
|
1952
|
+
TEST(XsdConformance, ManifestExpectationsMatchOracle) {
|
|
1953
|
+
const std::string manifest_path =
|
|
1954
|
+
std::string(LEPTRIS_XSD_CASES_DIR) + "/MANIFEST.tsv";
|
|
1955
|
+
FILE* f = fopen(manifest_path.c_str(), "rb");
|
|
1956
|
+
ASSERT_NE(f, nullptr) << "manifest missing";
|
|
1957
|
+
char line[512];
|
|
1958
|
+
int pass = 0, fail = 0, total = 0;
|
|
1959
|
+
int pass_valid = 0, pass_invalid = 0, pass_schema_error = 0;
|
|
1960
|
+
while (fgets(line, sizeof(line), f)) {
|
|
1961
|
+
if (line[0] == '#' || line[0] == '\n') continue;
|
|
1962
|
+
char inst[256], schema[256], expect[32];
|
|
1963
|
+
if (std::sscanf(line, "%255[^\t]\t%255[^\t]\t%31s", inst, schema,
|
|
1964
|
+
expect) != 3)
|
|
1965
|
+
continue;
|
|
1966
|
+
total++;
|
|
1967
|
+
std::string ipath =
|
|
1968
|
+
std::string(LEPTRIS_XSD_CASES_DIR) + "/" + inst;
|
|
1969
|
+
std::string spath =
|
|
1970
|
+
std::string(LEPTRIS_XSD_CASES_DIR) + "/" + schema;
|
|
1971
|
+
|
|
1972
|
+
LeptrisStatus st = (LeptrisStatus)0;
|
|
1973
|
+
LeptrisXsdSchema s = leptris_xsd_compile_file(spath.c_str(), &st);
|
|
1974
|
+
bool ok;
|
|
1975
|
+
if (std::strcmp(expect, "schema-error") == 0) {
|
|
1976
|
+
/* the oracle cannot even load the schema: the engine must
|
|
1977
|
+
* reject it too (a clean parse-or-schema error, no crash) */
|
|
1978
|
+
ok = (s == (LeptrisXsdSchema)0) || st != LEPTRIS_OK;
|
|
1979
|
+
if (s != (LeptrisXsdSchema)0) leptris_xsd_free(s);
|
|
1980
|
+
} else if (s == (LeptrisXsdSchema)0) {
|
|
1981
|
+
ok = false; /* the oracle compiled it; we must too */
|
|
1982
|
+
} else {
|
|
1983
|
+
LeptrisDocument d =
|
|
1984
|
+
leptris_parse_file(ipath.c_str(), &st);
|
|
1985
|
+
if (!d) {
|
|
1986
|
+
ok = false;
|
|
1987
|
+
} else {
|
|
1988
|
+
int v = leptris_xsd_validate(s, d);
|
|
1989
|
+
ok = (std::strcmp(expect, "valid") == 0) ? (v == 1)
|
|
1990
|
+
: (v != 1);
|
|
1991
|
+
leptris_document_free(d);
|
|
1992
|
+
}
|
|
1993
|
+
leptris_xsd_free(s);
|
|
1994
|
+
}
|
|
1995
|
+
if (ok) {
|
|
1996
|
+
pass++;
|
|
1997
|
+
if (std::strcmp(expect, "valid") == 0) pass_valid++;
|
|
1998
|
+
else if (std::strcmp(expect, "invalid") == 0) pass_invalid++;
|
|
1999
|
+
else pass_schema_error++;
|
|
2000
|
+
} else {
|
|
2001
|
+
fail++;
|
|
2002
|
+
}
|
|
2003
|
+
}
|
|
2004
|
+
fclose(f);
|
|
2005
|
+
EXPECT_EQ(total, 1056) << "corpus shrank — regenerate the manifest";
|
|
2006
|
+
RecordProperty("pass", std::to_string(pass));
|
|
2007
|
+
RecordProperty("fail", std::to_string(fail));
|
|
2008
|
+
printf("XSD-CONF-BASELINE pass=%d fail=%d (valid=%d invalid=%d schema_error=%d)\n",
|
|
2009
|
+
pass, fail, pass_valid, pass_invalid, pass_schema_error);
|
|
2010
|
+
/* The floor: pinned at the first measured run (2026-10-14,
|
|
2011
|
+
* oracle libxml 2.9.13): 769/1056 — 36 false rejections of
|
|
2012
|
+
* valid documents, 45 false acceptances of invalid ones, and
|
|
2013
|
+
* all 206 schema-error fixtures compiling clean (the engine's
|
|
2014
|
+
* schema-constraint gate is laxer than the oracle's; see the
|
|
2015
|
+
* divergence tracker). Monotonically rising — each fix here
|
|
2016
|
+
* retires oracle divergences wholesale. */
|
|
2017
|
+
EXPECT_GE(pass, 795) << "conformance floor regressed";
|
|
2018
|
+
EXPECT_GE(pass_valid, 151);
|
|
2019
|
+
EXPECT_GE(pass_invalid, 618);
|
|
2020
|
+
EXPECT_GE(pass_schema_error, 26);
|
|
2021
|
+
RecordProperty("pass_valid", std::to_string(pass_valid));
|
|
2022
|
+
RecordProperty("pass_invalid", std::to_string(pass_invalid));
|
|
2023
|
+
RecordProperty("pass_schema_error", std::to_string(pass_schema_error));
|
|
2024
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
|
|
3
3
|
"name": "leptris",
|
|
4
|
-
"version": "1.9.
|
|
4
|
+
"version": "1.9.353",
|
|
5
5
|
"description": "High-performance XML parser and XPath 1.0 engine in C (libleptris)",
|
|
6
6
|
"homepage": "https://github.com/leptris/leptris",
|
|
7
7
|
"license": "MIT",
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: leptris
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.9.
|
|
4
|
+
version: 1.9.353.0
|
|
5
5
|
platform: arm-linux
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
@@ -547,6 +547,7 @@ files:
|
|
|
547
547
|
- vendor-src/libleptris/scripts/check_shared_exports.sh
|
|
548
548
|
- vendor-src/libleptris/scripts/check_trailing_whitespace.sh
|
|
549
549
|
- vendor-src/libleptris/scripts/gen-api-docs.sh
|
|
550
|
+
- vendor-src/libleptris/scripts/gen_xsd_manifest.py
|
|
550
551
|
- vendor-src/libleptris/scripts/run_static_analysis.sh
|
|
551
552
|
- vendor-src/libleptris/scripts/validate.sh
|
|
552
553
|
- vendor-src/libleptris/scripts/xslt_triage.sh
|
|
@@ -1127,6 +1128,7 @@ files:
|
|
|
1127
1128
|
- vendor-src/libleptris/test/xsd/libxml2-cases/582906-2-prog2.xsd
|
|
1128
1129
|
- vendor-src/libleptris/test/xsd/libxml2-cases/582906-2_0.xml
|
|
1129
1130
|
- vendor-src/libleptris/test/xsd/libxml2-cases/582906-2_0.xsd
|
|
1131
|
+
- vendor-src/libleptris/test/xsd/libxml2-cases/MANIFEST.tsv
|
|
1130
1132
|
- vendor-src/libleptris/test/xsd/libxml2-cases/all.xsd
|
|
1131
1133
|
- vendor-src/libleptris/test/xsd/libxml2-cases/all1_0.xml
|
|
1132
1134
|
- vendor-src/libleptris/test/xsd/libxml2-cases/all1_0.xsd
|