mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
Minor fixes for bitwriter unit test.
This commit is contained in:
committed by
Erik de Castro Lopo
parent
096a63d36a
commit
f01a3aa77a
@@ -1,6 +1,6 @@
|
||||
/* test_libFLAC - Unit tester for libFLAC
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2018 Xiph.Org Foundation
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -112,9 +112,8 @@ FLAC__bool test_bitwriter(void)
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing init... ");
|
||||
FLAC__bitwriter_init(bw);
|
||||
if(0 == bw) {
|
||||
printf("FAILED, returned NULL\n");
|
||||
if(!FLAC__bitwriter_init(bw)) {
|
||||
printf("FAILED, returned false\n");
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
@@ -135,19 +134,14 @@ FLAC__bool test_bitwriter(void)
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing init... ");
|
||||
FLAC__bitwriter_init(bw);
|
||||
if(0 == bw) {
|
||||
printf("FAILED, returned NULL\n");
|
||||
if(!FLAC__bitwriter_init(bw)) {
|
||||
printf("FAILED, returned false\n");
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing clear... ");
|
||||
FLAC__bitwriter_clear(bw);
|
||||
if(0 == bw) {
|
||||
printf("FAILED, returned NULL\n");
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing delete... ");
|
||||
@@ -166,10 +160,11 @@ FLAC__bool test_bitwriter(void)
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing init... ");
|
||||
ok = FLAC__bitwriter_init(bw);
|
||||
printf("%s\n", ok?"OK":"FAILED");
|
||||
if(!ok)
|
||||
if(!FLAC__bitwriter_init(bw)) {
|
||||
printf("FAILED, returned false\n");
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing clear... ");
|
||||
FLAC__bitwriter_clear(bw);
|
||||
@@ -204,7 +199,7 @@ FLAC__bool test_bitwriter(void)
|
||||
bits = 152 - words*FLAC__BITS_PER_WORD;
|
||||
|
||||
if(bw->words != words) {
|
||||
printf("FAILED byte count %u != %u\n", bw->words, words);
|
||||
printf("FAILED word count %u != %u\n", bw->words, words);
|
||||
FLAC__bitwriter_dump(bw, stdout);
|
||||
return false;
|
||||
}
|
||||
@@ -237,7 +232,7 @@ FLAC__bool test_bitwriter(void)
|
||||
test_pattern1[words] <<= 6;
|
||||
test_pattern1[words] |= 0x3d;
|
||||
if(bw->words != words) {
|
||||
printf("FAILED byte count %u != %u\n", bw->words, words);
|
||||
printf("FAILED word count %u != %u\n", bw->words, words);
|
||||
FLAC__bitwriter_dump(bw, stdout);
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user