123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307 |
- //=================================================================
- //
- // zlib2.c
- //
- // zlib decompression test 2
- //
- //==========================================================================
- // ####ECOSGPLCOPYRIGHTBEGIN####
- // -------------------------------------------
- // This file is part of eCos, the Embedded Configurable Operating System.
- // Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
- //
- // eCos is free software; you can redistribute it and/or modify it under
- // the terms of the GNU General Public License as published by the Free
- // Software Foundation; either version 2 or (at your option) any later
- // version.
- //
- // eCos is distributed in the hope that it will be useful, but WITHOUT
- // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- // for more details.
- //
- // You should have received a copy of the GNU General Public License
- // along with eCos; if not, write to the Free Software Foundation, Inc.,
- // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- //
- // As a special exception, if other files instantiate templates or use
- // macros or inline functions from this file, or you compile this file
- // and link it with other works to produce a work based on this file,
- // this file does not by itself cause the resulting work to be covered by
- // the GNU General Public License. However the source code for this file
- // must still be made available in accordance with section (3) of the GNU
- // General Public License v2.
- //
- // This exception does not invalidate any other reasons why a work based
- // on this file might be covered by the GNU General Public License.
- // -------------------------------------------
- // ####ECOSGPLCOPYRIGHTEND####
- //==========================================================================
- //#####DESCRIPTIONBEGIN####
- //
- // Author(s): jskov
- // Contributors: jskov
- // Date: 2001-03-09
- // Description: Tests zlib compression of gz compressed image.
- //####DESCRIPTIONEND####
- #include <cyg/hal/hal_arch.h> // CYGNUM_HAL_STACK_SIZE_TYPICAL
- #include <cyg/kernel/kapi.h>
- #include <cyg/infra/testcase.h>
- #ifdef CYGFUN_KERNEL_API_C
- #include <cyg/compress/zlib.h>
- #include <stdlib.h>
- #define NTHREADS 1
- #define STACKSIZE (CYGNUM_HAL_STACK_SIZE_TYPICAL > 8192 ? CYGNUM_HAL_STACK_SIZE_TYPICAL : 8192)
- static cyg_handle_t thread[NTHREADS];
- static cyg_thread thread_obj[NTHREADS];
- static char stack[NTHREADS][STACKSIZE];
- unsigned char gzip_test[] = {
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x8d, 0x56, 0xdb, 0x6e, 0xe3, 0x36,
- 0x10, 0xed, 0x33, 0xbf, 0x82, 0x08, 0x50, 0x74, 0x03, 0xb8, 0xee, 0xa6, 0xed, 0x6e, 0x2f, 0x6f,
- 0xd9, 0x24, 0x8b, 0x06, 0xd8, 0x4b, 0x91, 0x2c, 0xba, 0xe8, 0x23, 0x4d, 0x8d, 0x6c, 0x22, 0x12,
- 0xa9, 0x92, 0x94, 0x9d, 0xfc, 0x7d, 0xcf, 0x0c, 0x25, 0x59, 0x72, 0x1a, 0xa0, 0x7e, 0x32, 0x45,
- 0x72, 0xe6, 0xcc, 0xcc, 0x99, 0x33, 0xbc, 0xa3, 0x4a, 0xff, 0x61, 0xb2, 0xa6, 0xab, 0x90, 0xf4,
- 0x9f, 0xfd, 0xa6, 0x71, 0x56, 0x7f, 0x70, 0x96, 0x7c, 0x22, 0xbd, 0xbf, 0x58, 0x5f, 0x28, 0xfc,
- 0x2e, 0xd6, 0xfa, 0xfa, 0xe6, 0xfd, 0xed, 0xa7, 0xdb, 0x2f, 0xb7, 0x9f, 0x3f, 0xdd, 0xf3, 0x1a,
- 0x5f, 0xce, 0xae, 0x82, 0xcf, 0xd1, 0x6d, 0xfa, 0x1c, 0xe2, 0x99, 0x6e, 0xc9, 0xf8, 0xa4, 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67, 0x1e, 0x66, 0xf2, 0x8e,
- 0x4a, 0x60, 0x8a, 0xbc, 0x5e, 0xc1, 0x59, 0x8f, 0x20, 0x2d, 0xb7, 0xd2, 0xc2, 0x20, 0x63, 0x52,
- 0x05, 0x53, 0x21, 0x14, 0xbf, 0x03, 0xef, 0x86, 0x37, 0xf5, 0x3b, 0x3c, 0x76, 0xaa, 0xe9, 0x3d,
- 0x28, 0x19, 0xaf, 0x06, 0xfd, 0x1f, 0x8e, 0xa8, 0x6a, 0x7c, 0x85, 0x49, 0xb5, 0xaa, 0x1f, 0x38,
- 0xbd, 0x20, 0x0b, 0xab, 0xa4, 0x84, 0x22, 0x02, 0x74, 0x3c, 0x54, 0xca, 0xa3, 0xa6, 0xd6, 0xd6,
- 0x85, 0x59, 0xf2, 0x16, 0xe2, 0xec, 0xdd, 0xbd, 0xfc, 0x9a, 0x5f, 0xab, 0x61, 0x13, 0xdd, 0x39,
- 0x07, 0x86, 0x24, 0x3f, 0x8d, 0x2a, 0x36, 0x4c, 0xa2, 0x38, 0xe7, 0xee, 0x5c, 0x26, 0xd7, 0xea,
- 0x9b, 0x7f, 0x01, 0x21, 0xe0, 0xda, 0x98, 0x30, 0x0c, 0x00, 0x00};
- unsigned char gzip_test_ref[] =
- "Red Hat eCos Public License v1.1\n"
- "\n"
- "\n"
- "\n"
- "1. DEFINITIONS\n"
- "\n"
- "1.1. \"Contributor\" means each entity that creates or\n"
- "contributes to the creation of Modifications.\n"
- "\n"
- "1.2. \"Contributor Version\" means the combination of the\n"
- "Original Code, prior Modifications used by a\n"
- "Contributor, and the Modifications made by that\n"
- "particular Contributor.\n"
- "\n"
- "1.3. \"Covered Code\" means the Original Code or\n"
- "Modifications or the combination of the Original Code\n"
- "and Modifications, in each case including portions\n"
- "thereof.\n"
- "\n"
- "1.4. \"Electronic Distribution Mechanism\" means a\n"
- "mechanism generally accepted in the software development\n"
- "community for the electronic transfer of data.\n"
- "\n"
- "1.5. \"Executable\" means Covered Code in any form other\n"
- "than Source Code.\n"
- "1.6. \"Initial Developer\" means the individual or entity\n"
- "identified as the Initial Developer in the Source Code\n"
- "notice required by Exhibit A.\n"
- "\n"
- "1.7. \"Larger Work\" means a work which combines Covered\n"
- "Code or portions thereof with code not governed by the\n"
- "terms of this License.\n"
- "\n"
- "1.8. \"License\" means this document.\n"
- "\n"
- "1.9. \"Modifications\" means any addition to or deletion\n"
- "from the substance or structure of either the Original\n"
- "Code or any previous Modifications. When Covered Code is\n"
- "released as a series of files, a Modification is:\n"
- "\n"
- " A. Any addition to or deletion from the\n"
- " contents of a file containing Original Code or\n"
- " previous Modifications.\n"
- "\n"
- " B. Any new file that contains any part of the\n"
- " Original Code or previous Modifications.\n"
- "\n"
- "1.10. \"Original Code\" means Source Code of computer\n"
- "software code which is described in the Source Code\n"
- "notice required by Exhibit A as Original Code, and\n"
- "which, at the time of its release under this License is\n"
- "not already Covered Code governed by this License.\n"
- "\n"
- "1.11. \"Source Code\" means the preferred form of the\n"
- "Covered Code for making modifications to it, including\n"
- "all modules it contains, plus any associated interface\n"
- "definition files, scripts used to control compilation\n"
- "and installation of an Executable, or a list of source\n"
- "code differential comparisons against either the\n"
- "Original Code or another well known, available Covered\n"
- "Code of the Contributor's choice. The Source Code can be\n"
- "in a compressed or archival form, provided the\n"
- "appropriate decompression or de-archiving software is\n"
- "widely available for no charge.\n"
- "\n"
- "1.12. \"You\" means an individual or a legal entity\n"
- "exercising rights under, and complying with all of the\n"
- "terms of, this License or a future version of this\n"
- "License issued under Section 6.1. For legal entities,\n"
- "\"You\" includes any entity which controls, is controlled\n"
- "by, or is under common control with You. For purposes of\n"
- "this definition, \"control\" means (a) the power, direct\n"
- "or indirect, to cause the direction or management of\n"
- "such entity, whether by contract or otherwise, or (b)\n"
- "ownership of fifty percent (50%) or more of the\n"
- "outstanding shares or beneficial ownership of such\n"
- "entity.\n"
- "\n"
- "1.13. \"Red Hat Branded Code\" is code that Red Hat\n"
- "distributes and/or permits others to distribute under\n"
- "different terms than the Red Hat eCos Public License.\n"
- "Red Hat's Branded Code may contain part or all of the\n"
- "Covered Code.\n";
- static void entry0( cyg_addrword_t data )
- {
- int i;
- unsigned long len;
- int err;
- int buf_size = sizeof(gzip_test_ref)+512;
- unsigned char* unpacked = malloc(buf_size);
-
- if (NULL == unpacked)
- CYG_TEST_NA("Not enough memory for buffers");
- CYG_TEST_INFO("Decompressing");
- len = buf_size;
- err = uncompress(unpacked, &len, gzip_test, sizeof(gzip_test));
- switch (err) {
- case Z_OK:
- break;
- case Z_MEM_ERROR:
- CYG_TEST_NA("Not enough memory for decompression");
- break;
- case Z_BUF_ERROR:
- CYG_TEST_FAIL_FINISH("Decompressed data larger than original");
- break;
- case Z_DATA_ERROR:
- CYG_TEST_FAIL_FINISH("Decompression failed");
- break;
- default:
- CYG_TEST_FAIL_FINISH("Unknown decompression error");
- break;
- }
- for (i = 0; i < sizeof(gzip_test_ref)-1; i++) {
- if (gzip_test_ref[i] != unpacked[i])
- CYG_TEST_FAIL_FINISH("Verify failed");
- }
- CYG_TEST_PASS_FINISH("zlib2 OK");
- }
- void zlib2_main( void )
- {
- CYG_TEST_INIT();
- cyg_thread_create(4, entry0 , (cyg_addrword_t)0, "zlib1",
- (void *)stack[0], STACKSIZE,&thread[0], &thread_obj[0]);
- cyg_thread_resume(thread[0]);
- cyg_scheduler_start();
- CYG_TEST_FAIL_FINISH("Not reached");
- }
- externC void
- cyg_start( void )
- {
- zlib2_main();
- }
- #else /* def CYGFUN_KERNEL_API_C */
- externC void
- cyg_start( void )
- {
- CYG_TEST_INIT();
- CYG_TEST_NA("Kernel C API layer disabled");
- }
- #endif /* def CYGFUN_KERNEL_API_C */
- // EOF zlib1.c
|