summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMickael Savinaud <savmickael@users.noreply.github.com>2013-02-16 17:39:23 +0000
committerMickael Savinaud <savmickael@users.noreply.github.com>2013-02-16 17:39:23 +0000
commit4bf4a7668eaeaa4b02051afe06b8ec3e0d805de3 (patch)
tree1e7b594fe97228ed16eb6268a8f9bf8c3175a06c /tests
parentc03ca9c73c15b893d5e952207224e3e339b5bbd6 (diff)
[trunk] move to the new API for function opj_stream_destroy. Use now opj_stream_destroy_v3 (WIP)
Diffstat (limited to 'tests')
-rw-r--r--tests/j2k_random_tile_access.c10
-rw-r--r--tests/test_tile_decoder.c18
-rw-r--r--tests/test_tile_encoder.c8
-rw-r--r--tests/unit/testempty1.c8
-rw-r--r--tests/unit/testempty2.c10
5 files changed, 27 insertions, 27 deletions
diff --git a/tests/j2k_random_tile_access.c b/tests/j2k_random_tile_access.c
index afe4bd41..065a955c 100644
--- a/tests/j2k_random_tile_access.c
+++ b/tests/j2k_random_tile_access.c
@@ -228,7 +228,7 @@ int main(int argc, char **argv)
/* Setup the decoder decoding parameters using user parameters */
if ( !opj_setup_decoder(l_codec, &parameters) ){
fprintf(stderr, "ERROR -> j2k_dump: failed to setup the decoder\n");
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
fclose(fsrc);
opj_destroy_codec(l_codec);
return EXIT_FAILURE;
@@ -237,7 +237,7 @@ int main(int argc, char **argv)
/* Read the main header of the codestream and if necessary the JP2 boxes*/
if(! opj_read_header(l_stream, l_codec, &image)){
fprintf(stderr, "ERROR -> j2k_to_image: failed to read the header\n");
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
fclose(fsrc);
opj_destroy_codec(l_codec);
opj_image_destroy(image);
@@ -258,7 +258,7 @@ int main(int argc, char **argv)
fprintf(stdout, "Decoding tile %d ...\n", tile_index); \
if(!opj_get_decoded_tile(l_codec, l_stream, image, tile_index )){ \
fprintf(stderr, "ERROR -> j2k_to_image: failed to decode tile %d\n", tile_index); \
- opj_stream_destroy(l_stream); \
+ opj_stream_destroy_v3(l_stream); \
opj_destroy_cstr_info(&cstr_info); \
opj_destroy_codec(l_codec); \
opj_image_destroy(image); \
@@ -268,7 +268,7 @@ int main(int argc, char **argv)
for(index = 0; index < image->numcomps; ++index) { \
if( image->comps[index].data == NULL ){ \
fprintf(stderr, "ERROR -> j2k_to_image: failed to decode tile %d\n", tile_index); \
- opj_stream_destroy(l_stream); \
+ opj_stream_destroy_v3(l_stream); \
opj_destroy_cstr_info(&cstr_info); \
opj_destroy_codec(l_codec); \
opj_image_destroy(image); \
@@ -286,7 +286,7 @@ int main(int argc, char **argv)
TEST_TILE(tile_lr)
/* Close the byte stream */
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
/* Destroy code stream info */
opj_destroy_cstr_info(&cstr_info);
diff --git a/tests/test_tile_decoder.c b/tests/test_tile_decoder.c
index 81f791cb..1dd3382f 100644
--- a/tests/test_tile_decoder.c
+++ b/tests/test_tile_decoder.c
@@ -270,7 +270,7 @@ int main (int argc, char *argv[])
fprintf(stderr, "ERROR -> Not a valid JPEG2000 file!\n");
fclose(l_file);
free(l_data);
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
return EXIT_FAILURE;
}
}
@@ -286,7 +286,7 @@ int main (int argc, char *argv[])
fprintf(stderr, "ERROR -> j2k_dump: failed to setup the decoder\n");
fclose(l_file);
free(l_data);
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
opj_destroy_codec(l_codec);
return EXIT_FAILURE;
}
@@ -297,7 +297,7 @@ int main (int argc, char *argv[])
fprintf(stderr, "ERROR -> j2k_to_image: failed to read the header\n");
fclose(l_file);
free(l_data);
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
opj_destroy_codec(l_codec);
return EXIT_FAILURE;
}
@@ -306,7 +306,7 @@ int main (int argc, char *argv[])
fprintf(stderr, "ERROR -> j2k_to_image: failed to set the decoded area\n");
fclose(l_file);
free(l_data);
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
opj_destroy_codec(l_codec);
opj_image_destroy(l_image);
return EXIT_FAILURE;
@@ -328,7 +328,7 @@ int main (int argc, char *argv[])
{
fclose(l_file);
free(l_data);
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
opj_destroy_codec(l_codec);
opj_image_destroy(l_image);
return EXIT_FAILURE;
@@ -343,7 +343,7 @@ int main (int argc, char *argv[])
{
fclose(l_file);
free(l_new_data);
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
opj_destroy_codec(l_codec);
opj_image_destroy(l_image);
return EXIT_FAILURE;
@@ -356,7 +356,7 @@ int main (int argc, char *argv[])
{
fclose(l_file);
free(l_data);
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
opj_destroy_codec(l_codec);
opj_image_destroy(l_image);
return EXIT_FAILURE;
@@ -369,7 +369,7 @@ int main (int argc, char *argv[])
{
fclose(l_file);
free(l_data);
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
opj_destroy_codec(l_codec);
opj_image_destroy(l_image);
return EXIT_FAILURE;
@@ -378,7 +378,7 @@ int main (int argc, char *argv[])
/* Free memory */
fclose(l_file);
free(l_data);
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
opj_destroy_codec(l_codec);
opj_image_destroy(l_image);
diff --git a/tests/test_tile_encoder.c b/tests/test_tile_encoder.c
index 22ecb348..54710369 100644
--- a/tests/test_tile_encoder.c
+++ b/tests/test_tile_encoder.c
@@ -290,7 +290,7 @@ int main (int argc, char *argv[])
if (! opj_start_compress(l_codec,l_image,l_stream)) {
fprintf(stderr, "ERROR -> test_tile_encoder: failed to start compress!\n");
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
fclose(l_file);
opj_destroy_codec(l_codec);
opj_image_destroy(l_image);
@@ -300,7 +300,7 @@ int main (int argc, char *argv[])
for (i=0;i<l_nb_tiles;++i) {
if (! opj_write_tile(l_codec,i,l_data,l_data_size,l_stream)) {
fprintf(stderr, "ERROR -> test_tile_encoder: failed to write the tile %d!\n",i);
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
fclose(l_file);
opj_destroy_codec(l_codec);
opj_image_destroy(l_image);
@@ -310,14 +310,14 @@ int main (int argc, char *argv[])
if (! opj_end_compress(l_codec,l_stream)) {
fprintf(stderr, "ERROR -> test_tile_encoder: failed to end compress!\n");
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
fclose(l_file);
opj_destroy_codec(l_codec);
opj_image_destroy(l_image);
return 1;
}
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
fclose(l_file);
opj_destroy_codec(l_codec);
opj_image_destroy(l_image);
diff --git a/tests/unit/testempty1.c b/tests/unit/testempty1.c
index add522a6..32736485 100644
--- a/tests/unit/testempty1.c
+++ b/tests/unit/testempty1.c
@@ -99,9 +99,9 @@ int main(int argc, char *argv[])
}
}
- /* catch events using our callbacks and give a local context */
- opj_set_info_handler(l_codec, info_callback,00);
- opj_set_warning_handler(l_codec, warning_callback,00);
+ /* catch events using our callbacks and give a local context */
+ opj_set_info_handler(l_codec, info_callback,00);
+ opj_set_warning_handler(l_codec, warning_callback,00);
opj_set_error_handler(l_codec, error_callback,00);
l_codec = opj_create_compress(OPJ_CODEC_J2K);
@@ -125,7 +125,7 @@ int main(int argc, char *argv[])
bSuccess = opj_end_compress(l_codec, l_stream);
assert( bSuccess );
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
fclose(f);
opj_destroy_codec(l_codec);
diff --git a/tests/unit/testempty2.c b/tests/unit/testempty2.c
index 47ef4cc2..3b0952b2 100644
--- a/tests/unit/testempty2.c
+++ b/tests/unit/testempty2.c
@@ -101,9 +101,9 @@ int main(int argc, char *argv[])
}
}
- /* catch events using our callbacks and give a local context */
- opj_set_info_handler(l_codec, info_callback,00);
- opj_set_warning_handler(l_codec, warning_callback,00);
+ /* catch events using our callbacks and give a local context */
+ opj_set_info_handler(l_codec, info_callback,00);
+ opj_set_warning_handler(l_codec, warning_callback,00);
opj_set_error_handler(l_codec, error_callback,00);
l_codec = opj_create_compress(OPJ_CODEC_J2K);
@@ -127,7 +127,7 @@ int main(int argc, char *argv[])
bSuccess = opj_end_compress(l_codec, l_stream);
assert( bSuccess );
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
fclose(f);
opj_destroy_codec(l_codec);
@@ -161,7 +161,7 @@ int main(int argc, char *argv[])
bSuccess = opj_end_decompress(l_codec, l_stream);
assert( bSuccess );
- opj_stream_destroy(l_stream);
+ opj_stream_destroy_v3(l_stream);
fclose(fsrc);
opj_destroy_codec(d_codec);