Lines Matching refs:s

19 int test_start_file(STANZA *s, const char *testfile)  in test_start_file()  argument
23 memset(s, 0, sizeof(*s)); in test_start_file()
24 if (!TEST_ptr(s->fp = BIO_new_file(testfile, "r"))) in test_start_file()
26 s->test_file = testfile; in test_start_file()
30 int test_end_file(STANZA *s) in test_end_file() argument
33 s->numtests, s->errors, s->numskip); in test_end_file()
34 BIO_free(s->fp); in test_end_file()
41 static int read_key(STANZA *s) in read_key() argument
45 if (s->key == NULL) { in read_key()
46 if (!TEST_ptr(s->key = BIO_new(BIO_s_mem()))) in read_key()
48 } else if (!TEST_int_gt(BIO_reset(s->key), 0)) { in read_key()
53 while (BIO_gets(s->fp, tmpbuf, sizeof(tmpbuf))) { in read_key()
54 s->curr++; in read_key()
55 if (!TEST_int_gt(BIO_puts(s->key, tmpbuf), 0)) in read_key()
86 int test_readstanza(STANZA *s) in test_readstanza() argument
88 PAIR *pp = s->pairs; in test_readstanza()
92 for (s->numpairs = 0; BIO_gets(s->fp, s->buff, sizeof(s->buff)); ) { in test_readstanza()
93 s->curr++; in test_readstanza()
94 if (!TEST_ptr(p = strchr(s->buff, '\n'))) { in test_readstanza()
95 TEST_info("Line %d too long", s->curr); in test_readstanza()
101 if (s->buff[0] == '\0') in test_readstanza()
105 if (s->buff[0] == '#') in test_readstanza()
109 if (!TEST_ptr(equals = strchr(s->buff, '='))) { in test_readstanza()
110 TEST_info("Missing = at line %d\n", s->curr); in test_readstanza()
114 if (!TEST_ptr(key = strip_spaces(s->buff))) { in test_readstanza()
115 TEST_info("Empty field at line %d\n", s->curr); in test_readstanza()
122 TEST_info("Starting \"%s\" tests at line %d", value, s->curr); in test_readstanza()
126 if (s->numpairs == 0) in test_readstanza()
127 s->start = s->curr; in test_readstanza()
130 if (!read_key(s)) in test_readstanza()
134 if (!read_key(s)) in test_readstanza()
138 if (!TEST_int_lt(s->numpairs++, TESTMAXPAIRS) in test_readstanza()
149 void test_clearstanza(STANZA *s) in test_clearstanza() argument
151 PAIR *pp = s->pairs; in test_clearstanza()
152 int i = s->numpairs; in test_clearstanza()
158 s->numpairs = 0; in test_clearstanza()