Skip to content

Commit 7ca124f

Browse files
committed
tds: Save collations test output to file
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
1 parent c1129da commit 7ca124f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/tds/unittests/collations.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,11 @@ static void
163163
test_column_encoding(void)
164164
{
165165
FILE *f = fopen("collations.txt", "r");
166+
FILE *out = fopen("collations2.txt", "w");
166167
char line[1024];
167168

168169
assert(f);
170+
assert(out);
169171
while (fgets(line, sizeof(line), f)) {
170172
TDS71_COLLATION coll;
171173
char cp[128], digest[33];
@@ -180,8 +182,10 @@ test_column_encoding(void)
180182

181183
get_encoding_coll(&coll, digest, cp, s);
182184
printf("%s %04x %04x %d %s %s\n", s, coll.locale_id, coll.flags, coll.charset_id, cp, digest);
185+
fprintf(out, "%s %04x %04x %d %s %s\n", s, coll.locale_id, coll.flags, coll.charset_id, cp, digest);
183186
}
184187
fclose(f);
188+
fclose(out);
185189
}
186190

187191
static void

0 commit comments

Comments
 (0)