mirror of https://gerrit.osmocom.org/asn1c
undo skeletons hierarchy detection
This commit is contained in:
parent
7623d8c33e
commit
55982b820a
|
@ -21,7 +21,7 @@
|
||||||
#define TOP_SRCDIR_S STRINGIFY_MACRO(TOP_SRCDIR)
|
#define TOP_SRCDIR_S STRINGIFY_MACRO(TOP_SRCDIR)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int check(int skeletons_hier_level, const char *fname,
|
static int check(const char *fname,
|
||||||
enum asn1p_flags parser_flags,
|
enum asn1p_flags parser_flags,
|
||||||
enum asn1f_flags fixer_flags);
|
enum asn1f_flags fixer_flags);
|
||||||
static int post_fix_check(asn1p_t *asn);
|
static int post_fix_check(asn1p_t *asn);
|
||||||
|
@ -41,7 +41,6 @@ main(int ac, char **av) {
|
||||||
enum asn1p_flags parser_flags = A1P_NOFLAGS;
|
enum asn1p_flags parser_flags = A1P_NOFLAGS;
|
||||||
enum asn1f_flags fixer_flags = A1F_NOFLAGS;
|
enum asn1f_flags fixer_flags = A1F_NOFLAGS;
|
||||||
const char *filename;
|
const char *filename;
|
||||||
int skeletons_hier_level = 1;
|
|
||||||
size_t len;
|
size_t len;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -68,9 +67,6 @@ main(int ac, char **av) {
|
||||||
fprintf(stderr, "%s: %s\n", asn1_tests_dir, strerror(errno));
|
fprintf(stderr, "%s: %s\n", asn1_tests_dir, strerror(errno));
|
||||||
assert(ret == 0);
|
assert(ret == 0);
|
||||||
/* For some reasons, tests could be hidden under extra tests dir. */
|
/* For some reasons, tests could be hidden under extra tests dir. */
|
||||||
if(0 && chdir("tests") == 0) {
|
|
||||||
skeletons_hier_level++;
|
|
||||||
}
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
dir = _findfirst("*.asn1", &c_file);
|
dir = _findfirst("*.asn1", &c_file);
|
||||||
assert(dir != -1L);
|
assert(dir != -1L);
|
||||||
|
@ -96,7 +92,7 @@ main(int ac, char **av) {
|
||||||
len = strlen(filename);
|
len = strlen(filename);
|
||||||
if(len <= 5 || strcmp(filename + len - 5, ".asn1"))
|
if(len <= 5 || strcmp(filename + len - 5, ".asn1"))
|
||||||
continue;
|
continue;
|
||||||
ret = check(skeletons_hier_level, filename, parser_flags, fixer_flags);
|
ret = check(filename, parser_flags, fixer_flags);
|
||||||
if(ret) {
|
if(ret) {
|
||||||
fprintf(stderr, "FAILED: %s\n",
|
fprintf(stderr, "FAILED: %s\n",
|
||||||
filename);
|
filename);
|
||||||
|
@ -121,7 +117,7 @@ main(int ac, char **av) {
|
||||||
} else {
|
} else {
|
||||||
int i;
|
int i;
|
||||||
for(i = 1; i < ac; i++) {
|
for(i = 1; i < ac; i++) {
|
||||||
ret = check(skeletons_hier_level, av[i], parser_flags, fixer_flags);
|
ret = check(av[i], parser_flags, fixer_flags);
|
||||||
if(ret) {
|
if(ret) {
|
||||||
fprintf(stderr, "FAILED: %s\n", av[i]);
|
fprintf(stderr, "FAILED: %s\n", av[i]);
|
||||||
failed++;
|
failed++;
|
||||||
|
@ -141,7 +137,7 @@ main(int ac, char **av) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
check(int skeletons_hier_level, const char *fname,
|
check(const char *fname,
|
||||||
enum asn1p_flags parser_flags,
|
enum asn1p_flags parser_flags,
|
||||||
enum asn1f_flags fixer_flags) {
|
enum asn1f_flags fixer_flags) {
|
||||||
asn1p_t *asn;
|
asn1p_t *asn;
|
||||||
|
@ -200,10 +196,7 @@ check(int skeletons_hier_level, const char *fname,
|
||||||
|
|
||||||
if(r_value == 0) {
|
if(r_value == 0) {
|
||||||
asn1p_t *std_asn;
|
asn1p_t *std_asn;
|
||||||
std_asn = asn1p_parse_file(skeletons_hier_level == 1
|
std_asn = asn1p_parse_file("../skeletons/standard-modules/ASN1C-UsefulInformationObjectClasses.asn1", A1P_NOFLAGS);
|
||||||
? "../skeletons/standard-modules/ASN1C-UsefulInformationObjectClasses.asn1"
|
|
||||||
: "../../skeletons/standard-modules/ASN1C-UsefulInformationObjectClasses.asn1"
|
|
||||||
, A1P_NOFLAGS);
|
|
||||||
if(std_asn) {
|
if(std_asn) {
|
||||||
asn1p_module_t *mod;
|
asn1p_module_t *mod;
|
||||||
while((mod = TQ_REMOVE(&(std_asn->modules), mod_next))) {
|
while((mod = TQ_REMOVE(&(std_asn->modules), mod_next))) {
|
||||||
|
|
Loading…
Reference in New Issue