summaryrefslogtreecommitdiff
path: root/src/test_libFLAC++
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2017-01-15 06:47:51 +1100
committerErik de Castro Lopo <erikd@mega-nerd.com>2017-01-15 09:48:42 +1100
commit71b909b7a48bd112b7c05ae5dead92b3fc6e585a (patch)
treed9be7756c776a37e22292bb485228ba768fed38f /src/test_libFLAC++
parent588689b1385f9291602b88ea82e1c79d38b0080b (diff)
downloadflac-71b909b7a48bd112b7c05ae5dead92b3fc6e585a.tar.gz
Yet more purging of `unsigned` type
Diffstat (limited to 'src/test_libFLAC++')
-rw-r--r--src/test_libFLAC++/decoders.cpp30
-rw-r--r--src/test_libFLAC++/encoders.cpp30
-rw-r--r--src/test_libFLAC++/metadata_manip.cpp66
-rw-r--r--src/test_libFLAC++/metadata_object.cpp26
4 files changed, 76 insertions, 76 deletions
diff --git a/src/test_libFLAC++/decoders.cpp b/src/test_libFLAC++/decoders.cpp
index eca81b57..b1505eeb 100644
--- a/src/test_libFLAC++/decoders.cpp
+++ b/src/test_libFLAC++/decoders.cpp
@@ -57,7 +57,7 @@ static const char * const LayerString[] = {
static ::FLAC__StreamMetadata streaminfo_, padding_, seektable_, application1_, application2_, vorbiscomment_, cuesheet_, picture_, unknown_;
static ::FLAC__StreamMetadata *expected_metadata_sequence_[9];
-static unsigned num_expected_;
+static uint32_t num_expected_;
static FLAC__off_t flacfilesize_;
static const char *flacfilename(bool is_ogg)
@@ -80,7 +80,7 @@ static FLAC__bool die_s_(const char *msg, const FLAC::Decoder::Stream *decoder)
else
printf("FAILED");
- printf(", state = %u (%s)\n", (unsigned)((::FLAC__StreamDecoderState)state), state.as_cstring());
+ printf(", state = %u (%s)\n", (uint32_t)((::FLAC__StreamDecoderState)state), state.as_cstring());
return false;
}
@@ -120,7 +120,7 @@ static bool generate_file_(FLAC__bool is_ogg)
class DecoderCommon {
public:
Layer layer_;
- unsigned current_metadata_number_;
+ uint32_t current_metadata_number_;
bool ignore_errors_;
bool error_occurred_;
@@ -171,7 +171,7 @@ void DecoderCommon::common_metadata_callback_(const ::FLAC__StreamMetadata *meta
void DecoderCommon::common_error_callback_(::FLAC__StreamDecoderErrorStatus status)
{
if(!ignore_errors_) {
- printf("ERROR: got error callback: err = %u (%s)\n", (unsigned)status, ::FLAC__StreamDecoderErrorStatusString[status]);
+ printf("ERROR: got error callback: err = %u (%s)\n", (uint32_t)status, ::FLAC__StreamDecoderErrorStatusString[status]);
error_occurred_ = true;
}
}
@@ -326,7 +326,7 @@ bool StreamDecoder::test_respond(bool is_ogg)
printf("testing process_until_end_of_stream()... ");
if(!process_until_end_of_stream()) {
State state = get_state();
- printf("FAILED, returned false, state = %u (%s)\n", (unsigned)((::FLAC__StreamDecoderState)state), state.as_cstring());
+ printf("FAILED, returned false, state = %u (%s)\n", (uint32_t)((::FLAC__StreamDecoderState)state), state.as_cstring());
return false;
}
printf("OK\n");
@@ -334,7 +334,7 @@ bool StreamDecoder::test_respond(bool is_ogg)
printf("testing finish()... ");
if(!finish()) {
State state = get_state();
- printf("FAILED, returned false, state = %u (%s)\n", (unsigned)((::FLAC__StreamDecoderState)state), state.as_cstring());
+ printf("FAILED, returned false, state = %u (%s)\n", (uint32_t)((::FLAC__StreamDecoderState)state), state.as_cstring());
return false;
}
printf("OK\n");
@@ -412,7 +412,7 @@ bool FileDecoder::test_respond(bool is_ogg)
printf("testing process_until_end_of_stream()... ");
if(!process_until_end_of_stream()) {
State state = get_state();
- printf("FAILED, returned false, state = %u (%s)\n", (unsigned)((::FLAC__StreamDecoderState)state), state.as_cstring());
+ printf("FAILED, returned false, state = %u (%s)\n", (uint32_t)((::FLAC__StreamDecoderState)state), state.as_cstring());
return false;
}
printf("OK\n");
@@ -420,7 +420,7 @@ bool FileDecoder::test_respond(bool is_ogg)
printf("testing finish()... ");
if(!finish()) {
State state = get_state();
- printf("FAILED, returned false, state = %u (%s)\n", (unsigned)((::FLAC__StreamDecoderState)state), state.as_cstring());
+ printf("FAILED, returned false, state = %u (%s)\n", (uint32_t)((::FLAC__StreamDecoderState)state), state.as_cstring());
return false;
}
printf("OK\n");
@@ -594,7 +594,7 @@ static bool test_stream_decoder(Layer layer, bool is_ogg)
printf("testing get_state()... ");
FLAC::Decoder::Stream::State state = decoder->get_state();
- printf("returned state = %u (%s)... OK\n", (unsigned)((::FLAC__StreamDecoderState)state), state.as_cstring());
+ printf("returned state = %u (%s)... OK\n", (uint32_t)((::FLAC__StreamDecoderState)state), state.as_cstring());
dynamic_cast<DecoderCommon*>(decoder)->current_metadata_number_ = 0;
dynamic_cast<DecoderCommon*>(decoder)->ignore_errors_ = false;
@@ -655,7 +655,7 @@ static bool test_stream_decoder(Layer layer, bool is_ogg)
printf("testing get_channels()... ");
{
- unsigned channels = decoder->get_channels();
+ uint32_t channels = decoder->get_channels();
if(channels != streaminfo_.data.stream_info.channels) {
printf("FAILED, returned %u, expected %u\n", channels, streaminfo_.data.stream_info.channels);
return false;
@@ -665,7 +665,7 @@ static bool test_stream_decoder(Layer layer, bool is_ogg)
printf("testing get_bits_per_sample()... ");
{
- unsigned bits_per_sample = decoder->get_bits_per_sample();
+ uint32_t bits_per_sample = decoder->get_bits_per_sample();
if(bits_per_sample != streaminfo_.data.stream_info.bits_per_sample) {
printf("FAILED, returned %u, expected %u\n", bits_per_sample, streaminfo_.data.stream_info.bits_per_sample);
return false;
@@ -675,7 +675,7 @@ static bool test_stream_decoder(Layer layer, bool is_ogg)
printf("testing get_sample_rate()... ");
{
- unsigned sample_rate = decoder->get_sample_rate();
+ uint32_t sample_rate = decoder->get_sample_rate();
if(sample_rate != streaminfo_.data.stream_info.sample_rate) {
printf("FAILED, returned %u, expected %u\n", sample_rate, streaminfo_.data.stream_info.sample_rate);
return false;
@@ -685,7 +685,7 @@ static bool test_stream_decoder(Layer layer, bool is_ogg)
printf("testing get_blocksize()... ");
{
- unsigned blocksize = decoder->get_blocksize();
+ uint32_t blocksize = decoder->get_blocksize();
/* value could be anything since we're at the last block, so accept any reasonable answer */
printf("returned %u... %s\n", blocksize, blocksize>0? "OK" : "FAILED");
if(blocksize == 0)
@@ -695,7 +695,7 @@ static bool test_stream_decoder(Layer layer, bool is_ogg)
printf("testing get_channel_assignment()... ");
{
::FLAC__ChannelAssignment ca = decoder->get_channel_assignment();
- printf("returned %u (%s)... OK\n", (unsigned)ca, ::FLAC__ChannelAssignmentString[ca]);
+ printf("returned %u (%s)... OK\n", (uint32_t)ca, ::FLAC__ChannelAssignmentString[ca]);
}
if(layer < LAYER_FILE) {
@@ -725,7 +725,7 @@ static bool test_stream_decoder(Layer layer, bool is_ogg)
printf("testing finish()... ");
if(!decoder->finish()) {
state = decoder->get_state();
- printf("FAILED, returned false, state = %u (%s)\n", (unsigned)((::FLAC__StreamDecoderState)state), state.as_cstring());
+ printf("FAILED, returned false, state = %u (%s)\n", (uint32_t)((::FLAC__StreamDecoderState)state), state.as_cstring());
return false;
}
printf("OK\n");
diff --git a/src/test_libFLAC++/encoders.cpp b/src/test_libFLAC++/encoders.cpp
index bafe0d4b..277e1293 100644
--- a/src/test_libFLAC++/encoders.cpp
+++ b/src/test_libFLAC++/encoders.cpp
@@ -56,7 +56,7 @@ static const char * const LayerString[] = {
static ::FLAC__StreamMetadata streaminfo_, padding_, seektable_, application1_, application2_, vorbiscomment_, cuesheet_, picture_, unknown_;
static ::FLAC__StreamMetadata *metadata_sequence_[] = { &vorbiscomment_, &padding_, &seektable_, &application1_, &application2_, &cuesheet_, &picture_, &unknown_ };
-static const unsigned num_metadata_ = sizeof(metadata_sequence_) / sizeof(metadata_sequence_[0]);
+static const uint32_t num_metadata_ = sizeof(metadata_sequence_) / sizeof(metadata_sequence_[0]);
static const char *flacfilename(bool is_ogg)
{
@@ -78,10 +78,10 @@ static bool die_s_(const char *msg, const FLAC::Encoder::Stream *encoder)
else
printf("FAILED");
- printf(", state = %u (%s)\n", (unsigned)((::FLAC__StreamEncoderState)state), state.as_cstring());
+ printf(", state = %u (%s)\n", (uint32_t)((::FLAC__StreamEncoderState)state), state.as_cstring());
if(state == ::FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR) {
FLAC::Decoder::Stream::State dstate = encoder->get_verify_decoder_state();
- printf(" verify decoder state = %u (%s)\n", (unsigned)((::FLAC__StreamDecoderState)dstate), dstate.as_cstring());
+ printf(" verify decoder state = %u (%s)\n", (uint32_t)((::FLAC__StreamDecoderState)dstate), dstate.as_cstring());
}
return false;
@@ -107,7 +107,7 @@ public:
// from FLAC::Encoder::Stream
::FLAC__StreamEncoderReadStatus read_callback(FLAC__byte buffer[], size_t *bytes);
- ::FLAC__StreamEncoderWriteStatus write_callback(const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame);
+ ::FLAC__StreamEncoderWriteStatus write_callback(const FLAC__byte buffer[], size_t bytes, uint32_t samples, uint32_t current_frame);
::FLAC__StreamEncoderSeekStatus seek_callback(FLAC__uint64 absolute_byte_offset);
::FLAC__StreamEncoderTellStatus tell_callback(FLAC__uint64 *absolute_byte_offset);
void metadata_callback(const ::FLAC__StreamMetadata *metadata);
@@ -131,7 +131,7 @@ private:
return ::FLAC__STREAM_ENCODER_READ_STATUS_ABORT;
}
-::FLAC__StreamEncoderWriteStatus StreamEncoder::write_callback(const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame)
+::FLAC__StreamEncoderWriteStatus StreamEncoder::write_callback(const FLAC__byte buffer[], size_t bytes, uint32_t samples, uint32_t current_frame)
{
(void)samples, (void)current_frame;
@@ -177,10 +177,10 @@ public:
~FileEncoder() { }
// from FLAC::Encoder::File
- void progress_callback(FLAC__uint64 bytes_written, FLAC__uint64 samples_written, unsigned frames_written, unsigned total_frames_estimate);
+ void progress_callback(FLAC__uint64 bytes_written, FLAC__uint64 samples_written, uint32_t frames_written, uint32_t total_frames_estimate);
};
-void FileEncoder::progress_callback(FLAC__uint64 bytes_written, FLAC__uint64 samples_written, unsigned frames_written, unsigned total_frames_estimate)
+void FileEncoder::progress_callback(FLAC__uint64 bytes_written, FLAC__uint64 samples_written, uint32_t frames_written, uint32_t total_frames_estimate)
{
(void)bytes_written, (void)samples_written, (void)frames_written, (void)total_frames_estimate;
}
@@ -200,7 +200,7 @@ static bool test_stream_encoder(Layer layer, bool is_ogg)
FILE *file = 0;
FLAC__int32 samples[1024];
FLAC__int32 *samples_array[1] = { samples };
- unsigned i;
+ uint32_t i;
printf("\n+++ libFLAC++ unit test: FLAC::Encoder::%s (layer: %s, format: %s)\n\n", layer<LAYER_FILE? "Stream":"File", LayerString[layer], is_ogg? "Ogg FLAC":"FLAC");
@@ -252,7 +252,7 @@ static bool test_stream_encoder(Layer layer, bool is_ogg)
printf("OK\n");
printf("testing set_compression_level()... ");
- if(!encoder->set_compression_level((unsigned)(-1)))
+ if(!encoder->set_compression_level((uint32_t)(-1)))
return die_s_("returned false", encoder);
printf("OK\n");
@@ -361,17 +361,17 @@ static bool test_stream_encoder(Layer layer, bool is_ogg)
printf("testing get_state()... ");
FLAC::Encoder::Stream::State state = encoder->get_state();
- printf("returned state = %u (%s)... OK\n", (unsigned)((::FLAC__StreamEncoderState)state), state.as_cstring());
+ printf("returned state = %u (%s)... OK\n", (uint32_t)((::FLAC__StreamEncoderState)state), state.as_cstring());
printf("testing get_verify_decoder_state()... ");
FLAC::Decoder::Stream::State dstate = encoder->get_verify_decoder_state();
- printf("returned state = %u (%s)... OK\n", (unsigned)((::FLAC__StreamDecoderState)dstate), dstate.as_cstring());
+ printf("returned state = %u (%s)... OK\n", (uint32_t)((::FLAC__StreamDecoderState)dstate), dstate.as_cstring());
{
FLAC__uint64 absolute_sample;
- unsigned frame_number;
- unsigned channel;
- unsigned sample;
+ uint32_t frame_number;
+ uint32_t channel;
+ uint32_t sample;
FLAC__int32 expected;
FLAC__int32 got;
@@ -514,7 +514,7 @@ static bool test_stream_encoder(Layer layer, bool is_ogg)
printf("testing finish()... ");
if(!encoder->finish()) {
state = encoder->get_state();
- printf("FAILED, returned false, state = %u (%s)\n", (unsigned)((::FLAC__StreamEncoderState)state), state.as_cstring());
+ printf("FAILED, returned false, state = %u (%s)\n", (uint32_t)((::FLAC__StreamEncoderState)state), state.as_cstring());
return false;
}
printf("OK\n");
diff --git a/src/test_libFLAC++/metadata_manip.cpp b/src/test_libFLAC++/metadata_manip.cpp
index 9a29093a..a7aaf910 100644
--- a/src/test_libFLAC++/metadata_manip.cpp
+++ b/src/test_libFLAC++/metadata_manip.cpp
@@ -70,14 +70,14 @@ protected:
struct OurMetadata {
FLAC::Metadata::Prototype *blocks[64];
- unsigned num_blocks;
+ uint32_t num_blocks;
};
/* our copy of the metadata in flacfilename() */
static OurMetadata our_metadata_;
/* the current block number that corresponds to the position of the iterator we are testing */
-static unsigned mc_our_block_number_ = 0;
+static uint32_t mc_our_block_number_ = 0;
static const char *flacfilename(bool is_ogg)
{
@@ -93,7 +93,7 @@ static bool die_(const char *msg)
static bool die_c_(const char *msg, FLAC::Metadata::Chain::Status status)
{
printf("ERROR: %s\n", msg);
- printf(" status=%u (%s)\n", (unsigned)((::FLAC__Metadata_ChainStatus)status), status.as_cstring());
+ printf(" status=%u (%s)\n", (uint32_t)((::FLAC__Metadata_ChainStatus)status), status.as_cstring());
return false;
}
@@ -101,7 +101,7 @@ static bool die_ss_(const char *msg, FLAC::Metadata::SimpleIterator &iterator)
{
const FLAC::Metadata::SimpleIterator::Status status = iterator.status();
printf("ERROR: %s\n", msg);
- printf(" status=%u (%s)\n", (unsigned)((::FLAC__Metadata_SimpleIteratorStatus)status), status.as_cstring());
+ printf(" status=%u (%s)\n", (uint32_t)((::FLAC__Metadata_SimpleIteratorStatus)status), status.as_cstring());
return false;
}
@@ -109,7 +109,7 @@ static void *malloc_or_die_(size_t size)
{
void *x = malloc(size);
if(0 == x) {
- fprintf(stderr, "ERROR: out of memory allocating %u bytes\n", (unsigned)size);
+ fprintf(stderr, "ERROR: out of memory allocating %u bytes\n", (uint32_t)size);
exit(1);
}
return x;
@@ -127,9 +127,9 @@ static char *strdup_or_die_(const char *s)
/* functions for working with our metadata copy */
-static bool replace_in_our_metadata_(FLAC::Metadata::Prototype *block, unsigned position, bool copy)
+static bool replace_in_our_metadata_(FLAC::Metadata::Prototype *block, uint32_t position, bool copy)
{
- unsigned i;
+ uint32_t i;
FLAC::Metadata::Prototype *obj = block;
FLAC__ASSERT(position < our_metadata_.num_blocks);
if(copy) {
@@ -147,9 +147,9 @@ static bool replace_in_our_metadata_(FLAC::Metadata::Prototype *block, unsigned
return true;
}
-static bool insert_to_our_metadata_(FLAC::Metadata::Prototype *block, unsigned position, bool copy)
+static bool insert_to_our_metadata_(FLAC::Metadata::Prototype *block, uint32_t position, bool copy)
{
- unsigned i;
+ uint32_t i;
FLAC::Metadata::Prototype *obj = block;
if(copy) {
if(0 == (obj = FLAC::Metadata::clone(block)))
@@ -173,9 +173,9 @@ static bool insert_to_our_metadata_(FLAC::Metadata::Prototype *block, unsigned p
return true;
}
-static void delete_from_our_metadata_(unsigned position)
+static void delete_from_our_metadata_(uint32_t position)
{
- unsigned i;
+ uint32_t i;
FLAC__ASSERT(position < our_metadata_.num_blocks);
delete our_metadata_.blocks[position];
for(i = position; i < our_metadata_.num_blocks - 1; i++)
@@ -190,11 +190,11 @@ static void delete_from_our_metadata_(unsigned position)
}
}
-void add_to_padding_length_(unsigned indx, int delta)
+void add_to_padding_length_(uint32_t indx, int delta)
{
FLAC::Metadata::Padding *padding = dynamic_cast<FLAC::Metadata::Padding *>(our_metadata_.blocks[indx]);
FLAC__ASSERT(0 != padding);
- padding->set_length((unsigned)((int)padding->get_length() + delta));
+ padding->set_length((uint32_t)((int)padding->get_length() + delta));
}
/*
@@ -398,9 +398,9 @@ static bool read_chain_(FLAC::Metadata::Chain &chain, const char *filename, bool
/* function for comparing our metadata to a FLAC::Metadata::Chain */
-static bool compare_chain_(FLAC::Metadata::Chain &chain, unsigned current_position, FLAC::Metadata::Prototype *current_block)
+static bool compare_chain_(FLAC::Metadata::Chain &chain, uint32_t current_position, FLAC::Metadata::Prototype *current_block)
{
- unsigned i;
+ uint32_t i;
FLAC::Metadata::Iterator iterator;
bool next_ok = true;
@@ -492,14 +492,14 @@ void OurFileDecoder::metadata_callback(const ::FLAC__StreamMetadata *metadata)
void OurFileDecoder::error_callback(::FLAC__StreamDecoderErrorStatus status)
{
error_occurred_ = true;
- printf("ERROR: got error callback, status = %s (%u)\n", FLAC__StreamDecoderErrorStatusString[status], (unsigned)status);
+ printf("ERROR: got error callback, status = %s (%u)\n", FLAC__StreamDecoderErrorStatusString[status], (uint32_t)status);
}
static bool generate_file_(bool include_extras, bool is_ogg)
{
::FLAC__StreamMetadata streaminfo, vorbiscomment, *cuesheet, picture, padding;
::FLAC__StreamMetadata *metadata[4];
- unsigned i = 0, n = 0;
+ uint32_t i = 0, n = 0;
printf("generating %sFLAC file for test\n", is_ogg? "Ogg " : "");
@@ -520,7 +520,7 @@ static bool generate_file_(bool include_extras, bool is_ogg)
memset(streaminfo.data.stream_info.md5sum, 0, 16);
{
- const unsigned vendor_string_length = (unsigned)strlen(FLAC__VENDOR_STRING);
+ const uint32_t vendor_string_length = (uint32_t)strlen(FLAC__VENDOR_STRING);
vorbiscomment.is_last = false;
vorbiscomment.type = ::FLAC__METADATA_TYPE_VORBIS_COMMENT;
vorbiscomment.length = (4 + vendor_string_length) + 4;
@@ -766,7 +766,7 @@ static bool test_level_0_()
FLAC::Metadata::Picture *picture = 0;
- if(!FLAC::Metadata::get_picture(flacfilename(/*is_ogg=*/false), picture, /*type=*/(::FLAC__StreamMetadata_Picture_Type)(-1), /*mime_type=*/0, /*description=*/0, /*max_width=*/(unsigned)(-1), /*max_height=*/(unsigned)(-1), /*max_depth=*/(unsigned)(-1), /*max_colors=*/(unsigned)(-1)))
+ if(!FLAC::Metadata::get_picture(flacfilename(/*is_ogg=*/false), picture, /*type=*/(::FLAC__StreamMetadata_Picture_Type)(-1), /*mime_type=*/0, /*description=*/0, /*max_width=*/(uint32_t)(-1), /*max_height=*/(uint32_t)(-1), /*max_depth=*/(uint32_t)(-1), /*max_colors=*/(uint32_t)(-1)))
return die_("during FLAC::Metadata::get_picture()");
/* check to see if some basic data matches (c.f. generate_file_()) */
@@ -783,7 +783,7 @@ static bool test_level_0_()
FLAC::Metadata::Picture picture;
- if(!FLAC::Metadata::get_picture(flacfilename(/*is_ogg=*/false), picture, /*type=*/(::FLAC__StreamMetadata_Picture_Type)(-1), /*mime_type=*/0, /*description=*/0, /*max_width=*/(unsigned)(-1), /*max_height=*/(unsigned)(-1), /*max_depth=*/(unsigned)(-1), /*max_colors=*/(unsigned)(-1)))
+ if(!FLAC::Metadata::get_picture(flacfilename(/*is_ogg=*/false), picture, /*type=*/(::FLAC__StreamMetadata_Picture_Type)(-1), /*mime_type=*/0, /*description=*/0, /*max_width=*/(uint32_t)(-1), /*max_height=*/(uint32_t)(-1), /*max_depth=*/(uint32_t)(-1), /*max_colors=*/(uint32_t)(-1)))
return die_("during FLAC::Metadata::get_picture()");
/* check to see if some basic data matches (c.f. generate_file_()) */
@@ -806,7 +806,7 @@ static bool test_level_1_()
FLAC::Metadata::Padding *padding;
FLAC::Metadata::Application *app;
FLAC__byte data[1000];
- unsigned our_current_position = 0;
+ uint32_t our_current_position = 0;
// initialize 'data' to avoid Valgrind errors
memset(data, 0, sizeof(data));
@@ -834,7 +834,7 @@ static bool test_level_1_()
if(!iterator.init(flacfilename(/*is_ogg=*/false), /*read_only=*/false, /*preserve_file_stats=*/false))
return die_("iterator.init() returned false");
- printf("is writable = %u\n", (unsigned)iterator.is_writable());
+ printf("is writable = %u\n", (uint32_t)iterator.is_writable());
if(iterator.is_writable())
return die_("iterator claims file is writable when tester thinks it should not be; are you running as root?\n");
@@ -917,7 +917,7 @@ static bool test_level_1_()
if(0 == (app = new FLAC::Metadata::Application()))
return die_("new FLAC::Metadata::Application()");
- app->set_id((const unsigned char *)"duh");
+ app->set_id((const uint8_t *)"duh");
printf("creating PADDING block\n");
@@ -942,7 +942,7 @@ static bool test_level_1_()
}
our_current_position = 0;
- printf("is writable = %u\n", (unsigned)iterator.is_writable());
+ printf("is writable = %u\n", (uint32_t)iterator.is_writable());
printf("[S]VP\ttry to write over STREAMINFO block...\n");
if(!iterator.set_block(app, false))
@@ -1103,7 +1103,7 @@ static bool test_level_1_()
our_current_position++;
printf("S[V]P\tinsert APPLICATION after, expand into padding of exceeding size\n");
- app->set_id((const unsigned char *)"euh"); /* twiddle the id so that our comparison doesn't miss transposition */
+ app->set_id((const uint8_t *)"euh"); /* twiddle the id so that our comparison doesn't miss transposition */
if(!iterator.insert_block_after(app, true))
return die_ss_("iterator.insert_block_after(app, true)", iterator);
if(!insert_to_our_metadata_(app, ++our_current_position, /*copy=*/true))
@@ -1119,7 +1119,7 @@ static bool test_level_1_()
our_current_position++;
printf("SVA[P]\tset APPLICATION, expand into padding of exceeding size\n");
- app->set_id((const unsigned char *)"fuh"); /* twiddle the id */
+ app->set_id((const uint8_t *)"fuh"); /* twiddle the id */
if(!iterator.set_block(app, true))
return die_ss_("iterator.set_block(app, true)", iterator);
if(!insert_to_our_metadata_(app, our_current_position, /*copy=*/true))
@@ -1130,7 +1130,7 @@ static bool test_level_1_()
return false;
printf("SVA[A]P\tset APPLICATION (grow), don't expand into padding\n");
- app->set_id((const unsigned char *)"guh"); /* twiddle the id */
+ app->set_id((const uint8_t *)"guh"); /* twiddle the id */
if(!app->set_data(data, sizeof(data), true))
return die_("setting APPLICATION data");
if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true))
@@ -1142,7 +1142,7 @@ static bool test_level_1_()
return false;
printf("SVA[A]P\tset APPLICATION (shrink), don't fill in with padding\n");
- app->set_id((const unsigned char *)"huh"); /* twiddle the id */
+ app->set_id((const uint8_t *)"huh"); /* twiddle the id */
if(!app->set_data(data, 12, true))
return die_("setting APPLICATION data");
if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true))
@@ -1154,7 +1154,7 @@ static bool test_level_1_()
return false;
printf("SVA[A]P\tset APPLICATION (grow), expand into padding of exceeding size\n");
- app->set_id((const unsigned char *)"iuh"); /* twiddle the id */
+ app->set_id((const uint8_t *)"iuh"); /* twiddle the id */
if(!app->set_data(data, sizeof(data), true))
return die_("setting APPLICATION data");
if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true))
@@ -1167,7 +1167,7 @@ static bool test_level_1_()
return false;
printf("SVA[A]P\tset APPLICATION (shrink), fill in with padding\n");
- app->set_id((const unsigned char *)"juh"); /* twiddle the id */
+ app->set_id((const uint8_t *)"juh"); /* twiddle the id */
if(!app->set_data(data, 23, true))
return die_("setting APPLICATION data");
if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true))
@@ -1202,7 +1202,7 @@ static bool test_level_1_()
return false;
printf("SVAAP[P]\tset APPLICATION (grow)\n");
- app->set_id((const unsigned char *)"kuh"); /* twiddle the id */
+ app->set_id((const uint8_t *)"kuh"); /* twiddle the id */
if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true))
return die_("copying object");
if(!iterator.set_block(app, false))
@@ -1490,7 +1490,7 @@ static bool test_level_2_(bool filename_based, bool is_ogg)
FLAC::Metadata::Application *app;
FLAC::Metadata::Padding *padding;
FLAC__byte data[2000];
- unsigned our_current_position;
+ uint32_t our_current_position;
// initialize 'data' to avoid Valgrind errors
memset(data, 0, sizeof(data));
@@ -1578,7 +1578,7 @@ static bool test_level_2_(bool filename_based, bool is_ogg)
return die_("getting block from iterator");
if(0 == (app = new FLAC::Metadata::Application()))
return die_("new FLAC::Metadata::Application()");
- app->set_id((const unsigned char *)"duh");
+ app->set_id((const uint8_t *)"duh");
if(!app->set_data(data, block->get_length()-(FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8), true))
return die_("setting APPLICATION data");
delete block;
diff --git a/src/test_libFLAC++/metadata_object.cpp b/src/test_libFLAC++/metadata_object.cpp
index e5ffd2ab..d46c1c20 100644
--- a/src/test_libFLAC++/metadata_object.cpp
+++ b/src/test_libFLAC++/metadata_object.cpp
@@ -40,7 +40,7 @@ static void *malloc_or_die_(size_t size)
{
void *x = malloc(size);
if(0 == x) {
- fprintf(stderr, "ERROR: out of memory allocating %u bytes\n", (unsigned)size);
+ fprintf(stderr, "ERROR: out of memory allocating %u bytes\n", (uint32_t)size);
exit(1);
}
return x;
@@ -67,7 +67,7 @@ static bool index_is_equal_(const ::FLAC__StreamMetadata_CueSheet_Index &indx, c
static bool track_is_equal_(const ::FLAC__StreamMetadata_CueSheet_Track *track, const ::FLAC__StreamMetadata_CueSheet_Track *trackcopy)
{
- unsigned i;
+ uint32_t i;
if(trackcopy->offset != track->offset)
return false;
@@ -249,7 +249,7 @@ static void free_metadata_blocks_()
bool test_metadata_object_streaminfo()
{
- unsigned expected_length;
+ uint32_t expected_length;
printf("testing class FLAC::Metadata::StreamInfo\n");
@@ -482,7 +482,7 @@ bool test_metadata_object_streaminfo()
bool test_metadata_object_padding()
{
- unsigned expected_length;
+ uint32_t expected_length;
printf("testing class FLAC::Metadata::Padding\n");
@@ -643,7 +643,7 @@ bool test_metadata_object_padding()
bool test_metadata_object_application()
{
- unsigned expected_length;
+ uint32_t expected_length;
printf("testing class FLAC::Metadata::Application\n");
@@ -813,7 +813,7 @@ bool test_metadata_object_application()
bool test_metadata_object_seektable()
{
- unsigned expected_length;
+ uint32_t expected_length;
printf("testing class FLAC::Metadata::SeekTable\n");
@@ -1012,7 +1012,7 @@ bool test_metadata_object_seektable()
bool test_metadata_object_vorbiscomment()
{
- unsigned expected_length;
+ uint32_t expected_length;
printf("testing class FLAC::Metadata::VorbisComment::Entry\n");
@@ -1027,7 +1027,7 @@ bool test_metadata_object_vorbiscomment()
}
printf("OK\n");
- printf("testing Entry::Entry(const char *field, unsigned field_length)... ");
+ printf("testing Entry::Entry(const char *field, uint32_t field_length)... ");
FLAC::Metadata::VorbisComment::Entry entry2("name2=value2", strlen("name2=value2"));
if(!entry2.is_valid())
return die_("!is_valid()");
@@ -1043,7 +1043,7 @@ bool test_metadata_object_vorbiscomment()
printf("OK\n");
}
- printf("testing Entry::Entry(const char *field_name, const char *field_value, unsigned field_value_length)... ");
+ printf("testing Entry::Entry(const char *field_name, const char *field_value, uint32_t field_value_length)... ");
FLAC::Metadata::VorbisComment::Entry entry3("name3", "value3", strlen("value3"));
if(!entry3.is_valid())
return die_("!is_valid()");
@@ -1125,7 +1125,7 @@ bool test_metadata_object_vorbiscomment()
return die_("entry mismatch");
printf("OK\n");
- printf("testing Entry::set_field_value(const char *field_value, unsigned field_value_length)... ");
+ printf("testing Entry::set_field_value(const char *field_value, uint32_t field_value_length)... ");
if(!entry1.set_field_value("value1", strlen("value1")))
return die_("returned false");
if(0 != memcmp(entry1.get_field_value(), "value1", strlen("value1")))
@@ -1143,7 +1143,7 @@ bool test_metadata_object_vorbiscomment()
return die_("entry mismatch");
printf("OK\n");
- printf("testing Entry::set_field(const char *field, unsigned field_length)... ");
+ printf("testing Entry::set_field(const char *field, uint32_t field_length)... ");
if(!entry1.set_field("name0=value0", strlen("name0=value0")))
return die_("returned false");
if(0 != memcmp(entry1.get_field_name(), "name0", strlen("name0")))
@@ -1428,7 +1428,7 @@ bool test_metadata_object_vorbiscomment()
bool test_metadata_object_cuesheet()
{
- unsigned expected_length;
+ uint32_t expected_length;
printf("testing class FLAC::Metadata::CueSheet::Track\n");
@@ -1807,7 +1807,7 @@ bool test_metadata_object_cuesheet()
bool test_metadata_object_picture()
{
- unsigned expected_length;
+ uint32_t expected_length;
printf("testing class FLAC::Metadata::Picture\n");