LTP GCOV extension - code coverage report
Current view: directory - src/utils/parser - min_section_parser.tests
Test: min.info
Date: 2009-06-18 Instrumented lines: 1557
Code covered: 100.0 % Executed lines: 1557

       1                 : /*
       2                 :  * This file is part of MIN Test Framework. Copyright © 2008 Nokia Corporation
       3                 :  * and/or its subsidiary(-ies).
       4                 :  * Contact: Konrad Marek Zapalowicz
       5                 :  * Contact e-mail: DG.MIN-Support@nokia.com
       6                 :  * 
       7                 :  * This program is free software: you can redistribute it and/or modify it 
       8                 :  * under the terms of the GNU General Public License as published by the Free 
       9                 :  * Software Foundation, version 2 of the License. 
      10                 :  * 
      11                 :  * This program is distributed in the hope that it will be useful, but WITHOUT 
      12                 :  * ANY WARRANTY; without even the implied warranty of  MERCHANTABILITY or 
      13                 :  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General  Public License for
      14                 :  * more details. You should have received a copy of the GNU General Public 
      15                 :  * License along with this program. If not,  see 
      16                 :  * <http://www.gnu.org/licenses/>.
      17                 :  */
      18                 : 
      19                 : 
      20                 : /**
      21                 :  *  @file       min_section_parser.test
      22                 :  *  @version    0.1
      23                 :  *  @brief      This file contains test for Min Section Parser.
      24                 :  */
      25                 : 
      26                 : /* ------------------------------------------------------------------------- */
      27                 : /* INCLUDES */
      28                 : #include <check.h>
      29                 : 
      30                 : /* ------------------------------------------------------------------------- */
      31                 : /* CONSTANTS */
      32                 : /* None */
      33                 : 
      34                 : /* ------------------------------------------------------------------------- */
      35                 : /* MACROS */
      36                 : /* None */
      37                 : 
      38                 : /* ------------------------------------------------------------------------- */
      39                 : /* DATA TYPES */
      40                 : /* None */
      41                 : 
      42                 : /* ------------------------------------------------------------------------- */
      43                 : /* LOCAL FUNCTION PROTOTYPES */
      44                 : /* None */
      45                 : 
      46                 : /* ------------------------------------------------------------------------- */
      47                 : /* FORWARD DECLARATIONS */
      48                 : /* None */
      49                 : 
      50                 : /* ------------------------------------------------------------------------- */
      51                 : /* STRUCTURES */
      52                 : /* None */
      53                 : 
      54                 : /* ------------------------------------------------------------------------- */
      55                 : /* ==================== LOCAL FUNCTIONS ==================================== */
      56                 : /* None */
      57                 : 
      58                 : /* ------------------------------------------------------------------------- */
      59                 : /* ============================= TESTS ===================================== */
      60                 : /* ------------------------------------------------------------------------- */
      61               1 : START_TEST(test_mmp_create)
      62                 : {
      63               1 :         MinSectionParser* msp = mmp_create( 10 );
      64               1 :         fail_unless( msp != INITPTR, "Section parser not allocated." );
      65                 : }
      66               1 : END_TEST
      67                 : /* ------------------------------------------------------------------------- */
      68               1 : START_TEST(test_mmp_create2)
      69                 : {
      70               1 :         MinSectionParser* msp = mmp_create( 0 );
      71               1 :         fail_unless( msp != INITPTR, "Section parser not allocated." );
      72                 : }
      73               1 : END_TEST
      74                 : /* ------------------------------------------------------------------------- */
      75               1 : START_TEST(test_mmp_create3)
      76                 : {
      77               1 :         MinSectionParser* msp = mmp_create( 10 );
      78               1 :         fail_unless( msp != INITPTR
      79                 :                    , "Section parser not allocated." );
      80                 : }
      81               1 : END_TEST
      82                 : /* ------------------------------------------------------------------------- */
      83               1 : START_TEST(test_mmp_create4)
      84                 : {
      85               1 :         MinSectionParser* msp = mmp_create( 10 );
      86               1 :         fail_unless( msp->length_ == 10
      87                 :                    , "msp->length_ has inproper value." );
      88                 : }
      89               1 : END_TEST
      90                 : /* ------------------------------------------------------------------------- */
      91               1 : START_TEST(test_mmp_create5)
      92                 : {
      93               1 :         MinSectionParser* msp = mmp_create( 10 );
      94               1 :         fail_unless( msp->skip_and_mark_pos_ == 0
      95                 :                    , "msp->skip_and_mark_pos_ has inproper value." );
      96                 : 
      97                 : }
      98               1 : END_TEST
      99                 : /* ------------------------------------------------------------------------- */
     100               1 : START_TEST(test_mmp_create6)
     101                 : {
     102               1 :         MinSectionParser* msp = mmp_create( 10 );
     103               1 :         fail_unless( msp->line_indicator_ == ESFalse
     104                 :                    , "msp->line_indicator_ has inproper value." );
     105                 : }
     106               1 : END_TEST
     107                 : /* ------------------------------------------------------------------------- */
     108               1 : START_TEST(test_mmp_create7)
     109                 : {
     110               1 :         MinSectionParser* msp = mmp_create( 10 );
     111               1 :         fail_unless( msp->buffer_section_ != INITPTR
     112                 :                    , "msp->buffer_section_ not initialized." );
     113                 : }
     114               1 : END_TEST
     115                 : /* ------------------------------------------------------------------------- */
     116               1 : START_TEST(test_mmp_create8)
     117                 : {
     118               1 :         MinSectionParser* msp = mmp_create( 10 );
     119               1 :         fail_unless( msp->section_ == msp->buffer_section_
     120                 :                    , "msp->section_ wrongly initialized." );
     121                 : }
     122               1 : END_TEST
     123                 : /* ------------------------------------------------------------------------- */
     124               1 : START_TEST(test_mmp_create9)
     125                 : {
     126               1 :         MinSectionParser* msp = mmp_create( 10 );
     127               1 :         fail_unless( msp->sub_offset_ == msp->buffer_section_
     128                 :                    , "msp->sub_offset_ wrongly initialized." );
     129                 : }
     130               1 : END_TEST
     131                 : /* ------------------------------------------------------------------------- */
     132               1 : START_TEST(test_mmp_destroy)
     133                 : {
     134               1 :         MinSectionParser* msp = mmp_create( 10 );
     135               1 :         mmp_destroy(&msp);
     136               1 :         fail_unless( msp == INITPTR
     137                 :                    , "SectionParser not set to INITPTR after deletion." );
     138                 : }
     139               1 : END_TEST
     140                 : /* ------------------------------------------------------------------------- */
     141               1 : START_TEST(test_mmp_destroy2)
     142                 : {
     143               1 :         MinSectionParser* msp = INITPTR;
     144               1 :         mmp_destroy(&msp);
     145                 : }
     146               1 : END_TEST
     147                 : /* ------------------------------------------------------------------------- */
     148               1 : START_TEST(test_mmp_get_item_line)
     149                 : {
     150               1 :         MinSectionParser*      msp = INITPTR;
     151               1 :         MinItemParser*         mip = INITPTR;
     152                 : 
     153               1 :         mip = mmp_get_item_line( msp
     154                 :                                , "Tag"
     155                 :                                , ESNoTag );
     156                 : 
     157               1 :         fail_unless( mip == INITPTR
     158                 :                    , "mip != INITPTR" );
     159                 : }
     160               1 : END_TEST
     161                 : /* ------------------------------------------------------------------------- */
     162               1 : START_TEST(test_mmp_get_item_line2)
     163                 : {
     164               1 :         MinSectionParser*      msp = mmp_create(512);
     165               1 :         MinItemParser*         mip = INITPTR;
     166                 : 
     167               1 :         mip = mmp_get_item_line( msp
     168                 :                                , INITPTR
     169                 :                                , ESNoTag );
     170                 : 
     171               1 :         fail_unless( mip == INITPTR
     172                 :                    , "mip != INITPTR" );
     173                 : 
     174               1 :         mmp_destroy(&msp);
     175                 : }
     176               1 : END_TEST
     177                 : /* ------------------------------------------------------------------------- */
     178               1 : START_TEST(test_mmp_get_item_line3)
     179                 : {
     180               1 :         MinSectionParser*      msp = mmp_create(512);
     181               1 :         MinItemParser*         mip = INITPTR;
     182               1 :         const char*             tmp = "CreateTestReport= YES                 \n\
     183                 :                                        TestReportFilePath= /home/maemo       \n\
     184                 :                                        TestReportFileName= TestReport        \n\
     185                 :                                        TestReportFormat= TXT                 \n\
     186                 :                                        TestReportOutput= FILE                \n\
     187                 :                                        TestReportFileCreationMode= OVERWRITE \n";
     188                 : 
     189               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
     190                 : 
     191               1 :         mip = mmp_get_item_line( msp
     192                 :                                , "CreateTestReport"
     193                 :                                , ESNoTag );
     194                 : 
     195               1 :         fail_unless( mip != INITPTR
     196                 :                    , "mip == INITPTR" );
     197                 : 
     198               1 :         mmp_destroy(&msp);
     199                 : }
     200               1 : END_TEST
     201                 : /* ------------------------------------------------------------------------- */
     202               1 : START_TEST(test_mmp_get_item_line4)
     203                 : {
     204               1 :         MinSectionParser*      msp = mmp_create(512);
     205               1 :         MinItemParser*         mip = INITPTR;
     206               1 :         const char*             tmp = "CreateTestReport= YES                 \n\
     207                 :                                        TestReportFilePath= /home/maemo       \n\
     208                 :                                        TestReportFileName= TestReport        \n\
     209                 :                                        TestReportFormat= TXT                 \n\
     210                 :                                        TestReportOutput= FILE                \n\
     211                 :                                        TestReportFileCreationMode= OVERWRITE \n";
     212                 : 
     213               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
     214                 : 
     215               1 :         mip = mmp_get_item_line( msp
     216                 :                                , "CreateTestReport"
     217                 :                                , ESNoTag );
     218                 : 
     219               1 :         fail_unless( mip->item_line_section_ != INITPTR
     220                 :                    , "mip->item_line_section_ == INITPTR" );
     221                 : 
     222               1 :         mmp_destroy(&msp);
     223                 : }
     224               1 : END_TEST
     225                 : /* ------------------------------------------------------------------------- */
     226               1 : START_TEST(test_mmp_get_item_line5)
     227                 : {
     228               1 :         MinSectionParser*      msp = mmp_create(512);
     229               1 :         MinItemParser*         mip = INITPTR;
     230               1 :         const char*             tmp = "CreateTestReport= YES                 \n\
     231                 :                                        TestReportFilePath= /home/maemo       \n\
     232                 :                                        TestReportFileName= TestReport        \n\
     233                 :                                        TestReportFormat= TXT                 \n\
     234                 :                                        TestReportOutput= FILE                \n\
     235                 :                                        TestReportFileCreationMode= OVERWRITE \n";
     236                 : 
     237               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
     238                 : 
     239               1 :         mip = mmp_get_item_line( msp
     240                 :                                , "CreateTestReport"
     241                 :                                , ESNoTag );
     242                 : 
     243               1 :         fail_unless( strcmp(mip->item_line_section_,"= YES") == 0
     244                 :                    , "Result differs from expected [%s]"
     245                 :                    , mip->item_line_section_ );
     246                 : 
     247               1 :         mmp_destroy(&msp);
     248                 : }
     249               1 : END_TEST
     250                 : /* ------------------------------------------------------------------------- */
     251               1 : START_TEST(test_mmp_get_item_line6)
     252                 : {
     253               1 :         MinSectionParser*      msp = mmp_create(512);
     254               1 :         MinItemParser*         mip = INITPTR;
     255               1 :         const char*             tmp = "CreateTestReport= YES                 \n\
     256                 :                                        TestReportFilePath= /home/maemo       \n\
     257                 :                                        TestReportFileName= TestReport        \n\
     258                 :                                        TestReportFormat= TXT                 \n\
     259                 :                                        TestReportOutput= FILE                \n\
     260                 :                                        TestReportFileCreationMode= OVERWRITE \n";
     261                 : 
     262               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
     263                 : 
     264               1 :         mip = mmp_get_item_line( msp
     265                 :                                , "CreateTestReport"
     266                 :                                , ESTag );
     267                 : 
     268               1 :         fail_unless( strcmp(mip->item_line_section_,"CreateTestReport= YES") == 0
     269                 :                    , "Result differs from expected [%s]"
     270                 :                    , mip->item_line_section_ );
     271                 : 
     272               1 :         mmp_destroy(&msp);
     273                 : }
     274               1 : END_TEST
     275                 : /* ------------------------------------------------------------------------- */
     276               1 : START_TEST(test_mmp_get_item_line7)
     277                 : {
     278               1 :         MinSectionParser*      msp = mmp_create(512);
     279               1 :         MinItemParser*         mip = INITPTR;
     280               1 :         const char*             tmp = "CreateTestReport= YES                 \n\
     281                 :                                        TestReportFilePath= /home/maemo       \n\
     282                 :                                        TestReportFileName= TestReport        \n\
     283                 :                                        TestReportFormat= TXT                 \n\
     284                 :                                        TestReportOutput= FILE                \n\
     285                 :                                        TestReportFileCreationMode= OVERWRITE \n";
     286                 : 
     287               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
     288                 : 
     289               1 :         mip = mmp_get_item_line( msp
     290                 :                                , "CreateTestReport"
     291                 :                                , ESTag );
     292                 : 
     293               1 :         fail_unless( msp->line_indicator_ == ESTrue
     294                 :                    , "mip->line_indicator_ != ESTrue" );
     295                 : 
     296               1 :         mmp_destroy(&msp);
     297                 : }
     298               1 : END_TEST
     299                 : /* ------------------------------------------------------------------------- */
     300               1 : START_TEST(test_mmp_get_item_line8)
     301                 : {
     302               1 :         MinSectionParser*      msp = mmp_create(512);
     303               1 :         MinItemParser*         mip = INITPTR;
     304               1 :         const char*             tmp = "CreateTestReport= YES\n\
     305                 :                                        TestReportFilePath= /home/maemo\n\
     306                 :                                        TestReportFileName= TestReport\n\
     307                 :                                        TestReportFormat= TXT\n\
     308                 :                                        TestReportOutput= FILE\n\
     309                 :                                        TestReportFileCreationMode= OVERWRITE\n";
     310                 : 
     311               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
     312                 : 
     313               1 :         mip = mmp_get_item_line( msp
     314                 :                                , ""
     315                 :                                , ESTag );
     316                 : 
     317               1 :         fail_unless( strcmp(mip->item_line_section_,"CreateTestReport= YES") == 0
     318                 :                    , "Result differs from expected [%s]"
     319                 :                    , mip->item_line_section_ );
     320                 : 
     321               1 :         mmp_destroy(&msp);
     322                 : }
     323               1 : END_TEST
     324                 : /* ------------------------------------------------------------------------- */
     325               1 : START_TEST(test_mmp_get_next_item_line)
     326                 : {
     327               1 :         MinSectionParser*      msp = INITPTR;
     328               1 :         MinItemParser*         mip = INITPTR;
     329                 : 
     330               1 :         mip = mmp_get_next_item_line( msp );
     331                 : 
     332               1 :         fail_unless( mip == INITPTR
     333                 :                    , "mip != INITPTR" );
     334                 : }
     335               1 : END_TEST
     336                 : /* ------------------------------------------------------------------------- */
     337               1 : START_TEST(test_mmp_get_next_item_line2)
     338                 : {
     339               1 :         MinSectionParser*      msp = mmp_create(512);
     340               1 :         MinItemParser*         mip = INITPTR;
     341               1 :         const char*             tmp = "CreateTestReport= YES                 \n\
     342                 :                                        TestReportFilePath= /home/maemo       \n\
     343                 :                                        TestReportFileName= TestReport        \n\
     344                 :                                        TestReportFormat= TXT                 \n\
     345                 :                                        TestReportOutput= FILE                \n\
     346                 :                                        TestReportFileCreationMode= OVERWRITE \n";
     347                 : 
     348               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
     349                 : 
     350               1 :         mip = mmp_get_next_item_line( msp );
     351                 : 
     352               1 :         fail_unless( mip == INITPTR
     353                 :                    , "mip == INITPTR" );
     354                 : 
     355               1 :         mmp_destroy(&msp);
     356                 : }
     357               1 : END_TEST
     358                 : /* ------------------------------------------------------------------------- */
     359               1 : START_TEST(test_mmp_get_next_item_line3)
     360                 : {
     361               1 :         MinSectionParser*      msp = mmp_create(512);
     362               1 :         MinItemParser*         mip = INITPTR;
     363               1 :         const char*             tmp = "CreateTestReport= YES                 \n\
     364                 :                                        TestReportFilePath= /home/maemo       \n\
     365                 :                                        TestReportFileName= TestReport        \n\
     366                 :                                        TestReportFormat= TXT                 \n\
     367                 :                                        TestReportOutput= FILE                \n\
     368                 :                                        TestReportFileCreationMode= OVERWRITE \n";
     369                 : 
     370               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
     371                 : 
     372               1 :         mip = mmp_get_item_line( msp
     373                 :                                , "CreateTestReport"
     374                 :                                , ESNoTag );
     375                 : 
     376               1 :         mip = mmp_get_next_item_line( msp );
     377                 : 
     378               1 :         fail_unless( mip != INITPTR
     379                 :                    , "mip == INITPTR" );
     380                 : 
     381               1 :         mmp_destroy(&msp);
     382                 : }
     383               1 : END_TEST
     384                 : /* ------------------------------------------------------------------------- */
     385               1 : START_TEST(test_mmp_get_next_item_line4)
     386                 : {
     387               1 :         MinSectionParser*      msp = mmp_create(512);
     388               1 :         MinItemParser*         mip = INITPTR;
     389               1 :         const char*             tmp = "CreateTestReport= YES                 \n\
     390                 :                                        TestReportFilePath= /home/maemo       \n\
     391                 :                                        TestReportFileName= TestReport        \n\
     392                 :                                        TestReportFormat= TXT                 \n\
     393                 :                                        TestReportOutput= FILE                \n\
     394                 :                                        TestReportFileCreationMode= OVERWRITE \n";
     395                 : 
     396               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
     397                 : 
     398               1 :         mip = mmp_get_item_line( msp
     399                 :                                , "CreateTestReport"
     400                 :                                , ESNoTag );
     401                 : 
     402               1 :         mip = mmp_get_next_item_line( msp );
     403                 : 
     404               1 :         fail_unless( mip->item_line_section_ != INITPTR
     405                 :                    , "mip->item_line_section_ == INITPTR" );
     406               1 :         mmp_destroy(&msp);
     407                 : }
     408               1 : END_TEST
     409                 : /* ------------------------------------------------------------------------- */
     410               1 : START_TEST(test_mmp_get_next_item_line5)
     411                 : {
     412               1 :         MinSectionParser*      msp = mmp_create(512);
     413               1 :         MinItemParser*         mip = INITPTR;
     414               1 :         const char*             tmp = "CreateTestReport= YES                 \n\
     415                 :                                        TestReportFilePath= /home/maemo       \n\
     416                 :                                        TestReportFileName= TestReport        \n\
     417                 :                                        TestReportFormat= TXT                 \n\
     418                 :                                        TestReportOutput= FILE                \n\
     419                 :                                        TestReportFileCreationMode= OVERWRITE \n";
     420                 : 
     421               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
     422                 : 
     423               1 :         mip = mmp_get_item_line( msp
     424                 :                                , "CreateTestReport"
     425                 :                                , ESNoTag );
     426                 : 
     427               1 :         mip = mmp_get_next_item_line( msp );
     428                 : 
     429               1 :         fail_unless( strcmp(mip->item_line_section_,"TestReportFilePath= /home/maemo") == 0
     430                 :                    , "Result differs from expected [%s]"
     431                 :                    , mip->item_line_section_ );
     432               1 :         mmp_destroy(&msp);
     433                 : }
     434               1 : END_TEST
     435                 : /* ------------------------------------------------------------------------- */
     436               1 : START_TEST(test_mmp_get_next_item_line6)
     437                 : {
     438               1 :         MinSectionParser*      msp = mmp_create(512);
     439               1 :         MinItemParser*         mip = INITPTR;
     440               1 :         const char*             tmp = "CreateTestReport= YES                 \n\
     441                 :                                        TestReportFilePath= /home/maemo       \n\
     442                 :                                        TestReportFileName= TestReport        \n\
     443                 :                                        TestReportFormat= TXT                 \n\
     444                 :                                        TestReportOutput= FILE                \n\
     445                 :                                        TestReportFileCreationMode= OVERWRITE \n";
     446                 : 
     447               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
     448                 : 
     449               1 :         mip = mmp_get_item_line( msp
     450                 :                                , "CreateTestReport"
     451                 :                                , ESNoTag );
     452                 : 
     453               1 :         mip = mmp_get_next_item_line( msp );
     454               1 :         mip = mmp_get_next_item_line( msp );
     455                 : 
     456               1 :         fail_unless( strcmp( mip->item_line_section_,"TestReportFileName= TestReport") == 0
     457                 :                    , "Result differs from expected [%s]"
     458                 :                    , mip->item_line_section_ );
     459               1 :         mmp_destroy(&msp);
     460                 : }
     461               1 : END_TEST
     462                 : /* ------------------------------------------------------------------------- */
     463               1 : START_TEST(test_mmp_get_next_item_line7)
     464                 : {
     465               1 :         MinSectionParser*      msp = mmp_create(512);
     466               1 :         MinItemParser*         mip = INITPTR;
     467               1 :         const char*             tmp = "CreateTestReport= YES\n\
     468                 :                                        TestReportFilePath= /home/maemo\n\
     469                 :                                        TestReportFileName= TestReport\n\
     470                 :                                        TestReportFormat= TXT\n\
     471                 :                                        TestReportOutput= FILE\n\
     472                 :                                        TestReportFileCreationMode= OVERWRITE\n";
     473                 : 
     474               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
     475                 : 
     476               1 :         mip = mmp_get_item_line( msp
     477                 :                                , "CreateTestReport"
     478                 :                                , ESNoTag );
     479                 : 
     480               1 :         mip = mmp_get_next_item_line( msp );
     481               1 :         mip = mmp_get_next_item_line( msp );
     482                 : 
     483               1 :         fail_unless( strcmp( mip->item_line_section_,"TestReportFileName= TestReport") == 0
     484                 :                    , "Result differs from expected [%s]"
     485                 :                    , mip->item_line_section_ );
     486               1 :         mmp_destroy(&msp);
     487                 : }
     488               1 : END_TEST
     489                 : /* ------------------------------------------------------------------------- */
     490               1 : START_TEST(test_mmp_get_next_item_line8)
     491                 : {
     492               1 :         MinSectionParser*      msp = mmp_create(512);
     493               1 :         MinItemParser*         mip = INITPTR;
     494               1 :         const char*             tmp = "CreateTestReport= YES\n\
     495                 :                                        TestReportFilePath= /home/maemo\n\
     496                 :                                        TestReportFileName= TestReport\n\
     497                 :                                        TestReportFormat= TXT\n\
     498                 :                                        TestReportOutput= FILE\n\
     499                 :                                        TestReportFileCreationMode= OVERWRITE\n";
     500                 : 
     501               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
     502                 : 
     503               1 :         mip = mmp_get_item_line( msp
     504                 :                                , ""
     505                 :                                , ESNoTag );
     506                 : 
     507               1 :         mip = mmp_get_next_item_line( msp );
     508               1 :         mip = mmp_get_next_item_line( msp );
     509                 : 
     510               1 :         fail_unless( strcmp( mip->item_line_section_,"TestReportFileName= TestReport") == 0
     511                 :                    , "Result differs from expected [%s]"
     512                 :                    , mip->item_line_section_ );
     513               1 :         mmp_destroy(&msp);
     514                 : }
     515               1 : END_TEST
     516                 : /* ------------------------------------------------------------------------- */
     517               1 : START_TEST(test_mmp_get_next_tagged_item_line)
     518                 : {
     519               1 :         MinSectionParser*      msp = INITPTR;
     520               1 :         MinItemParser*         mip = INITPTR;
     521                 : 
     522               1 :         mip = mmp_get_next_tagged_item_line( msp
     523                 :                                            , "Tag"
     524                 :                                            , ESNoTag );
     525                 : 
     526               1 :         fail_unless( mip == INITPTR
     527                 :                    , "mip != INITPTR" );
     528                 : }
     529               1 : END_TEST
     530                 : /* ------------------------------------------------------------------------- */
     531               1 : START_TEST(test_mmp_get_next_tagged_item_line2)
     532                 : {
     533               1 :         MinSectionParser*      msp = mmp_create(512);
     534               1 :         MinItemParser*         mip = INITPTR;
     535                 : 
     536               1 :         mip = mmp_get_next_tagged_item_line( msp
     537                 :                                            , INITPTR
     538                 :                                            , ESNoTag );
     539                 : 
     540               1 :         fail_unless( mip == INITPTR
     541                 :                    , "mip != INITPTR" );
     542                 : 
     543               1 :         mmp_destroy(&msp);
     544                 : }
     545               1 : END_TEST
     546                 : /* ------------------------------------------------------------------------- */
     547               1 : START_TEST(test_mmp_get_next_tagged_item_line3)
     548                 : {
     549               1 :         MinSectionParser*      msp = mmp_create(512);
     550               1 :         MinItemParser*         mip = INITPTR;
     551               1 :         const char*             tmp = "CreateTestReport= YES                 \n\
     552                 :                                        TestReportFilePath= /home/maemo       \n\
     553                 :                                        TestReportFileName= TestReport        \n\
     554                 :                                        TestReportFormat= TXT                 \n\
     555                 :                                        TestReportOutput= FILE                \n\
     556                 :                                        TestReportFileCreationMode= OVERWRITE \n";
     557                 : 
     558               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
     559                 : 
     560               1 :         mip = mmp_get_next_tagged_item_line( msp
     561                 :                                            , "CreateTestReport"
     562                 :                                            , ESNoTag );
     563                 : 
     564               1 :         fail_unless( mip == INITPTR
     565                 :                    , "mip != INITPTR" );
     566                 : 
     567               1 :         mmp_destroy(&msp);
     568                 : }
     569               1 : END_TEST
     570                 : /* ------------------------------------------------------------------------- */
     571               1 : START_TEST(test_mmp_get_next_tagged_item_line4)
     572                 : {
     573               1 :         MinSectionParser*      msp = mmp_create(512);
     574               1 :         MinItemParser*         mip = INITPTR;
     575               1 :         const char*             tmp = "CreateTestReport= YES                 \n\
     576                 :                                        TestReportFilePath= /home/maemo       \n\
     577                 :                                        TestReportFileName= TestReport        \n\
     578                 :                                        TestReportFormat= TXT                 \n\
     579                 :                                        TestReportOutput= FILE                \n\
     580                 :                                        TestReportFileCreationMode= OVERWRITE \n";
     581                 : 
     582               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
     583                 : 
     584               1 :         mip = mmp_get_item_line( msp
     585                 :                                , "CreateTestReport"
     586                 :                                , ESNoTag );
     587               1 :         mip = mmp_get_next_tagged_item_line( msp
     588                 :                                            , "TestReportFormat"
     589                 :                                            , ESNoTag );
     590                 : 
     591               1 :         fail_unless( mip != INITPTR
     592                 :                    , "mip == INITPTR" );
     593                 : 
     594               1 :         mmp_destroy(&msp);
     595                 : }
     596               1 : END_TEST
     597                 : /* ------------------------------------------------------------------------- */
     598               1 : START_TEST(test_mmp_get_next_tagged_item_line5)
     599                 : {
     600               1 :         MinSectionParser*      msp = mmp_create(512);
     601               1 :         MinItemParser*         mip = INITPTR;
     602               1 :         const char*             tmp = "CreateTestReport= YES                 \n\
     603                 :                                        TestReportFilePath= /home/maemo       \n\
     604                 :                                        TestReportFileName= TestReport        \n\
     605                 :                                        TestReportFormat= TXT                 \n\
     606                 :                                        TestReportOutput= FILE                \n\
     607                 :                                        TestReportFileCreationMode= OVERWRITE \n";
     608                 : 
     609               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
     610                 : 
     611               1 :         mip = mmp_get_item_line( msp
     612                 :                                , "CreateTestReport"
     613                 :                                , ESNoTag );
     614               1 :         mip = mmp_get_next_tagged_item_line( msp
     615                 :                                            , "TestReportFormat"
     616                 :                                            , ESNoTag );
     617                 : 
     618               1 :         fail_unless( strcmp( mip->item_line_section_,"= TXT") == 0
     619                 :                    , "Result differs from expected [%s]"
     620                 :                    , mip->item_line_section_ );
     621                 : 
     622               1 :         mmp_destroy(&msp);
     623                 : }
     624               1 : END_TEST
     625                 : /* ------------------------------------------------------------------------- */
     626               1 : START_TEST(test_mmp_get_next_tagged_item_line6)
     627                 : {
     628               1 :         MinSectionParser*      msp = mmp_create(512);
     629               1 :         MinItemParser*         mip = INITPTR;
     630               1 :         const char*             tmp = "CreateTestReport= YES                 \n\
     631                 :                                        TestReportFilePath= /home/maemo       \n\
     632                 :                                        TestReportFileName= TestReport        \n\
     633                 :                                        TestReportFormat= TXT                 \n\
     634                 :                                        TestReportOutput= FILE                \n\
     635                 :                                        TestReportFileCreationMode= OVERWRITE \n";
     636                 : 
     637               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
     638                 : 
     639               1 :         mip = mmp_get_item_line( msp
     640                 :                                , "CreateTestReport"
     641                 :                                , ESNoTag );
     642               1 :         mip = mmp_get_next_tagged_item_line( msp
     643                 :                                            , "TestReportFormat"
     644                 :                                            , ESTag );
     645                 : 
     646               1 :         fail_unless( strcmp( mip->item_line_section_,"TestReportFormat= TXT") == 0
     647                 :                    , "Result differs from expected [%s]"
     648                 :                    , mip->item_line_section_ );
     649                 : 
     650               1 :         mmp_destroy(&msp);
     651                 : }
     652               1 : END_TEST
     653                 : /* ------------------------------------------------------------------------- */
     654               1 : START_TEST(test_mmp_sub_section)
     655                 : {
     656               1 :         MinSectionParser* msp       = INITPTR;
     657               1 :         MinSectionParser* retval    = INITPTR;
     658               1 :         retval = mmp_sub_section( msp, "stag", "etag", 0 );
     659               1 :         fail_unless( retval == INITPTR
     660                 :                    , "Retval != INITPTR" );
     661                 : }
     662               1 : END_TEST
     663                 : /* ------------------------------------------------------------------------- */
     664               1 : START_TEST(test_mmp_sub_section2)
     665                 : {
     666               1 :         MinSectionParser* msp       = mmp_create(512);
     667               1 :         MinSectionParser* retval    = INITPTR;
     668               1 :         retval = mmp_sub_section( msp, INITPTR, "etag", 0 );
     669               1 :         fail_unless( retval == INITPTR
     670                 :                    , "Retval != INITPTR" );
     671               1 :         mmp_destroy(&msp);
     672                 : }
     673               1 : END_TEST
     674                 : /* ------------------------------------------------------------------------- */
     675               1 : START_TEST(test_mmp_sub_section3)
     676                 : {
     677               1 :         MinSectionParser* msp       = mmp_create(512);
     678               1 :         MinSectionParser* retval    = INITPTR;
     679               1 :         retval = mmp_sub_section( msp, "stag", INITPTR, 0 );
     680               1 :         fail_unless( retval == INITPTR
     681                 :                    , "Retval != INITPTR" );
     682               1 :         mmp_destroy(&msp);
     683                 : }
     684               1 : END_TEST
     685                 : /* ------------------------------------------------------------------------- */
     686               1 : START_TEST(test_mmp_sub_section4)
     687                 : {
     688               1 :         MinSectionParser* msp       = mmp_create(512);
     689               1 :         MinSectionParser* retval    = INITPTR;
     690               1 :         retval = mmp_sub_section( msp, "stag", "etag", -1 );
     691               1 :         fail_unless( retval == INITPTR
     692                 :                    , "Retval != INITPTR" );
     693               1 :         mmp_destroy(&msp);
     694                 : }
     695               1 : END_TEST
     696                 : /* ------------------------------------------------------------------------- */
     697               1 : START_TEST(test_mmp_sub_section5)
     698                 : {
     699               1 :         MinSectionParser* msp       = mmp_create(2048);
     700               1 :         MinSectionParser* retval    = INITPTR;
     701               1 :         const char*        tmp       = "[TagOne]                              \n\
     702                 :                                         CreateTestReport= YES                 \n\
     703                 :                                         [EndTagOne]                           \n\
     704                 :                                         [TagOne]                              \n\
     705                 :                                         TestReportFilePath= /home/maemo       \n\
     706                 :                                         [EndTagOne]                           \n\
     707                 :                                         [TagOne]                              \n\
     708                 :                                         TestReportFileName= TestReport        \n\
     709                 :                                         [EndTagOne]                           \n\
     710                 :                                         [TagOne]                              \n\
     711                 :                                         TestReportFormat= TXT                 \n\
     712                 :                                         [EndTagOne]                           \n\
     713                 :                                         [TagOne]                              \n\
     714                 :                                         TestReportOutput= FILE                \n\
     715                 :                                         [EndTagOne]                           \n\
     716                 :                                         [TagOne]                              \n\
     717                 :                                         TestReportFileCreationMode= OVERWRITE \n\
     718                 :                                         [EndTagOne]                           \n";
     719                 : 
     720               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
     721                 : 
     722               1 :         retval = mmp_sub_section( msp, "[TagOne]", "[EndTagOne]", 1 );
     723               1 :         fail_unless( retval != INITPTR
     724                 :                    , "Retval == INITPTR" );
     725               1 :         mmp_destroy(&retval);
     726               1 :         mmp_destroy(&msp);
     727                 : }
     728               1 : END_TEST
     729                 : /* ------------------------------------------------------------------------- */
     730               1 : START_TEST(test_mmp_sub_section6)
     731                 : {
     732               1 :         MinSectionParser* msp       = mmp_create(2048);
     733               1 :         MinSectionParser* retval    = INITPTR;
     734               1 :         const char*        tmp       = "[TagOne]                              \n\
     735                 :                                         CreateTestReport= YES                 \n\
     736                 :                                         [EndTagOne]                           \n\
     737                 :                                         [TagOne]                              \n\
     738                 :                                         TestReportFilePath= /home/maemo       \n\
     739                 :                                         [EndTagOne]                           \n\
     740                 :                                         [TagOne]                              \n\
     741                 :                                         TestReportFileName= TestReport        \n\
     742                 :                                         [EndTagOne]                           \n\
     743                 :                                         [TagOne]                              \n\
     744                 :                                         TestReportFormat= TXT                 \n\
     745                 :                                         [EndTagOne]                           \n\
     746                 :                                         [TagOne]                              \n\
     747                 :                                         TestReportOutput= FILE                \n\
     748                 :                                         [EndTagOne]                           \n\
     749                 :                                         [TagOne]                              \n\
     750                 :                                         TestReportFileCreationMode= OVERWRITE \n\
     751                 :                                         [EndTagOne]                           \n";
     752                 : 
     753               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
     754                 : 
     755               1 :         retval = mmp_sub_section( msp, "[TagOne]", "[EndTagOne]", 1 );
     756               1 :         fail_unless( strcmp(retval->section_,"CreateTestReport= YES") == 0
     757                 :                    , "Result differs from expected [%s]"
     758                 :                    , retval->section_ );
     759               1 :         mmp_destroy(&retval);
     760               1 :         mmp_destroy(&msp);
     761                 : }
     762               1 : END_TEST
     763                 : /* ------------------------------------------------------------------------- */
     764               1 : START_TEST(test_mmp_next_sub_section)
     765                 : {
     766               1 :         MinSectionParser* msp       = INITPTR;
     767               1 :         MinSectionParser* retval    = INITPTR;
     768               1 :         retval = mmp_next_sub_section( msp, "stag", "etag", 0 );
     769               1 :         fail_unless( retval == INITPTR
     770                 :                    , "Retval != INITPTR" );
     771                 : }
     772               1 : END_TEST
     773                 : /* ------------------------------------------------------------------------- */
     774               1 : START_TEST(test_mmp_next_sub_section2)
     775                 : {
     776               1 :         MinSectionParser* msp       = mmp_create(512);
     777               1 :         MinSectionParser* retval    = INITPTR;
     778               1 :         retval = mmp_next_sub_section( msp, INITPTR, "etag", 0 );
     779               1 :         fail_unless( retval == INITPTR
     780                 :                    , "Retval != INITPTR" );
     781               1 :         mmp_destroy(&msp);
     782                 : }
     783               1 : END_TEST
     784                 : /* ------------------------------------------------------------------------- */
     785               1 : START_TEST(test_mmp_next_sub_section3)
     786                 : {
     787               1 :         MinSectionParser* msp       = mmp_create(512);
     788               1 :         MinSectionParser* retval    = INITPTR;
     789               1 :         retval = mmp_next_sub_section( msp, "stag", INITPTR, 0 );
     790               1 :         fail_unless( retval == INITPTR
     791                 :                    , "Retval != INITPTR" );
     792               1 :         mmp_destroy(&msp);
     793                 : }
     794               1 : END_TEST
     795                 : /* ------------------------------------------------------------------------- */
     796               1 : START_TEST(test_mmp_next_sub_section4)
     797                 : {
     798               1 :         MinSectionParser* msp       = mmp_create(512);
     799               1 :         MinSectionParser* retval    = INITPTR;
     800               1 :         retval = mmp_next_sub_section( msp, "stag", "etag", -1 );
     801               1 :         fail_unless( retval == INITPTR
     802                 :                    , "Retval != INITPTR" );
     803               1 :         mmp_destroy(&msp);
     804                 : }
     805               1 : END_TEST
     806                 : /* ------------------------------------------------------------------------- */
     807               1 : START_TEST(test_mmp_next_sub_section5)
     808                 : {
     809               1 :         MinSectionParser* msp       = mmp_create(2048);
     810               1 :         MinSectionParser* retval    = INITPTR;
     811               1 :         const char*        tmp       = "[TagOne]                              \n\
     812                 :                                         CreateTestReport= YES                 \n\
     813                 :                                         [EndTagOne]                           \n\
     814                 :                                         [TagOne]                              \n\
     815                 :                                         TestReportFilePath= /home/maemo       \n\
     816                 :                                         [EndTagOne]                           \n\
     817                 :                                         [TagOne]                              \n\
     818                 :                                         TestReportFileName= TestReport        \n\
     819                 :                                         [EndTagOne]                           \n\
     820                 :                                         [TagOne]                              \n\
     821                 :                                         TestReportFormat= TXT                 \n\
     822                 :                                         [EndTagOne]                           \n\
     823                 :                                         [TagOne]                              \n\
     824                 :                                         TestReportOutput= FILE                \n\
     825                 :                                         [EndTagOne]                           \n\
     826                 :                                         [TagOne]                              \n\
     827                 :                                         TestReportFileCreationMode= OVERWRITE \n\
     828                 :                                         [EndTagOne]                           \n";
     829                 : 
     830               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
     831                 : 
     832               1 :         retval = mmp_next_sub_section( msp, "", "", 1 );
     833               1 :         fail_unless( retval != INITPTR
     834                 :                    , "Retval == INITPTR" );
     835               1 :         mmp_destroy(&retval);
     836               1 :         mmp_destroy(&msp);
     837                 : }
     838               1 : END_TEST
     839                 : /* ------------------------------------------------------------------------- */
     840               1 : START_TEST(test_mmp_next_sub_section6)
     841                 : {
     842               1 :         MinSectionParser* msp       = mmp_create(2048);
     843               1 :         MinSectionParser* retval    = INITPTR;
     844               1 :         const char*        tmp       = "[TagOne]                              \n\
     845                 :                                         CreateTestReport= YES                 \n\
     846                 :                                         [EndTagOne]                           \n\
     847                 :                                         [TagOne]                              \n\
     848                 :                                         TestReportFilePath= /home/maemo       \n\
     849                 :                                         [EndTagOne]                           \n\
     850                 :                                         [TagOne]                              \n\
     851                 :                                         TestReportFileName= TestReport        \n\
     852                 :                                         [EndTagOne]                           \n\
     853                 :                                         [TagOne]                              \n\
     854                 :                                         TestReportFormat= TXT                 \n\
     855                 :                                         [EndTagOne]                           \n\
     856                 :                                         [TagOne]                              \n\
     857                 :                                         TestReportOutput= FILE                \n\
     858                 :                                         [EndTagOne]                           \n\
     859                 :                                         [TagOne]                              \n\
     860                 :                                         TestReportFileCreationMode= OVERWRITE \n\
     861                 :                                         [EndTagOne]                           \n";
     862               1 :         const char*        exp       = "[TagOne]                              \n\
     863                 :                                         CreateTestReport= YES                 \n\
     864                 :                                         [EndTagOne]                           \n\
     865                 :                                         [TagOne]                              \n\
     866                 :                                         TestReportFilePath= /home/maemo       \n\
     867                 :                                         [EndTagOne]                           \n\
     868                 :                                         [TagOne]                              \n\
     869                 :                                         TestReportFileName= TestReport        \n\
     870                 :                                         [EndTagOne]                           \n\
     871                 :                                         [TagOne]                              \n\
     872                 :                                         TestReportFormat= TXT                 \n\
     873                 :                                         [EndTagOne]                           \n\
     874                 :                                         [TagOne]                              \n\
     875                 :                                         TestReportOutput= FILE                \n\
     876                 :                                         [EndTagOne]                           \n\
     877                 :                                         [TagOne]                              \n\
     878                 :                                         TestReportFileCreationMode= OVERWRITE \n\
     879                 :                                         [EndTagOne]";
     880                 : 
     881               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
     882                 : 
     883               1 :         retval = mmp_next_sub_section( msp, "", "", 1 );
     884               1 :         fail_unless( strcmp(retval->section_,exp) == 0
     885                 :                    , "Recieved result differs from expected [%s]"
     886                 :                    , retval->section_ );
     887               1 :         mmp_destroy(&retval);
     888               1 :         mmp_destroy(&msp);
     889                 : }
     890               1 : END_TEST
     891                 : /* ------------------------------------------------------------------------- */
     892               1 : START_TEST(test_mmp_next_sub_section7)
     893                 : {
     894               1 :         MinSectionParser* msp       = mmp_create(2048);
     895               1 :         MinSectionParser* retval    = INITPTR;
     896               1 :         const char*        tmp       = "[TagOne]                              \n\
     897                 :                                         CreateTestReport= YES                 \n\
     898                 :                                         [EndTagOne]                           \n\
     899                 :                                         [TagOne]                              \n\
     900                 :                                         TestReportFilePath= /home/maemo       \n\
     901                 :                                         [EndTagOne]                           \n\
     902                 :                                         [TagOne]                              \n\
     903                 :                                         TestReportFileName= TestReport        \n\
     904                 :                                         [EndTagOne]                           \n\
     905                 :                                         [TagOne]                              \n\
     906                 :                                         TestReportFormat= TXT                 \n\
     907                 :                                         [EndTagOne]                           \n\
     908                 :                                         [TagOne]                              \n\
     909                 :                                         TestReportOutput= FILE                \n\
     910                 :                                         [EndTagOne]                           \n\
     911                 :                                         [TagOne]                              \n\
     912                 :                                         TestReportFileCreationMode= OVERWRITE \n\
     913                 :                                         [EndTagOne]                           \n";
     914                 : 
     915               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
     916                 : 
     917               1 :         retval = mmp_next_sub_section( msp, "", "", 2 );
     918               1 :         fail_unless( retval == INITPTR
     919                 :                    , "Retval != INITPTR" );
     920               1 :         mmp_destroy(&msp);
     921                 : }
     922               1 : END_TEST
     923                 : /* ------------------------------------------------------------------------- */
     924               1 : START_TEST(test_mmp_next_sub_section8)
     925                 : {
     926               1 :         MinSectionParser* msp       = mmp_create(2048);
     927               1 :         MinSectionParser* retval    = INITPTR;
     928               1 :         const char*        tmp       = "[TagOne]                              \n\
     929                 :                                         CreateTestReport= YES                 \n\
     930                 :                                         [EndTagOne]                           \n\
     931                 :                                         [TagOne]                              \n\
     932                 :                                         TestReportFilePath= /home/maemo       \n\
     933                 :                                         [EndTagOne]                           \n\
     934                 :                                         [TagOne]                              \n\
     935                 :                                         TestReportFileName= TestReport        \n\
     936                 :                                         [EndTagOne]                           \n\
     937                 :                                         [TagOne]                              \n\
     938                 :                                         TestReportFormat= TXT                 \n\
     939                 :                                         [EndTagOne]                           \n\
     940                 :                                         [TagOne]                              \n\
     941                 :                                         TestReportOutput= FILE                \n\
     942                 :                                         [EndTagOne]                           \n\
     943                 :                                         [TagOne]                              \n\
     944                 :                                         TestReportFileCreationMode= OVERWRITE \n\
     945                 :                                         [EndTagOne]                           \n";
     946                 : 
     947               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
     948                 : 
     949               1 :         retval = mmp_next_sub_section( msp, "[TagOne]", "[EndTagOne]", 1 );
     950               1 :         fail_unless( retval != INITPTR
     951                 :                    , "Retval == INITPTR" );
     952               1 :         mmp_destroy(&retval);
     953               1 :         mmp_destroy(&msp);
     954                 : }
     955               1 : END_TEST
     956                 : /* ------------------------------------------------------------------------- */
     957               1 : START_TEST(test_mmp_next_sub_section9)
     958                 : {
     959               1 :         MinSectionParser* msp       = mmp_create(2048);
     960               1 :         MinSectionParser* retval    = INITPTR;
     961               1 :         const char*        tmp       = "[TagOne]                              \n\
     962                 :                                         CreateTestReport= YES                 \n\
     963                 :                                         [EndTagOne]                           \n\
     964                 :                                         [TagOne]                              \n\
     965                 :                                         TestReportFilePath= /home/maemo       \n\
     966                 :                                         [EndTagOne]                           \n\
     967                 :                                         [TagOne]                              \n\
     968                 :                                         TestReportFileName= TestReport        \n\
     969                 :                                         [EndTagOne]                           \n\
     970                 :                                         [TagOne]                              \n\
     971                 :                                         TestReportFormat= TXT                 \n\
     972                 :                                         [EndTagOne]                           \n\
     973                 :                                         [TagOne]                              \n\
     974                 :                                         TestReportOutput= FILE                \n\
     975                 :                                         [EndTagOne]                           \n\
     976                 :                                         [TagOne]                              \n\
     977                 :                                         TestReportFileCreationMode= OVERWRITE \n\
     978                 :                                         [EndTagOne]                           \n";
     979                 : 
     980               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
     981                 : 
     982               1 :         retval = mmp_next_sub_section( msp, "[TagOne]", "[EndTagOne]", 1 );
     983               1 :         fail_unless( strcmp(retval->section_,"CreateTestReport= YES") == 0
     984                 :                    , "Returned value does not match expected [%s]"
     985                 :                    , retval->section_ );
     986               1 :         mmp_destroy(&retval);
     987               1 :         mmp_destroy(&msp);
     988                 : }
     989               1 : END_TEST
     990                 : /* ------------------------------------------------------------------------- */
     991               1 : START_TEST(test_mmp_next_sub_section10)
     992                 : {
     993               1 :         MinSectionParser* msp       = mmp_create(2048);
     994               1 :         MinSectionParser* retval    = INITPTR;
     995               1 :         const char*        tmp       = "[TagOne]                              \n\
     996                 :                                         CreateTestReport= YES                 \n\
     997                 :                                         [EndTagOne]                           \n\
     998                 :                                         [TagOne]                              \n\
     999                 :                                         TestReportFilePath= /home/maemo       \n\
    1000                 :                                         [EndTagOne]                           \n\
    1001                 :                                         [TagOne]                              \n\
    1002                 :                                         TestReportFileName= TestReport        \n\
    1003                 :                                         [EndTagOne]                           \n\
    1004                 :                                         [TagOne]                              \n\
    1005                 :                                         TestReportFormat= TXT                 \n\
    1006                 :                                         [EndTagOne]                           \n\
    1007                 :                                         [TagOne]                              \n\
    1008                 :                                         TestReportOutput= FILE                \n\
    1009                 :                                         [EndTagOne]                           \n\
    1010                 :                                         [TagOne]                              \n\
    1011                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    1012                 :                                         [EndTagOne]                           \n";
    1013                 : 
    1014               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    1015                 : 
    1016               1 :         retval = mmp_next_sub_section( msp, "[TagOne]", "[EndTagOne]", 2 );
    1017               1 :         fail_unless( strcmp(retval->section_,"TestReportFilePath= /home/maemo") == 0
    1018                 :                    , "Returned value does not match expected [%s]"
    1019                 :                    , retval->section_ );
    1020               1 :         mmp_destroy(&retval);
    1021               1 :         mmp_destroy(&msp);
    1022                 : }
    1023               1 : END_TEST
    1024                 : /* ------------------------------------------------------------------------- */
    1025               1 : START_TEST(test_mmp_next_sub_section11)
    1026                 : {
    1027               1 :         MinSectionParser* msp       = mmp_create(2048);
    1028               1 :         MinSectionParser* retval    = INITPTR;
    1029               1 :         const char*        tmp       = "[TagOne]                              \n\
    1030                 :                                         CreateTestReport= YES                 \n\
    1031                 :                                         [EndTagOne]                           \n\
    1032                 :                                         [TagOne]                              \n\
    1033                 :                                         TestReportFilePath= /home/maemo       \n\
    1034                 :                                         [EndTagOne]                           \n\
    1035                 :                                         [TagOne]                              \n\
    1036                 :                                         TestReportFileName= TestReport        \n\
    1037                 :                                         [EndTagOne]                           \n\
    1038                 :                                         [TagOne]                              \n\
    1039                 :                                         TestReportFormat= TXT                 \n\
    1040                 :                                         [EndTagOne]                           \n\
    1041                 :                                         [TagOne]                              \n\
    1042                 :                                         TestReportOutput= FILE                \n\
    1043                 :                                         [EndTagOne]                           \n\
    1044                 :                                         [TagOne]                              \n\
    1045                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    1046                 :                                         [EndTagOne]                           \n";
    1047                 : 
    1048               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    1049                 : 
    1050               1 :         retval = mmp_next_sub_section( msp, "[TagOne]", "[EndTagOne]", 6 );
    1051               1 :         fail_unless( strcmp(retval->section_,"TestReportFileCreationMode= OVERWRITE") == 0
    1052                 :                    , "Returned value does not match expected [%s]"
    1053                 :                    , retval->section_ );
    1054               1 :         mmp_destroy(&retval);
    1055               1 :         mmp_destroy(&msp);
    1056                 : }
    1057               1 : END_TEST
    1058                 : /* ------------------------------------------------------------------------- */
    1059               1 : START_TEST(test_mmp_next_sub_section12)
    1060                 : {
    1061               1 :         MinSectionParser* msp       = mmp_create(2048);
    1062               1 :         MinSectionParser* retval    = INITPTR;
    1063               1 :         const char*        tmp       = "[TagOne]                              \n\
    1064                 :                                         CreateTestReport= YES                 \n\
    1065                 :                                         [EndTagOne]                           \n\
    1066                 :                                         [TagOne]                              \n\
    1067                 :                                         TestReportFilePath= /home/maemo       \n\
    1068                 :                                         [EndTagOne]                           \n\
    1069                 :                                         [TagOne]                              \n\
    1070                 :                                         TestReportFileName= TestReport        \n\
    1071                 :                                         [EndTagOne]                           \n\
    1072                 :                                         [TagOne]                              \n\
    1073                 :                                         TestReportFormat= TXT                 \n\
    1074                 :                                         [EndTagOne]                           \n\
    1075                 :                                         [TagOne]                              \n\
    1076                 :                                         TestReportOutput= FILE                \n\
    1077                 :                                         [EndTagOne]                           \n\
    1078                 :                                         [TagOne]                              \n\
    1079                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    1080                 :                                         [EndTagOne]                           \n";
    1081                 : 
    1082               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    1083                 : 
    1084               1 :         retval = mmp_next_sub_section( msp, "[TagOne]", "[EndTagOne]", 7 );
    1085               1 :         fail_unless( retval == INITPTR
    1086                 :                    , "Retval != INITPTR" );
    1087               1 :         mmp_destroy(&msp);
    1088                 : }
    1089               1 : END_TEST
    1090                 : /* ------------------------------------------------------------------------- */
    1091               1 : START_TEST(test_mmp_next_sub_section13)
    1092                 : {
    1093               1 :         MinSectionParser* msp       = mmp_create(2048);
    1094               1 :         MinSectionParser* retval    = INITPTR;
    1095               1 :         const char*        tmp       = "[TagOne]                              \n\
    1096                 :                                         CreateTestReport= YES                 \n\
    1097                 :                                         [EndTagOne]                           \n\
    1098                 :                                         [TagOne]                              \n\
    1099                 :                                         TestReportFilePath= /home/maemo       \n\
    1100                 :                                         [EndTagOne]                           \n\
    1101                 :                                         [TagOne]                              \n\
    1102                 :                                         TestReportFileName= TestReport        \n\
    1103                 :                                         [EndTagOne]                           \n\
    1104                 :                                         [TagOne]                              \n\
    1105                 :                                         TestReportFormat= TXT                 \n\
    1106                 :                                         [EndTagOne]                           \n\
    1107                 :                                         [TagOne]                              \n\
    1108                 :                                         TestReportOutput= FILE                \n\
    1109                 :                                         [EndTagOne]                           \n\
    1110                 :                                         [TagOne]                              \n\
    1111                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    1112                 :                                         [EndTagOne]                           \n";
    1113                 : 
    1114               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    1115                 : 
    1116               1 :         retval = mmp_next_sub_section( msp, "[TagOne]", "[EndBBB]", 1 );
    1117               1 :         fail_unless( retval == INITPTR
    1118                 :                    , "Retval != INITPTR" );
    1119               1 :         mmp_destroy(&msp);
    1120                 : }
    1121               1 : END_TEST
    1122                 : /* ------------------------------------------------------------------------- */
    1123               1 : START_TEST(test_mmp_next_sub_section14)
    1124                 : {
    1125               1 :         MinSectionParser* msp       = mmp_create(2048);
    1126               1 :         MinSectionParser* retval    = INITPTR;
    1127               1 :         const char*        tmp       = "[TagOne]                              \n\
    1128                 :                                         CreateTestReport= YES                 \n\
    1129                 :                                         [EndTagOne]                           \n\
    1130                 :                                         [TagOne]                              \n\
    1131                 :                                         TestReportFilePath= /home/maemo       \n\
    1132                 :                                         [EndTagOne]                           \n\
    1133                 :                                         [TagOne]                              \n\
    1134                 :                                         TestReportFileName= TestReport        \n\
    1135                 :                                         [EndTagOne]                           \n\
    1136                 :                                         [TagOne]                              \n\
    1137                 :                                         TestReportFormat= TXT                 \n\
    1138                 :                                         [EndTagOne]                           \n\
    1139                 :                                         [TagOne]                              \n\
    1140                 :                                         TestReportOutput= FILE                \n\
    1141                 :                                         [EndTagOne]                           \n\
    1142                 :                                         [TagOne]                              \n\
    1143                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    1144                 :                                         [EndTagOne]                           \n";
    1145                 : 
    1146               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    1147                 : 
    1148               1 :         retval = mmp_next_sub_section( msp, "[TagKaksi]", "[EndTagKaksi]", 1 );
    1149               1 :         fail_unless( retval == INITPTR
    1150                 :                    , "Retval != INITPTR" );
    1151               1 :         mmp_destroy(&msp);
    1152                 : }
    1153               1 : END_TEST
    1154                 : /* ------------------------------------------------------------------------- */
    1155               1 : START_TEST(test_mmp_get_line)
    1156                 : {
    1157               1 :         MinSectionParser* msp       = INITPTR;
    1158               1 :         int                retval    = 0;
    1159               1 :         char*              line      = INITPTR;
    1160                 : 
    1161                 : 
    1162               1 :         retval = mmp_get_line( msp
    1163                 :                              , "TestReportMode"
    1164                 :                              , &line
    1165                 :                              , ESNoTag );
    1166                 : 
    1167               1 :         fail_unless( retval == -1
    1168                 :                    , "Returned value is inproper [%d]"
    1169                 :                    , retval );
    1170                 : 
    1171               1 :         mmp_destroy(&msp);
    1172                 : }
    1173               1 : END_TEST
    1174                 : /* ------------------------------------------------------------------------- */
    1175               1 : START_TEST(test_mmp_get_line2)
    1176                 : {
    1177               1 :         MinSectionParser* msp       = mmp_create( 512 );
    1178               1 :         const char*        tmp       = "TestReportMode= FullReport            \n\
    1179                 :                                         CreateTestReport= YES                 \n\
    1180                 :                                         TestReportFilePath= /home/maemo       \n\
    1181                 :                                         TestReportFileName= TestReport        \n\
    1182                 :                                         TestReportFormat= TXT                 \n\
    1183                 :                                         TestReportOutput= FILE                \n\
    1184                 :                                         TestReportFileCreationMode= OVERWRITE \n";
    1185               1 :         int                retval    = 0;
    1186               1 :         char*              line      = INITPTR;
    1187                 : 
    1188               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    1189                 : 
    1190               1 :         retval = mmp_get_line( msp
    1191                 :                              , INITPTR
    1192                 :                              , &line
    1193                 :                              , ESNoTag );
    1194                 : 
    1195               1 :         fail_unless( retval == -1
    1196                 :                    , "Returned value is inproper [%d]"
    1197                 :                    , retval );
    1198                 : 
    1199               1 :         mmp_destroy(&msp);
    1200                 : }
    1201               1 : END_TEST
    1202                 : /* ------------------------------------------------------------------------- */
    1203               1 : START_TEST(test_mmp_get_line3)
    1204                 : {
    1205               1 :         MinSectionParser* msp       = mmp_create( 512 );
    1206               1 :         const char*        tmp       = "TestReportMode= FullReport            \n\
    1207                 :                                         CreateTestReport= YES                 \n\
    1208                 :                                         TestReportFilePath= /home/maemo       \n\
    1209                 :                                         TestReportFileName= TestReport        \n\
    1210                 :                                         TestReportFormat= TXT                 \n\
    1211                 :                                         TestReportOutput= FILE                \n\
    1212                 :                                         TestReportFileCreationMode= OVERWRITE \n";
    1213               1 :         int                retval    = 0;
    1214               1 :         char*              line      = INITPTR;
    1215                 : 
    1216               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    1217                 : 
    1218               1 :         retval = mmp_get_line( msp
    1219                 :                              , "TestReportMode"
    1220                 :                              , &line
    1221                 :                              , ESNoTag );
    1222                 : 
    1223               1 :         fail_unless( retval == 0
    1224                 :                    , "Returned value is inproper [%d]"
    1225                 :                    , retval );
    1226                 : 
    1227               1 :         DELETE(line);
    1228               1 :         mmp_destroy(&msp);
    1229                 : }
    1230               1 : END_TEST
    1231                 : /* ------------------------------------------------------------------------- */
    1232               1 : START_TEST(test_mmp_get_line4)
    1233                 : {
    1234               1 :         MinSectionParser* msp       = mmp_create( 512 );
    1235               1 :         const char*        tmp       = "TestReportMode= FullReport            \n\
    1236                 :                                         CreateTestReport= YES                 \n\
    1237                 :                                         TestReportFilePath= /home/maemo       \n\
    1238                 :                                         TestReportFileName= TestReport        \n\
    1239                 :                                         TestReportFormat= TXT                 \n\
    1240                 :                                         TestReportOutput= FILE                \n\
    1241                 :                                         TestReportFileCreationMode= OVERWRITE \n";
    1242               1 :         int                retval    = 0;
    1243               1 :         char*              line      = INITPTR;
    1244                 : 
    1245               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    1246                 : 
    1247               1 :         retval = mmp_get_line( msp
    1248                 :                              , "TestReportMode"
    1249                 :                              , &line
    1250                 :                              , ESNoTag );
    1251                 : 
    1252               1 :         fail_unless( strcmp(line,"= FullReport") == 0
    1253                 :                    , "Returned line is wrong [%s]"
    1254                 :                    , line );
    1255                 : 
    1256               1 :         DELETE(line);
    1257               1 :         mmp_destroy(&msp);
    1258                 : }
    1259               1 : END_TEST
    1260                 : /* ------------------------------------------------------------------------- */
    1261               1 : START_TEST(test_mmp_get_line5)
    1262                 : {
    1263               1 :         MinSectionParser* msp       = mmp_create( 512 );
    1264               1 :         const char*        tmp       = "TestReportMode= FullReport            \n\
    1265                 :                                         CreateTestReport= YES                 \n\
    1266                 :                                         TestReportFilePath= /home/maemo       \n\
    1267                 :                                         TestReportFileName= TestReport        \n\
    1268                 :                                         TestReportFormat= TXT                 \n\
    1269                 :                                         TestReportOutput= FILE                \n\
    1270                 :                                         TestReportFileCreationMode= OVERWRITE \n";
    1271               1 :         int                retval    = 0;
    1272               1 :         char*              line      = INITPTR;
    1273                 : 
    1274               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    1275                 : 
    1276               1 :         retval = mmp_get_line( msp
    1277                 :                              , "TestReportMode"
    1278                 :                              , &line
    1279                 :                              , ESTag );
    1280                 : 
    1281               1 :         fail_unless( strcmp(line,"TestReportMode= FullReport") == 0
    1282                 :                    , "Returned line is wrong [%s]"
    1283                 :                    , line );
    1284                 : 
    1285               1 :         DELETE(line);
    1286               1 :         mmp_destroy(&msp);
    1287                 : }
    1288               1 : END_TEST
    1289                 : /* ------------------------------------------------------------------------- */
    1290               1 : START_TEST(test_mmp_get_line6)
    1291                 : {
    1292               1 :         MinSectionParser* msp       = mmp_create( 512 );
    1293               1 :         const char*        tmp       = "TestReportMode= FullReport            \n\
    1294                 :                                         CreateTestReport= YES                 \n\
    1295                 :                                         TestReportFilePath= /home/maemo       \n\
    1296                 :                                         TestReportFileName= TestReport        \n\
    1297                 :                                         TestReportFormat= TXT                 \n\
    1298                 :                                         TestReportOutput= FILE                \n\
    1299                 :                                         TestReportFileCreationMode= OVERWRITE \n";
    1300               1 :         int                retval    = 0;
    1301               1 :         char*              line      = INITPTR;
    1302                 : 
    1303               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    1304                 : 
    1305               1 :         retval = mmp_get_line( msp
    1306                 :                              , "TestReportMode"
    1307                 :                              , &line
    1308                 :                              , ESTag );
    1309                 : 
    1310               1 :         fail_unless( msp->line_indicator_ == ESTrue
    1311                 :                    , "Line indicator is not set to ESTrue" );
    1312                 : 
    1313               1 :         DELETE(line);
    1314               1 :         mmp_destroy(&msp);
    1315                 : }
    1316               1 : END_TEST
    1317                 : /* ------------------------------------------------------------------------- */
    1318               1 : START_TEST(test_mmp_get_next_line)
    1319                 : {
    1320               1 :         MinSectionParser* msp       = INITPTR;
    1321               1 :         int                retval    = 0;
    1322               1 :         char*              line      = INITPTR;
    1323                 : 
    1324               1 :         retval = mmp_get_next_line( msp
    1325                 :                                   , &line );
    1326                 : 
    1327               1 :         fail_unless( retval == -1
    1328                 :                    , "Returned value is inproper [%d]"
    1329                 :                    , retval );
    1330                 : 
    1331               1 :         mmp_destroy(&msp);
    1332                 : }
    1333               1 : END_TEST
    1334                 : /* ------------------------------------------------------------------------- */
    1335               1 : START_TEST(test_mmp_get_next_line2)
    1336                 : {
    1337               1 :         MinSectionParser* msp       = mmp_create( 512 );
    1338               1 :         const char*        tmp       = "TestReportMode= FullReport            \n\
    1339                 :                                         CreateTestReport= YES                 \n\
    1340                 :                                         TestReportFilePath= /home/maemo       \n\
    1341                 :                                         TestReportFileName= TestReport        \n\
    1342                 :                                         TestReportFormat= TXT                 \n\
    1343                 :                                         TestReportOutput= FILE                \n\
    1344                 :                                         TestReportFileCreationMode= OVERWRITE \n";
    1345               1 :         int                retval    = 0;
    1346               1 :         char*              line      = INITPTR;
    1347                 : 
    1348               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    1349                 : 
    1350               1 :         retval = mmp_get_next_line( msp
    1351                 :                                   , &line );
    1352                 : 
    1353               1 :         fail_unless( retval == -1
    1354                 :                    , "Returned value is inproper [%d]"
    1355                 :                    , retval );
    1356                 : 
    1357                 : 
    1358               1 :         mmp_destroy(&msp);
    1359                 : }
    1360               1 : END_TEST
    1361                 : /* ------------------------------------------------------------------------- */
    1362               1 : START_TEST(test_mmp_get_next_line3)
    1363                 : {
    1364               1 :         MinSectionParser* msp       = mmp_create( 512 );
    1365               1 :         const char*        tmp       = "TestReportMode= FullReport            \n\
    1366                 :                                         CreateTestReport= YES                 \n\
    1367                 :                                         TestReportFilePath= /home/maemo       \n\
    1368                 :                                         TestReportFileName= TestReport        \n\
    1369                 :                                         TestReportFormat= TXT                 \n\
    1370                 :                                         TestReportOutput= FILE                \n\
    1371                 :                                         TestReportFileCreationMode= OVERWRITE \n";
    1372               1 :         int                retval    = 0;
    1373               1 :         char*              line      = INITPTR;
    1374                 : 
    1375               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    1376               1 :         msp->line_indicator_ = ESTrue;
    1377                 : 
    1378               1 :         retval = mmp_get_next_line( msp
    1379                 :                                   , &line );
    1380                 : 
    1381               1 :         fail_unless( retval == 0
    1382                 :                    , "Returned value is inproper [%d]"
    1383                 :                    , retval );
    1384                 : 
    1385               1 :         DELETE(line);
    1386               1 :         mmp_destroy(&msp);
    1387                 : }
    1388               1 : END_TEST
    1389                 : /* ------------------------------------------------------------------------- */
    1390               1 : START_TEST(test_mmp_get_next_line4)
    1391                 : {
    1392               1 :         MinSectionParser* msp       = mmp_create( 512 );
    1393               1 :         const char*        tmp       = "TestReportMode= FullReport            \n\
    1394                 :                                         CreateTestReport= YES                 \n\
    1395                 :                                         TestReportFilePath= /home/maemo       \n\
    1396                 :                                         TestReportFileName= TestReport        \n\
    1397                 :                                         TestReportFormat= TXT                 \n\
    1398                 :                                         TestReportOutput= FILE                \n\
    1399                 :                                         TestReportFileCreationMode= OVERWRITE \n";
    1400               1 :         int                retval    = 0;
    1401               1 :         char*              line      = INITPTR;
    1402                 : 
    1403               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    1404               1 :         msp->line_indicator_ = ESTrue;
    1405                 : 
    1406               1 :         retval = mmp_get_next_line( msp
    1407                 :                                   , &line );
    1408                 : 
    1409               1 :         fail_unless( strcmp(line,"TestReportMode= FullReport") == 0
    1410                 :                    , "Returned line is wrong [%s]"
    1411                 :                    , line );
    1412                 : 
    1413               1 :         DELETE(line);
    1414               1 :         mmp_destroy(&msp);
    1415                 : }
    1416               1 : END_TEST
    1417                 : /* ------------------------------------------------------------------------- */
    1418               1 : START_TEST(test_mmp_get_next_line5)
    1419                 : {
    1420               1 :         MinSectionParser* msp       = mmp_create( 512 );
    1421               1 :         const char*        tmp       = "TestReportMode= FullReport            \n\
    1422                 :                                         CreateTestReport= YES                 \n\
    1423                 :                                         TestReportFilePath= /home/maemo       \n\
    1424                 :                                         TestReportFileName= TestReport        \n\
    1425                 :                                         TestReportFormat= TXT                 \n\
    1426                 :                                         TestReportOutput= FILE                \n\
    1427                 :                                         TestReportFileCreationMode= OVERWRITE \n";
    1428               1 :         int                retval    = 0;
    1429               1 :         char*              line      = INITPTR;
    1430                 : 
    1431               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    1432               1 :         msp->line_indicator_ = ESTrue;
    1433                 : 
    1434               1 :         retval = mmp_get_next_line( msp
    1435                 :                                   , &line );
    1436               1 :         DELETE(line);
    1437               1 :         line = INITPTR;
    1438                 : 
    1439               1 :         retval = mmp_get_next_line( msp
    1440                 :                                   , &line );
    1441                 : 
    1442               1 :         fail_unless( strcmp(line,"CreateTestReport= YES") == 0
    1443                 :                    , "Returned line is wrong [%s]"
    1444                 :                    , line );
    1445                 : 
    1446               1 :         DELETE(line);
    1447               1 :         mmp_destroy(&msp);
    1448                 : }
    1449               1 : END_TEST
    1450                 : /* ------------------------------------------------------------------------- */
    1451               1 : START_TEST(test_mmp_get_next_line6)
    1452                 : {
    1453               1 :         MinSectionParser* msp       = mmp_create( 512 );
    1454               1 :         const char*        tmp       = "TestReportMode= FullReport            \n\
    1455                 :                                         CreateTestReport= YES                 \n\
    1456                 :                                         TestReportFilePath= /home/maemo       \n\
    1457                 :                                         TestReportFileName= TestReport        \n\
    1458                 :                                         TestReportFormat= TXT                 \n\
    1459                 :                                         TestReportOutput= FILE                \n\
    1460                 :                                         TestReportFileCreationMode= OVERWRITE \n";
    1461               1 :         int                retval    = 0;
    1462               1 :         char*              line      = INITPTR;
    1463                 : 
    1464               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    1465               1 :         msp->line_indicator_ = ESTrue;
    1466                 : 
    1467               1 :         retval = mmp_get_next_line( msp
    1468                 :                                   , &line );
    1469               1 :         DELETE(line);
    1470               1 :         line = INITPTR;
    1471                 : 
    1472               1 :         retval = mmp_get_next_line( msp
    1473                 :                                   , &line );
    1474               1 :         DELETE(line);
    1475               1 :         line = INITPTR;
    1476                 : 
    1477               1 :         retval = mmp_get_next_line( msp
    1478                 :                                   , &line );
    1479                 : 
    1480               1 :         fail_unless( strcmp(line,"TestReportFilePath= /home/maemo") == 0
    1481                 :                    , "Returned line is wrong [%s]"
    1482                 :                    , line );
    1483                 : 
    1484               1 :         DELETE(line);
    1485               1 :         mmp_destroy(&msp);
    1486                 : }
    1487               1 : END_TEST
    1488                 : /* ------------------------------------------------------------------------- */
    1489               1 : START_TEST(test_mmp_get_next_line7)
    1490                 : {
    1491               1 :         MinSectionParser* msp       = mmp_create( 512 );
    1492               1 :         const char*        tmp       = "TestReportMode= FullReport            \n\
    1493                 :                                         CreateTestReport= YES                 \n\
    1494                 :                                         TestReportFilePath= /home/maemo       \n\
    1495                 :                                         TestReportFileName= TestReport        \n\
    1496                 :                                         TestReportFormat= TXT                 \n\
    1497                 :                                         TestReportOutput= FILE                \n\
    1498                 :                                         TestReportFileCreationMode= OVERWRITE \n";
    1499               1 :         int                retval    = 0;
    1500               1 :         char*              line      = INITPTR;
    1501                 : 
    1502               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    1503               1 :         msp->line_indicator_ = ESTrue;
    1504                 : 
    1505               1 :         retval = mmp_get_line( msp
    1506                 :                              , "TestReportMode"
    1507                 :                              , &line
    1508                 :                              , ESTag );
    1509               1 :         DELETE(line);
    1510               1 :         line = INITPTR;
    1511                 : 
    1512               1 :         retval = mmp_get_next_line( msp
    1513                 :                                   , &line );
    1514                 : 
    1515               1 :         fail_unless( strcmp(line,"CreateTestReport= YES") == 0
    1516                 :                    , "Returned line is wrong [%s]"
    1517                 :                    , line );
    1518                 : 
    1519               1 :         DELETE(line);
    1520               1 :         mmp_destroy(&msp);
    1521                 : }
    1522               1 : END_TEST
    1523                 : /* ------------------------------------------------------------------------- */
    1524               1 : START_TEST(test_mmp_get_next_line8)
    1525                 : {
    1526               1 :         MinSectionParser* msp       = mmp_create( 512 );
    1527               1 :         const char*        tmp       = "TestReportMode= FullReport            \n\
    1528                 :                                         CreateTestReport= YES                 \n\
    1529                 :                                         TestReportFilePath= /home/maemo       \n\
    1530                 :                                         TestReportFileName= TestReport        \n\
    1531                 :                                         TestReportFormat= TXT                 \n\
    1532                 :                                         TestReportOutput= FILE                \n\
    1533                 :                                         TestReportFileCreationMode= OVERWRITE";
    1534               1 :         int                retval    = 0;
    1535               1 :         char*              line      = INITPTR;
    1536                 : 
    1537               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    1538               1 :         msp->line_indicator_ = ESTrue;
    1539                 : 
    1540               1 :         retval = mmp_get_line( msp
    1541                 :                              , "TestReportFileCreationMode="
    1542                 :                              , &line
    1543                 :                              , ESTag );
    1544               1 :         DELETE(line);
    1545               1 :         line = INITPTR;
    1546                 : 
    1547               1 :         retval = mmp_get_next_line( msp
    1548                 :                                   , &line );
    1549                 : 
    1550               1 :         fail_unless( retval == 0
    1551                 :                    , "result differs from expected [%d]"
    1552                 :                    , retval );
    1553                 : 
    1554               1 :         DELETE(line);
    1555               1 :         mmp_destroy(&msp);
    1556                 : }
    1557               1 : END_TEST
    1558                 : /* ------------------------------------------------------------------------- */
    1559               1 : START_TEST(test_mmp_get_next_line9)
    1560                 : {
    1561               1 :         MinSectionParser* msp       = mmp_create( 512 );
    1562               1 :         const char*        tmp       = "TestReportMode= FullReport            \n\
    1563                 :                                         CreateTestReport= YES                 \n\
    1564                 :                                         TestReportFilePath= /home/maemo       \n\
    1565                 :                                         TestReportFileName= TestReport        \n\
    1566                 :                                         TestReportFormat= TXT                 \n\
    1567                 :                                         TestReportOutput= FILE                \n\
    1568                 :                                         TestReportFileCreationMode= OVERWRITE";
    1569               1 :         int                retval    = 0;
    1570               1 :         char*              line      = INITPTR;
    1571                 : 
    1572               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    1573               1 :         msp->line_indicator_ = ESTrue;
    1574                 : 
    1575               1 :         retval = mmp_get_line( msp
    1576                 :                              , "TestReportFileCreationMode="
    1577                 :                              , &line
    1578                 :                              , ESTag );
    1579               1 :         DELETE(line);
    1580               1 :         line = INITPTR;
    1581                 : 
    1582               1 :         retval = mmp_get_next_line( msp
    1583                 :                                   , &line );
    1584                 : 
    1585               1 :         fail_unless( line != INITPTR
    1586                 :                    , "line == INITPTR" );
    1587                 : 
    1588               1 :         DELETE(line);
    1589               1 :         mmp_destroy(&msp);
    1590                 : }
    1591               1 : END_TEST
    1592                 : /* ------------------------------------------------------------------------- */
    1593               1 : START_TEST(test_mmp_get_next_line10)
    1594                 : {
    1595               1 :         MinSectionParser* msp       = mmp_create( 512 );
    1596               1 :         const char*        tmp       = "TestReportMode= FullReport            \n";
    1597               1 :         int                retval    = 0;
    1598               1 :         char*              line      = INITPTR;
    1599                 : 
    1600               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    1601               1 :         msp->line_indicator_ = ESTrue;
    1602                 : 
    1603               1 :         retval = mmp_get_line( msp
    1604                 :                              , "TestReportMode="
    1605                 :                              , &line
    1606                 :                              , ESTag );
    1607               1 :         DELETE(line);
    1608               1 :         line = INITPTR;
    1609                 : 
    1610               1 :         retval = mmp_get_next_line( msp
    1611                 :                                   , &line );
    1612                 : 
    1613               1 :         fail_unless( strlen(line) == 0
    1614                 :                    , "strlen(line) != 0 [%d]"
    1615                 :                    , strlen(line) );
    1616                 : 
    1617               1 :         DELETE(line);
    1618               1 :         mmp_destroy(&msp);
    1619                 : }
    1620               1 : END_TEST
    1621                 : /* ------------------------------------------------------------------------- */
    1622               1 : START_TEST(test_mmp_get_next_tagged_line)
    1623                 : {
    1624               1 :         MinSectionParser* msp       = INITPTR;
    1625               1 :         int                retval    = 0;
    1626               1 :         char*              line      = INITPTR;
    1627                 : 
    1628               1 :         retval = mmp_get_next_tagged_line( msp
    1629                 :                                          , "Tag"
    1630                 :                                          , &line
    1631                 :                                          , ESNoTag);
    1632               1 :         fail_unless( retval == -1
    1633                 :                    , "Returned value is inproper [%d]"
    1634                 :                    , retval );
    1635                 : 
    1636               1 :         mmp_destroy(&msp);
    1637                 : }
    1638               1 : END_TEST
    1639                 : /* ------------------------------------------------------------------------- */
    1640               1 : START_TEST(test_mmp_get_next_tagged_line2)
    1641                 : {
    1642               1 :         MinSectionParser* msp       = mmp_create(512);
    1643               1 :         int                retval    = 0;
    1644               1 :         char*              line      = INITPTR;
    1645               1 :         msp->line_indicator_         = ESTrue;
    1646                 : 
    1647               1 :         retval = mmp_get_next_tagged_line( msp
    1648                 :                                          , INITPTR
    1649                 :                                          , &line
    1650                 :                                          , ESNoTag);
    1651               1 :         fail_unless( retval == -1
    1652                 :                    , "Returned value is inproper [%d]"
    1653                 :                    , retval );
    1654                 : 
    1655               1 :         mmp_destroy(&msp);
    1656                 : }
    1657               1 : END_TEST
    1658                 : /* ------------------------------------------------------------------------- */
    1659               1 : START_TEST(test_mmp_get_next_tagged_line3)
    1660                 : {
    1661               1 :         MinSectionParser* msp       = mmp_create(512);
    1662               1 :         int                retval    = 0;
    1663               1 :         char*              line      = INITPTR;
    1664               1 :         const char*        tmp       = "TestReportMode= FullReport            \n\
    1665                 :                                         CreateTestReport= YES                 \n\
    1666                 :                                         TestReportFilePath= /home/maemo       \n\
    1667                 :                                         TestReportFileName= TestReport        \n\
    1668                 :                                         TestReportFormat= TXT                 \n\
    1669                 :                                         TestReportOutput= FILE                \n\
    1670                 :                                         TestReportFileCreationMode= OVERWRITE \n";
    1671               1 :         msp->line_indicator_         = ESFalse;
    1672                 : 
    1673               1 :         retval = mmp_get_next_tagged_line( msp
    1674                 :                                          , "TestReportFilePath"
    1675                 :                                          , &line
    1676                 :                                          , ESNoTag);
    1677               1 :         fail_unless( retval == -1
    1678                 :                    , "Returned value is inproper [%d]"
    1679                 :                    , retval );
    1680                 : 
    1681               1 :         mmp_destroy(&msp);
    1682                 : }
    1683               1 : END_TEST
    1684                 : /* ------------------------------------------------------------------------- */
    1685               1 : START_TEST(test_mmp_get_next_tagged_line4)
    1686                 : {
    1687               1 :         MinSectionParser* msp       = mmp_create(512);
    1688               1 :         int                retval    = 0;
    1689               1 :         char*              line      = INITPTR;
    1690               1 :         const char*        tmp       = "TestReportMode= FullReport            \n\
    1691                 :                                         CreateTestReport= YES                 \n\
    1692                 :                                         TestReportFilePath= /home/maemo       \n\
    1693                 :                                         TestReportFileName= TestReport        \n\
    1694                 :                                         TestReportFormat= TXT                 \n\
    1695                 :                                         TestReportOutput= FILE                \n\
    1696                 :                                         TestReportFileCreationMode= OVERWRITE \n";
    1697               1 :         msp->line_indicator_         = ESTrue;
    1698               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    1699               1 :         retval = mmp_get_next_tagged_line( msp
    1700                 :                                          , "TestReportFilePath"
    1701                 :                                          , &line
    1702                 :                                          , ESNoTag);
    1703               1 :         fail_unless( retval == 0
    1704                 :                    , "Returned value is inproper [%d]"
    1705                 :                    , retval );
    1706                 : 
    1707               1 :         DELETE(line);
    1708               1 :         mmp_destroy(&msp);
    1709                 : }
    1710               1 : END_TEST
    1711                 : /* ------------------------------------------------------------------------- */
    1712               1 : START_TEST(test_mmp_get_next_tagged_line5)
    1713                 : {
    1714               1 :         MinSectionParser* msp       = mmp_create(512);
    1715               1 :         int                retval    = 0;
    1716               1 :         char*              line      = INITPTR;
    1717               1 :         const char*        tmp       = "TestReportMode= FullReport            \n\
    1718                 :                                         CreateTestReport= YES                 \n\
    1719                 :                                         TestReportFilePath= /home/maemo       \n\
    1720                 :                                         TestReportFileName= TestReport        \n\
    1721                 :                                         TestReportFormat= TXT                 \n\
    1722                 :                                         TestReportOutput= FILE                \n\
    1723                 :                                         TestReportFileCreationMode= OVERWRITE \n";
    1724               1 :         msp->line_indicator_         = ESTrue;
    1725               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    1726               1 :         retval = mmp_get_next_tagged_line( msp
    1727                 :                                          , "TestReportFilePath"
    1728                 :                                          , &line
    1729                 :                                          , ESNoTag);
    1730               1 :         fail_unless( strcmp(line,"= /home/maemo") == 0
    1731                 :                    , "Returned value is inproper [%s]"
    1732                 :                    , line );
    1733                 : 
    1734               1 :         DELETE(line);
    1735               1 :         mmp_destroy(&msp);
    1736                 : }
    1737               1 : END_TEST
    1738                 : /* ------------------------------------------------------------------------- */
    1739               1 : START_TEST(test_mmp_get_next_tagged_line6)
    1740                 : {
    1741               1 :         MinSectionParser* msp       = mmp_create(512);
    1742               1 :         int                retval    = 0;
    1743               1 :         char*              line      = INITPTR;
    1744               1 :         const char*        tmp       = "TestReportMode= FullReport            \n\
    1745                 :                                         CreateTestReport= YES                 \n\
    1746                 :                                         TestReportFilePath= /home/maemo       \n\
    1747                 :                                         TestReportFileName= TestReport        \n\
    1748                 :                                         TestReportFormat= TXT                 \n\
    1749                 :                                         TestReportOutput= FILE                \n\
    1750                 :                                         TestReportFileCreationMode= OVERWRITE \n";
    1751               1 :         msp->line_indicator_         = ESTrue;
    1752               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    1753               1 :         retval = mmp_get_next_tagged_line( msp
    1754                 :                                          , "TestReportFilePath"
    1755                 :                                          , &line
    1756                 :                                          , ESTag);
    1757               1 :         fail_unless( strcmp(line,"TestReportFilePath= /home/maemo") == 0
    1758                 :                    , "Returned value is inproper [%s]"
    1759                 :                    , line );
    1760                 : 
    1761               1 :         DELETE(line);
    1762               1 :         mmp_destroy(&msp);
    1763                 : }
    1764               1 : END_TEST
    1765                 : /* ------------------------------------------------------------------------- */
    1766               1 : START_TEST(test_mmp_get_next_tagged_line7)
    1767                 : {
    1768               1 :         MinSectionParser* msp       = mmp_create(512);
    1769               1 :         int                retval    = 0;
    1770               1 :         char*              line      = INITPTR;
    1771               1 :         const char*        tmp       = "TestReportMode= FullReport            \n\
    1772                 :                                         CreateTestReport= YES                 \n\
    1773                 :                                         TestReportFilePath= /home/maemo       \n\
    1774                 :                                         TestReportFileName= TestReport        \n\
    1775                 :                                         TestReportFormat= TXT                 \n\
    1776                 :                                         TestReportOutput= FILE                \n\
    1777                 :                                         TestReportFileCreationMode= OVERWRITE \n";
    1778               1 :         msp->line_indicator_         = ESTrue;
    1779               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    1780               1 :         retval = mmp_get_next_tagged_line( msp
    1781                 :                                          , "TestReportFilePath"
    1782                 :                                          , &line
    1783                 :                                          , ESTag);
    1784               1 :         DELETE(line);
    1785               1 :         retval = mmp_get_next_tagged_line( msp
    1786                 :                                          , "TestReportFileName"
    1787                 :                                          , &line
    1788                 :                                          , ESTag);
    1789               1 :         fail_unless( strcmp(line,"TestReportFileName= TestReport") == 0
    1790                 :                    , "Returned value is inproper [%s]"
    1791                 :                    , line );
    1792                 : 
    1793               1 :         DELETE(line);
    1794               1 :         mmp_destroy(&msp);
    1795                 : }
    1796               1 : END_TEST
    1797                 : /* ------------------------------------------------------------------------- */
    1798               1 : START_TEST(test_mmp_get_next_tagged_line8)
    1799                 : {
    1800               1 :         MinSectionParser* msp       = mmp_create(512);
    1801               1 :         int                retval    = 0;
    1802               1 :         char*              line      = INITPTR;
    1803               1 :         const char*        tmp       = "TestReportMode= FullReport            \n\
    1804                 :                                         CreateTestReport= YES                 \n\
    1805                 :                                         TestReportFilePath= /home/maemo       \n\
    1806                 :                                         TestReportFileName= TestReport        \n\
    1807                 :                                         TestReportFormat= TXT                 \n\
    1808                 :                                         TestReportOutput= FILE                \n\
    1809                 :                                         TestReportFileCreationMode= OVERWRITE \n";
    1810               1 :         msp->line_indicator_         = ESTrue;
    1811               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    1812               1 :         retval = mmp_get_next_tagged_line( msp
    1813                 :                                          , "TestReportFilePath"
    1814                 :                                          , &line
    1815                 :                                          , ESTag);
    1816               1 :         DELETE(line);
    1817               1 :         retval = mmp_get_next_tagged_line( msp
    1818                 :                                          , "TestReportFilePath"
    1819                 :                                          , &line
    1820                 :                                          , ESTag);
    1821                 : 
    1822               1 :         fail_unless( retval == 0
    1823                 :                    , "Returned value is inproper [%d]"
    1824                 :                    , retval );
    1825                 : 
    1826               1 :         mmp_destroy(&msp);
    1827                 : }
    1828               1 : END_TEST
    1829                 : /* ------------------------------------------------------------------------- */
    1830               1 : START_TEST(test_mmp_get_next_tagged_line9)
    1831                 : {
    1832               1 :         MinSectionParser* msp       = mmp_create(512);
    1833               1 :         int                retval    = 0;
    1834               1 :         char*              line      = INITPTR;
    1835               1 :         const char*        tmp       = "TestReportMode= FullReport            \n\
    1836                 :                                         CreateTestReport= YES                 \n\
    1837                 :                                         TestReportFilePath= /home/maemo       \n\
    1838                 :                                         TestReportFileName= TestReport        \n\
    1839                 :                                         TestReportFormat= TXT                 \n\
    1840                 :                                         TestReportOutput= FILE                \n\
    1841                 :                                         TestReportFileCreationMode= OVERWRITE \n";
    1842               1 :         msp->line_indicator_         = ESTrue;
    1843               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    1844               1 :         retval = mmp_get_next_tagged_line( msp
    1845                 :                                          , "TestReportFilePath"
    1846                 :                                          , &line
    1847                 :                                          , ESTag);
    1848               1 :         DELETE(line);
    1849               1 :         retval = mmp_get_next_tagged_line( msp
    1850                 :                                          , "TestReportFilePath"
    1851                 :                                          , &line
    1852                 :                                          , ESTag);
    1853               1 :         fail_unless( line == INITPTR
    1854                 :                    , "line != INITPTR" );
    1855                 : 
    1856               1 :         mmp_destroy(&msp);
    1857                 : }
    1858               1 : END_TEST
    1859                 : /* ------------------------------------------------------------------------- */
    1860               1 : START_TEST(test_mmp_get_next_tagged_line10)
    1861                 : {
    1862               1 :         MinSectionParser* msp       = mmp_create(512);
    1863               1 :         int                retval    = 0;
    1864               1 :         char*              line      = INITPTR;
    1865               1 :         const char*        tmp       = "TestReportMode= FullReport            \n\
    1866                 :                                         CreateTestReport= YES                 \n\
    1867                 :                                         TestReportFilePath= /home/maemo       \n\
    1868                 :                                         TestReportFileName= TestReport        \n\
    1869                 :                                         TestReportFormat= TXT                 \n\
    1870                 :                                         TestReportOutput= FILE                \n\
    1871                 :                                         TestReportFileCreationMode= OVERWRITE";
    1872               1 :         msp->line_indicator_         = ESTrue;
    1873               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    1874               1 :         retval = mmp_get_next_tagged_line( msp
    1875                 :                                          , "TestReportFileCreationMode="
    1876                 :                                          , &line
    1877                 :                                          , ESTag);
    1878               1 :         DELETE(line);
    1879               1 :         retval = mmp_get_next_tagged_line( msp
    1880                 :                                          , "TestReportFileCreationMode="
    1881                 :                                          , &line
    1882                 :                                          , ESTag);
    1883               1 :         fail_unless( retval == 0
    1884                 :                    , "Returned value is inproper [%d]"
    1885                 :                    , retval );
    1886                 : 
    1887               1 :         mmp_destroy(&msp);
    1888                 : }
    1889               1 : END_TEST
    1890                 : /* ------------------------------------------------------------------------- */
    1891               1 : START_TEST(test_mmp_get_next_tagged_line11)
    1892                 : {
    1893               1 :         MinSectionParser* msp       = mmp_create(512);
    1894               1 :         int                retval    = 0;
    1895               1 :         char*              line      = INITPTR;
    1896               1 :         const char*        tmp       = "TestReportMode= FullReport            \n\
    1897                 :                                         CreateTestReport= YES                 \n\
    1898                 :                                         TestReportFilePath= /home/maemo       \n\
    1899                 :                                         TestReportFileName= TestReport        \n\
    1900                 :                                         TestReportFormat= TXT                 \n\
    1901                 :                                         TestReportOutput= FILE                \n\
    1902                 :                                         TestReportFileCreationMode= OVERWRITE";
    1903               1 :         msp->line_indicator_         = ESTrue;
    1904               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    1905               1 :         retval = mmp_get_next_tagged_line( msp
    1906                 :                                          , "TestReportFileCreationMode="
    1907                 :                                          , &line
    1908                 :                                          , ESTag);
    1909               1 :         DELETE(line);
    1910               1 :         retval = mmp_get_next_tagged_line( msp
    1911                 :                                          , "TestReportFileCreationMode="
    1912                 :                                          , &line
    1913                 :                                          , ESTag);
    1914               1 :         fail_unless( line == INITPTR
    1915                 :                    , "line != INITPTR" );
    1916                 : 
    1917               1 :         mmp_destroy(&msp);
    1918                 : }
    1919               1 : END_TEST
    1920                 : /* ------------------------------------------------------------------------- */
    1921               1 : START_TEST(test_mmp_get_position)
    1922                 : {
    1923               1 :         int                ret = 0;
    1924               1 :         MinSectionParser* msp = mmp_create( 10 );
    1925               1 :         ret = mmp_get_position(msp);
    1926               1 :         fail_unless( ret == 0
    1927                 :                    , "Wrong result [%d]"
    1928                 :                    , ret );
    1929               1 :         mmp_destroy(&msp);
    1930                 : }
    1931               1 : END_TEST
    1932                 : /* ------------------------------------------------------------------------- */
    1933               1 : START_TEST(test_mmp_get_position2)
    1934                 : {
    1935               1 :         int                ret = 0;
    1936               1 :         MinSectionParser* msp = INITPTR;
    1937               1 :         ret = mmp_get_position(msp);
    1938               1 :         fail_unless( ret == -1
    1939                 :                    , "Wrong result [%d]"
    1940                 :                    , ret );
    1941               1 :         mmp_destroy(&msp);
    1942                 : }
    1943               1 : END_TEST
    1944                 : /* ------------------------------------------------------------------------- */
    1945               1 : START_TEST(test_mmp_get_position3)
    1946                 : {
    1947               1 :         int                ret = 0;
    1948               1 :         MinSectionParser* msp = mmp_create( 10 );
    1949               1 :         mmp_set_position(msp,5);
    1950               1 :         ret = mmp_get_position(msp);
    1951               1 :         fail_unless( ret == 5
    1952                 :                    , "Wrong result [%d]"
    1953                 :                    , ret );
    1954               1 :         mmp_destroy(&msp);
    1955                 : }
    1956               1 : END_TEST
    1957                 : /* ------------------------------------------------------------------------- */
    1958               1 : START_TEST(test_mmp_set_position)
    1959                 : {
    1960               1 :         int                ret = 0;
    1961               1 :         MinSectionParser* msp = mmp_create( 10 );
    1962               1 :         ret = mmp_set_position(msp,5);
    1963               1 :         fail_unless( ret == ENOERR
    1964                 :                    , "Wrong result [%d]"
    1965                 :                    , ret );
    1966               1 :         mmp_destroy(&msp);
    1967                 : }
    1968               1 : END_TEST
    1969                 : /* ------------------------------------------------------------------------- */
    1970               1 : START_TEST(test_mmp_set_position2)
    1971                 : {
    1972               1 :         int                ret = 0;
    1973               1 :         MinSectionParser* msp = mmp_create( 10 );
    1974               1 :         ret = mmp_set_position(msp,5);
    1975               1 :         fail_unless( msp->skip_and_mark_pos_ == 5
    1976                 :                    , "inproper value of msp->skip_and_mark_pos_ [%d]"
    1977                 :                    , msp->skip_and_mark_pos_ );
    1978               1 :         mmp_destroy(&msp);
    1979                 : }
    1980               1 : END_TEST
    1981                 : /* ------------------------------------------------------------------------- */
    1982               1 : START_TEST(test_mmp_set_position3)
    1983                 : {
    1984               1 :         int                ret = 0;
    1985               1 :         MinSectionParser* msp = INITPTR;
    1986               1 :         ret = mmp_set_position(msp,5);
    1987               1 :         fail_unless( ret == -1
    1988                 :                    , "Wrong result [%d]"
    1989                 :                    , ret );
    1990               1 :         mmp_destroy(&msp);
    1991                 : }
    1992               1 : END_TEST
    1993                 : /* ------------------------------------------------------------------------- */
    1994               1 : START_TEST(test_mmp_set_data)
    1995                 : {
    1996               1 :         const char*        tmp = "ala ma kot";
    1997               1 :         MinSectionParser* msp = mmp_create( 10 );
    1998               1 :         mmp_set_data(msp,tmp,&tmp[0],10);
    1999               1 :         fail_unless( strlen(msp->buffer_section_) == 10
    2000                 :                    , "Wrong length of the msp->buff_section_" );
    2001               1 :         mmp_destroy(&msp);
    2002                 : }
    2003               1 : END_TEST
    2004                 : /* ------------------------------------------------------------------------- */
    2005               1 : START_TEST(test_mmp_set_data2)
    2006                 : {
    2007               1 :         const char*        tmp = "ala ma kot";
    2008               1 :         MinSectionParser* msp = mmp_create( 10 );
    2009               1 :         mmp_set_data(msp,tmp,&tmp[0],10);
    2010               1 :         fail_unless( strcmp(msp->buffer_section_,"ala ma kot") == 0
    2011                 :                    , "Wrong content of the msp->buff_section_ [%s]" );
    2012               1 :         mmp_destroy(&msp);
    2013                 : }
    2014               1 : END_TEST
    2015                 : /* ------------------------------------------------------------------------- */
    2016               1 : START_TEST(test_mmp_set_data3)
    2017                 : {
    2018               1 :         const char*        tmp = "ala ma kot";
    2019               1 :         MinSectionParser* msp = mmp_create( 10 );
    2020               1 :         mmp_set_data(msp,tmp,&tmp[0],10);
    2021               1 :         fail_unless( strcmp(msp->section_,"ala ma kot") == 0
    2022                 :                    , "Wrong content of the msp->section_ [%s]" );
    2023               1 :         mmp_destroy(&msp);
    2024                 : }
    2025               1 : END_TEST
    2026                 : /* ------------------------------------------------------------------------- */
    2027               1 : START_TEST(test_mmp_set_data4)
    2028                 : {
    2029               1 :         const char*        tmp = "ala ma kot";
    2030               1 :         MinSectionParser* msp = mmp_create( 10 );
    2031               1 :         mmp_set_data(msp,tmp,&tmp[0],10);
    2032               1 :         fail_unless( strcmp(msp->section_,"ala ma kot") == 0
    2033                 :                    , "Wrong content of the msp->section_ [%s]" );
    2034               1 :         mmp_destroy(&msp);
    2035                 : }
    2036               1 : END_TEST
    2037                 : /* ------------------------------------------------------------------------- */
    2038               1 : START_TEST(test_mmp_set_data5)
    2039                 : {
    2040               1 :         const char*        tmp = "ala ma kota kot ma ale lalala";
    2041               1 :         MinSectionParser* msp = mmp_create( 100 );
    2042               1 :         mmp_set_data(msp,tmp,&tmp[0],10);
    2043               1 :         fail_unless( strcmp(msp->buffer_section_,"ala ma kot") == 0
    2044                 :                    , "Wrong content of the msp->section_ [%s]" );
    2045               1 :         mmp_destroy(&msp);
    2046                 : }
    2047               1 : END_TEST
    2048                 : /* ------------------------------------------------------------------------- */
    2049               1 : START_TEST(test_mmp_des)
    2050                 : {
    2051               1 :         const char*        tmp = "ala ma kot";
    2052               1 :         char*              pom = INITPTR;
    2053               1 :         MinSectionParser* msp = mmp_create( 10 );
    2054               1 :         pom = mmp_des(msp);
    2055               1 :         fail_unless( pom != INITPTR
    2056                 :                    , "Wrong data returned" );
    2057               1 :         mmp_destroy(&msp);
    2058                 : }
    2059               1 : END_TEST
    2060                 : /* ------------------------------------------------------------------------- */
    2061               1 : START_TEST(test_mmp_des2)
    2062                 : {
    2063               1 :         const char*        tmp = "ala ma kot";
    2064               1 :         char*              pom = INITPTR;
    2065               1 :         MinSectionParser* msp = INITPTR;
    2066               1 :         pom = mmp_des(msp);
    2067               1 :         fail_unless( pom == INITPTR
    2068                 :                    , "Wrong data returned" );
    2069               1 :         mmp_destroy(&msp);
    2070                 : }
    2071               1 : END_TEST
    2072                 : /* ------------------------------------------------------------------------- */
    2073               1 : START_TEST(test_mmp_des3)
    2074                 : {
    2075               1 :         const char*        tmp = "ala ma kot";
    2076               1 :         char*              pom = INITPTR;
    2077               1 :         MinSectionParser* msp = mmp_create( 10 );
    2078               1 :         pom = mmp_des(msp);
    2079                 : 
    2080               1 :         fail_unless( strlen(pom) == 0
    2081                 :                    , "Wrong length of returned data [%d]"
    2082                 :                    , strlen(pom) );
    2083                 : 
    2084               1 :         mmp_destroy(&msp);
    2085                 : }
    2086               1 : END_TEST
    2087                 : /* ------------------------------------------------------------------------- */
    2088               1 : START_TEST(test_mmp_des4)
    2089                 : {
    2090               1 :         const char*        tmp = "ala ma kot";
    2091               1 :         char*              pom = INITPTR;
    2092               1 :         MinSectionParser* msp = mmp_create( 10 );
    2093               1 :         pom = mmp_des(msp);
    2094               1 :         fail_unless( strcmp(pom,"") == 0
    2095                 :                    , "Wrong content of returned data [%s]"
    2096                 :                    , pom );
    2097               1 :         mmp_destroy(&msp);
    2098                 : }
    2099               1 : END_TEST
    2100                 : /* ------------------------------------------------------------------------- */
    2101               1 : START_TEST(test_mmp_des5)
    2102                 : {
    2103               1 :         const char*        tmp = "ala ma kot";
    2104               1 :         char*              pom = INITPTR;
    2105               1 :         MinSectionParser* msp = mmp_create( 10 );
    2106               1 :         mmp_set_data(msp,tmp,&tmp[0],10);
    2107               1 :         pom = mmp_des(msp);
    2108               1 :         fail_unless( strlen(pom) == 10
    2109                 :                    , "Wrong length of returned data [%d]"
    2110                 :                    , strlen(pom) );
    2111                 : 
    2112               1 :         mmp_destroy(&msp);
    2113                 : }
    2114               1 : END_TEST
    2115                 : /* ------------------------------------------------------------------------- */
    2116               1 : START_TEST(test_mmp_des6)
    2117                 : {
    2118               1 :         const char*        tmp = "ala ma kot";
    2119               1 :         char*              pom = INITPTR;
    2120               1 :         MinSectionParser* msp = mmp_create( 10 );
    2121               1 :         mmp_set_data(msp,tmp,&tmp[0],10);
    2122               1 :         pom = mmp_des(msp);
    2123               1 :         fail_unless( strcmp(pom,"ala ma kot") == 0
    2124                 :                    , "Wrong content of returned data [%s]"
    2125                 :                    , pom );
    2126               1 :         mmp_destroy(&msp);
    2127                 : }
    2128               1 : END_TEST
    2129                 : /* ------------------------------------------------------------------------- */
    2130               1 : START_TEST(test_mmp_parse_start_and_end_pos)
    2131                 : {
    2132               1 :         MinSectionParser* msp       = INITPTR;
    2133               1 :         const char*        tmp       = "# -- -- -- -- -- -- -- -- -- -- -- -- \n\
    2134                 :                                         [Engine_Defaults]                     \n\
    2135                 :                                         TestReportMode= FullReport            \n\
    2136                 :                                         CreateTestReport= YES                 \n\
    2137                 :                                         TestReportFilePath= /home/maemo       \n\
    2138                 :                                         TestReportFileName= TestReport        \n\
    2139                 :                                         TestReportFormat= TXT                 \n\
    2140                 :                                         TestReportOutput= FILE                \n\
    2141                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    2142                 :                                         [End_Defaults]                        \n\
    2143                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    2144               1 :         int                retval    = 0;
    2145               1 :         char*              start_pos = NULL;
    2146               1 :         char*              end_pos   = NULL;
    2147               1 :         int                length    = 5;
    2148                 : 
    2149               1 :         retval = mmp_parse_start_and_end_pos( msp
    2150                 :                                             , tmp
    2151                 :                                             , "[Engine_Defaults]"
    2152                 :                                             , ESNoTag
    2153                 :                                             , &start_pos
    2154                 :                                             , &end_pos
    2155                 :                                             , &length );
    2156                 : 
    2157               1 :         fail_unless( retval == -1
    2158                 :                    , "Returned value is inproper [%d]"
    2159                 :                    , retval );
    2160                 : 
    2161               1 :         mmp_destroy(&msp);
    2162                 : }
    2163               1 : END_TEST
    2164                 : /* ------------------------------------------------------------------------- */
    2165               1 : START_TEST(test_mmp_parse_start_and_end_pos2)
    2166                 : {
    2167               1 :         MinSectionParser* msp       = INITPTR;
    2168               1 :         const char*        tmp       = "# -- -- -- -- -- -- -- -- -- -- -- -- \n\
    2169                 :                                         [Engine_Defaults]                     \n\
    2170                 :                                         TestReportMode= FullReport            \n\
    2171                 :                                         CreateTestReport= YES                 \n\
    2172                 :                                         TestReportFilePath= /home/maemo       \n\
    2173                 :                                         TestReportFileName= TestReport        \n\
    2174                 :                                         TestReportFormat= TXT                 \n\
    2175                 :                                         TestReportOutput= FILE                \n\
    2176                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    2177                 :                                         [End_Defaults]                        \n\
    2178                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    2179               1 :         int                retval    = 0;
    2180               1 :         char*              start_pos = NULL;
    2181               1 :         char*              end_pos   = NULL;
    2182               1 :         int                length    = 5;
    2183                 : 
    2184               1 :         retval = mmp_parse_start_and_end_pos( msp
    2185                 :                                             , tmp
    2186                 :                                             , "[Engine_Defaults]"
    2187                 :                                             , ESNoTag
    2188                 :                                             , &start_pos
    2189                 :                                             , &end_pos
    2190                 :                                             , &length );
    2191                 : 
    2192               1 :         fail_unless( start_pos == INITPTR
    2193                 :                    , "start_pos != INITPTR" );
    2194                 : 
    2195               1 :         mmp_destroy(&msp);
    2196                 : }
    2197               1 : END_TEST
    2198                 : /* ------------------------------------------------------------------------- */
    2199               1 : START_TEST(test_mmp_parse_start_and_end_pos3)
    2200                 : {
    2201               1 :         MinSectionParser* msp       = INITPTR;
    2202               1 :         const char*        tmp       = "# -- -- -- -- -- -- -- -- -- -- -- -- \n\
    2203                 :                                         [Engine_Defaults]                     \n\
    2204                 :                                         TestReportMode= FullReport            \n\
    2205                 :                                         CreateTestReport= YES                 \n\
    2206                 :                                         TestReportFilePath= /home/maemo       \n\
    2207                 :                                         TestReportFileName= TestReport        \n\
    2208                 :                                         TestReportFormat= TXT                 \n\
    2209                 :                                         TestReportOutput= FILE                \n\
    2210                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    2211                 :                                         [End_Defaults]                        \n\
    2212                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    2213               1 :         int                retval    = 0;
    2214               1 :         char*              start_pos = NULL;
    2215               1 :         char*              end_pos   = NULL;
    2216               1 :         int                length    = 5;
    2217                 : 
    2218               1 :         retval = mmp_parse_start_and_end_pos( msp
    2219                 :                                             , tmp
    2220                 :                                             , "[Engine_Defaults]"
    2221                 :                                             , ESNoTag
    2222                 :                                             , &start_pos
    2223                 :                                             , &end_pos
    2224                 :                                             , &length );
    2225                 : 
    2226               1 :         fail_unless( end_pos == INITPTR
    2227                 :                    , "end_pos != INITPTR" );
    2228                 : 
    2229               1 :         mmp_destroy(&msp);
    2230                 : }
    2231               1 : END_TEST
    2232                 : /* ------------------------------------------------------------------------- */
    2233               1 : START_TEST(test_mmp_parse_start_and_end_pos4)
    2234                 : {
    2235               1 :         MinSectionParser* msp       = INITPTR;
    2236               1 :         const char*        tmp       = "# -- -- -- -- -- -- -- -- -- -- -- -- \n\
    2237                 :                                         [Engine_Defaults]                     \n\
    2238                 :                                         TestReportMode= FullReport            \n\
    2239                 :                                         CreateTestReport= YES                 \n\
    2240                 :                                         TestReportFilePath= /home/maemo       \n\
    2241                 :                                         TestReportFileName= TestReport        \n\
    2242                 :                                         TestReportFormat= TXT                 \n\
    2243                 :                                         TestReportOutput= FILE                \n\
    2244                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    2245                 :                                         [End_Defaults]                        \n\
    2246                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    2247               1 :         int                retval    = 0;
    2248               1 :         char*              start_pos = NULL;
    2249               1 :         char*              end_pos   = NULL;
    2250               1 :         int                length    = 5;
    2251                 : 
    2252               1 :         retval = mmp_parse_start_and_end_pos( msp
    2253                 :                                             , tmp
    2254                 :                                             , "[Engine_Defaults]"
    2255                 :                                             , ESNoTag
    2256                 :                                             , &start_pos
    2257                 :                                             , &end_pos
    2258                 :                                             , &length );
    2259                 : 
    2260               1 :         fail_unless( length == 0
    2261                 :                    , "length != 0 [%d]"
    2262                 :                    , length );
    2263                 : 
    2264               1 :         mmp_destroy(&msp);
    2265                 : }
    2266               1 : END_TEST
    2267                 : /* ------------------------------------------------------------------------- */
    2268               1 : START_TEST(test_mmp_parse_start_and_end_pos5)
    2269                 : {
    2270               1 :         MinSectionParser* msp       = INITPTR;
    2271               1 :         const char*        tmp       = INITPTR;
    2272               1 :         int                retval    = 0;
    2273               1 :         char*              start_pos = NULL;
    2274               1 :         char*              end_pos   = NULL;
    2275               1 :         int                length    = 5;
    2276                 : 
    2277               1 :         retval = mmp_parse_start_and_end_pos( msp
    2278                 :                                             , tmp
    2279                 :                                             , "[Engine_Defaults]"
    2280                 :                                             , ESNoTag
    2281                 :                                             , &start_pos
    2282                 :                                             , &end_pos
    2283                 :                                             , &length );
    2284                 : 
    2285               1 :         fail_unless( retval == -1
    2286                 :                    , "Returned value is inproper [%d]"
    2287                 :                    , retval );
    2288                 : 
    2289               1 :         mmp_destroy(&msp);
    2290                 : }
    2291               1 : END_TEST
    2292                 : /* ------------------------------------------------------------------------- */
    2293               1 : START_TEST(test_mmp_parse_start_and_end_pos6)
    2294                 : {
    2295               1 :         MinSectionParser* msp       = INITPTR;
    2296               1 :         const char*        tmp       = INITPTR;
    2297               1 :         int                retval    = 0;
    2298               1 :         char*              start_pos = NULL;
    2299               1 :         char*              end_pos   = NULL;
    2300               1 :         int                length    = 5;
    2301                 : 
    2302               1 :         retval = mmp_parse_start_and_end_pos( msp
    2303                 :                                             , tmp
    2304                 :                                             , "[Engine_Defaults]"
    2305                 :                                             , ESNoTag
    2306                 :                                             , &start_pos
    2307                 :                                             , &end_pos
    2308                 :                                             , &length );
    2309                 : 
    2310               1 :         fail_unless( start_pos == INITPTR
    2311                 :                    , "start_pos != INITPTR" );
    2312                 : 
    2313               1 :         mmp_destroy(&msp);
    2314                 : }
    2315               1 : END_TEST
    2316                 : /* ------------------------------------------------------------------------- */
    2317               1 : START_TEST(test_mmp_parse_start_and_end_pos7)
    2318                 : {
    2319               1 :         MinSectionParser* msp       = INITPTR;
    2320               1 :         const char*        tmp       = INITPTR;
    2321               1 :         int                retval    = 0;
    2322               1 :         char*              start_pos = NULL;
    2323               1 :         char*              end_pos   = NULL;
    2324               1 :         int                length    = 5;
    2325                 : 
    2326               1 :         retval = mmp_parse_start_and_end_pos( msp
    2327                 :                                             , tmp
    2328                 :                                             , "[Engine_Defaults]"
    2329                 :                                             , ESNoTag
    2330                 :                                             , &start_pos
    2331                 :                                             , &end_pos
    2332                 :                                             , &length );
    2333                 : 
    2334               1 :         fail_unless( end_pos == INITPTR
    2335                 :                    , "end_pos != INITPTR" );
    2336                 : 
    2337               1 :         mmp_destroy(&msp);
    2338                 : }
    2339               1 : END_TEST
    2340                 : /* ------------------------------------------------------------------------- */
    2341               1 : START_TEST(test_mmp_parse_start_and_end_pos8)
    2342                 : {
    2343               1 :         MinSectionParser* msp       = INITPTR;
    2344               1 :         const char*        tmp       = INITPTR;
    2345               1 :         int                retval    = 0;
    2346               1 :         char*              start_pos = NULL;
    2347               1 :         char*              end_pos   = NULL;
    2348               1 :         int                length    = 5;
    2349                 : 
    2350               1 :         retval = mmp_parse_start_and_end_pos( msp
    2351                 :                                             , tmp
    2352                 :                                             , "[Engine_Defaults]"
    2353                 :                                             , ESNoTag
    2354                 :                                             , &start_pos
    2355                 :                                             , &end_pos
    2356                 :                                             , &length );
    2357                 : 
    2358               1 :         fail_unless( length == 0
    2359                 :                    , "length != 0 [%d]"
    2360                 :                    , length );
    2361                 : 
    2362               1 :         mmp_destroy(&msp);
    2363                 : }
    2364               1 : END_TEST
    2365                 : /* ------------------------------------------------------------------------- */
    2366               1 : START_TEST(test_mmp_parse_start_and_end_pos9)
    2367                 : {
    2368               1 :         MinSectionParser* msp       = INITPTR;
    2369               1 :         const char*        tmp       = INITPTR;
    2370               1 :         int                retval    = 0;
    2371               1 :         char*              start_pos = NULL;
    2372               1 :         char*              end_pos   = NULL;
    2373               1 :         int                length    = 5;
    2374                 : 
    2375               1 :         retval = mmp_parse_start_and_end_pos( NULL
    2376                 :                                             , NULL
    2377                 :                                             , INITPTR
    2378                 :                                             , ESNoTag
    2379                 :                                             , &start_pos
    2380                 :                                             , &end_pos
    2381                 :                                             , &length );
    2382                 : 
    2383               1 :         fail_unless( retval == -1
    2384                 :                    , "Returned value is inproper [%d]"
    2385                 :                    , retval );
    2386                 : 
    2387               1 :         mmp_destroy(&msp);
    2388                 : }
    2389               1 : END_TEST
    2390                 : /* ------------------------------------------------------------------------- */
    2391               1 : START_TEST(test_mmp_parse_start_and_end_pos10)
    2392                 : {
    2393               1 :         MinSectionParser* msp       = INITPTR;
    2394               1 :         const char*        tmp       = INITPTR;
    2395               1 :         int                retval    = 0;
    2396               1 :         char*              start_pos = NULL;
    2397               1 :         char*              end_pos   = NULL;
    2398               1 :         int                length    = 5;
    2399                 : 
    2400               1 :         retval = mmp_parse_start_and_end_pos( NULL
    2401                 :                                             , NULL
    2402                 :                                             , INITPTR
    2403                 :                                             , ESNoTag
    2404                 :                                             , &start_pos
    2405                 :                                             , &end_pos
    2406                 :                                             , &length );
    2407                 : 
    2408               1 :         fail_unless( start_pos == INITPTR
    2409                 :                    , "start_pos != INITPTR" );
    2410                 : 
    2411               1 :         mmp_destroy(&msp);
    2412                 : }
    2413               1 : END_TEST
    2414                 : /* ------------------------------------------------------------------------- */
    2415               1 : START_TEST(test_mmp_parse_start_and_end_pos11)
    2416                 : {
    2417               1 :         MinSectionParser* msp       = INITPTR;
    2418               1 :         const char*        tmp       = INITPTR;
    2419               1 :         int                retval    = 0;
    2420               1 :         char*              start_pos = NULL;
    2421               1 :         char*              end_pos   = NULL;
    2422               1 :         int                length    = 5;
    2423                 : 
    2424               1 :         retval = mmp_parse_start_and_end_pos( NULL
    2425                 :                                             , NULL
    2426                 :                                             , INITPTR
    2427                 :                                             , ESNoTag
    2428                 :                                             , &start_pos
    2429                 :                                             , &end_pos
    2430                 :                                             , &length );
    2431                 : 
    2432               1 :         fail_unless( end_pos == INITPTR
    2433                 :                    , "end_pos != INITPTR" );
    2434                 : 
    2435               1 :         mmp_destroy(&msp);
    2436                 : }
    2437               1 : END_TEST
    2438                 : /* ------------------------------------------------------------------------- */
    2439               1 : START_TEST(test_mmp_parse_start_and_end_pos12)
    2440                 : {
    2441               1 :         MinSectionParser* msp       = INITPTR;
    2442               1 :         const char*        tmp       = INITPTR;
    2443               1 :         int                retval    = 0;
    2444               1 :         char*              start_pos = NULL;
    2445               1 :         char*              end_pos   = NULL;
    2446               1 :         int                length    = 5;
    2447                 : 
    2448               1 :         retval = mmp_parse_start_and_end_pos( NULL
    2449                 :                                             , NULL
    2450                 :                                             , INITPTR
    2451                 :                                             , ESNoTag
    2452                 :                                             , &start_pos
    2453                 :                                             , &end_pos
    2454                 :                                             , &length );
    2455                 : 
    2456               1 :         fail_unless( length == 0
    2457                 :                    , "length != 0 [%d]"
    2458                 :                    , length );
    2459                 : 
    2460               1 :         mmp_destroy(&msp);
    2461                 : }
    2462               1 : END_TEST
    2463                 : /* ------------------------------------------------------------------------- */
    2464               1 : START_TEST(test_mmp_parse_start_and_end_pos13)
    2465                 : {
    2466               1 :         MinSectionParser* msp       = mmp_create(256);
    2467               1 :         const char*        tmp       = "# -- -- -- -- -- -- -- -- -- -- -- -- \n\
    2468                 :                                         [Engine_Defaults]                     \n\
    2469                 :                                         TestReportMode= FullReport            \n\
    2470                 :                                         CreateTestReport= YES                 \n\
    2471                 :                                         TestReportFilePath= /home/maemo       \n\
    2472                 :                                         TestReportFileName= TestReport        \n\
    2473                 :                                         TestReportFormat= TXT                 \n\
    2474                 :                                         TestReportOutput= FILE                \n\
    2475                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    2476                 :                                         [End_Defaults]                        \n\
    2477                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    2478               1 :         int                retval    = 0;
    2479               1 :         char*              start_pos = INITPTR;
    2480               1 :         char*              end_pos   = INITPTR;
    2481               1 :         int                length    = 0;
    2482                 : 
    2483               1 :         retval = mmp_parse_start_and_end_pos( msp
    2484                 :                                             , tmp
    2485                 :                                             , "[Engine_Defaults]"
    2486                 :                                             , ESNoTag
    2487                 :                                             , &start_pos
    2488                 :                                             , &end_pos
    2489                 :                                             , &length );
    2490                 : 
    2491               1 :         fail_unless( retval == 0
    2492                 :                    , "retval != 0 [%d]"
    2493                 :                    , retval );
    2494                 : 
    2495               1 :         mmp_destroy(&msp);
    2496                 : }
    2497               1 : END_TEST
    2498                 : /* ------------------------------------------------------------------------- */
    2499               1 : START_TEST(test_mmp_parse_start_and_end_pos14)
    2500                 : {
    2501               1 :         MinSectionParser* msp       = mmp_create(256);
    2502               1 :         const char*        tmp       = "# -- -- -- -- -- -- -- -- -- -- -- -- \n\
    2503                 :                                         [Engine_Defaults]                     \n\
    2504                 :                                         TestReportMode= FullReport            \n\
    2505                 :                                         CreateTestReport= YES                 \n\
    2506                 :                                         TestReportFilePath= /home/maemo       \n\
    2507                 :                                         TestReportFileName= TestReport        \n\
    2508                 :                                         TestReportFormat= TXT                 \n\
    2509                 :                                         TestReportOutput= FILE                \n\
    2510                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    2511                 :                                         [End_Defaults]                        \n\
    2512                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    2513               1 :         int                retval    = 0;
    2514               1 :         char*              start_pos = INITPTR;
    2515               1 :         char*              end_pos   = INITPTR;
    2516               1 :         int                length    = 0;
    2517                 : 
    2518               1 :         retval = mmp_parse_start_and_end_pos( msp
    2519                 :                                             , tmp
    2520                 :                                             , "[Engine_Defaults]"
    2521                 :                                             , ESNoTag
    2522                 :                                             , &start_pos
    2523                 :                                             , &end_pos
    2524                 :                                             , &length );
    2525                 : 
    2526               1 :         fail_unless( start_pos != INITPTR
    2527                 :                    , "start_tag == INITPTR" );
    2528                 : 
    2529               1 :         mmp_destroy(&msp);
    2530                 : }
    2531               1 : END_TEST
    2532                 : /* ------------------------------------------------------------------------- */
    2533               1 : START_TEST(test_mmp_parse_start_and_end_pos15)
    2534                 : {
    2535               1 :         MinSectionParser* msp       = mmp_create(256);
    2536               1 :         const char*        tmp       = "# -- -- -- -- -- -- -- -- -- -- -- -- \n\
    2537                 :                                         [Engine_Defaults]                     \n\
    2538                 :                                         TestReportMode= FullReport            \n\
    2539                 :                                         CreateTestReport= YES                 \n\
    2540                 :                                         TestReportFilePath= /home/maemo       \n\
    2541                 :                                         TestReportFileName= TestReport        \n\
    2542                 :                                         TestReportFormat= TXT                 \n\
    2543                 :                                         TestReportOutput= FILE                \n\
    2544                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    2545                 :                                         [End_Defaults]                        \n\
    2546                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    2547               1 :         int                retval    = 0;
    2548               1 :         char*              start_pos = INITPTR;
    2549               1 :         char*              end_pos   = INITPTR;
    2550               1 :         int                length    = 0;
    2551                 : 
    2552               1 :         retval = mmp_parse_start_and_end_pos( msp
    2553                 :                                             , tmp
    2554                 :                                             , "[Engine_Defaults]"
    2555                 :                                             , ESNoTag
    2556                 :                                             , &start_pos
    2557                 :                                             , &end_pos
    2558                 :                                             , &length );
    2559                 : 
    2560               1 :         fail_unless( end_pos != INITPTR
    2561                 :                    , "end_tag == INITPTR" );
    2562                 : 
    2563               1 :         mmp_destroy(&msp);
    2564                 : }
    2565               1 : END_TEST
    2566                 : /* ------------------------------------------------------------------------- */
    2567               1 : START_TEST(test_mmp_parse_start_and_end_pos16)
    2568                 : {
    2569               1 :         MinSectionParser* msp       = mmp_create(256);
    2570               1 :         const char*        tmp       = "# -- -- -- -- -- -- -- -- -- -- -- -- \n\
    2571                 :                                         [Engine_Defaults]                     \n\
    2572                 :                                         TestReportMode= FullReport            \n\
    2573                 :                                         CreateTestReport= YES                 \n\
    2574                 :                                         TestReportFilePath= /home/maemo       \n\
    2575                 :                                         TestReportFileName= TestReport        \n\
    2576                 :                                         TestReportFormat= TXT                 \n\
    2577                 :                                         TestReportOutput= FILE                \n\
    2578                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    2579                 :                                         [End_Defaults]                        \n\
    2580                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    2581               1 :         int                retval    = 0;
    2582               1 :         char*              start_pos = INITPTR;
    2583               1 :         char*              end_pos   = INITPTR;
    2584               1 :         int                length    = 0;
    2585                 : 
    2586               1 :         retval = mmp_parse_start_and_end_pos( msp
    2587                 :                                             , tmp
    2588                 :                                             , "[Engine_Defaults]"
    2589                 :                                             , ESNoTag
    2590                 :                                             , &start_pos
    2591                 :                                             , &end_pos
    2592                 :                                             , &length );
    2593                 : 
    2594               1 :         fail_unless( length != 0
    2595                 :                    , "length == 0" );
    2596                 : 
    2597               1 :         mmp_destroy(&msp);
    2598                 : }
    2599               1 : END_TEST
    2600                 : /* ------------------------------------------------------------------------- */
    2601               1 : START_TEST(test_mmp_parse_start_and_end_pos17)
    2602                 : {
    2603               1 :         MinSectionParser* msp       = mmp_create(256);
    2604               1 :         const char*        tmp       = "# -- -- -- -- -- -- -- -- -- -- -- -- \n\
    2605                 :                                         TestReportMode= FullReport            \n\
    2606                 :                                         CreateTestReport= YES                 \n\
    2607                 :                                         TestReportFilePath= /home/maemo       \n\
    2608                 :                                         TestReportFileName= TestReport        \n\
    2609                 :                                         TestReportFormat= TXT                 \n\
    2610                 :                                         TestReportOutput= FILE                \n\
    2611                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    2612                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    2613               1 :         const char*        expected  = "= FullReport            \n\
    2614                 :                                         CreateTestReport= YES                 \n\
    2615                 :                                         TestReportFilePath= /home/maemo       \n\
    2616                 :                                         TestReportFileName= TestReport        \n\
    2617                 :                                         TestReportFormat= TXT                 \n\
    2618                 :                                         TestReportOutput= FILE                \n\
    2619                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    2620                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    2621               1 :         int                retval    = 0;
    2622               1 :         char*              start_pos = INITPTR;
    2623               1 :         char*              end_pos   = INITPTR;
    2624               1 :         int                length    = 0;
    2625                 : 
    2626               1 :         retval = mmp_parse_start_and_end_pos( msp
    2627                 :                                             , tmp
    2628                 :                                             , "TestReportMode"
    2629                 :                                             , ESNoTag
    2630                 :                                             , &start_pos
    2631                 :                                             , &end_pos
    2632                 :                                             , &length );
    2633                 : 
    2634               1 :         fail_unless( strcmp(start_pos,expected) == 0
    2635                 :                    , "start_tag differs from expected [%s]"
    2636                 :                    , start_pos );
    2637                 : 
    2638               1 :         mmp_destroy(&msp);
    2639                 : }
    2640               1 : END_TEST
    2641                 : /* ------------------------------------------------------------------------- */
    2642               1 : START_TEST(test_mmp_parse_start_and_end_pos18)
    2643                 : {
    2644               1 :         MinSectionParser* msp       = mmp_create(256);
    2645               1 :         const char*        tmp       = "# -- -- -- -- -- -- -- -- -- -- -- -- \n\
    2646                 :                                         TestReportMode= FullReport            \n\
    2647                 :                                         CreateTestReport= YES                 \n\
    2648                 :                                         TestReportFilePath= /home/maemo       \n\
    2649                 :                                         TestReportFileName= TestReport        \n\
    2650                 :                                         TestReportFormat= TXT                 \n\
    2651                 :                                         TestReportOutput= FILE                \n\
    2652                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    2653                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    2654               1 :         const char*        expected  = "t            \n\
    2655                 :                                         CreateTestReport= YES                 \n\
    2656                 :                                         TestReportFilePath= /home/maemo       \n\
    2657                 :                                         TestReportFileName= TestReport        \n\
    2658                 :                                         TestReportFormat= TXT                 \n\
    2659                 :                                         TestReportOutput= FILE                \n\
    2660                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    2661                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    2662               1 :         int                retval    = 0;
    2663               1 :         char*              start_pos = INITPTR;
    2664               1 :         char*              end_pos   = INITPTR;
    2665               1 :         int                length    = 0;
    2666                 : 
    2667               1 :         retval = mmp_parse_start_and_end_pos( msp
    2668                 :                                             , tmp
    2669                 :                                             , "TestReportMode"
    2670                 :                                             , ESNoTag
    2671                 :                                             , &start_pos
    2672                 :                                             , &end_pos
    2673                 :                                             , &length );
    2674                 : 
    2675               1 :         fail_unless( strcmp(end_pos,expected) == 0
    2676                 :                    , "end_pos differs from expected [%s]"
    2677                 :                    , end_pos );
    2678                 : 
    2679               1 :         mmp_destroy(&msp);
    2680                 : }
    2681               1 : END_TEST
    2682                 : /* ------------------------------------------------------------------------- */
    2683               1 : START_TEST(test_mmp_parse_start_and_end_pos19)
    2684                 : {
    2685               1 :         MinSectionParser* msp       = mmp_create(256);
    2686               1 :         const char*        tmp       = "# -- -- -- -- -- -- -- -- -- -- -- -- \n\
    2687                 :                                         TestReportMode= FullReport            \n\
    2688                 :                                         CreateTestReport= YES                 \n\
    2689                 :                                         TestReportFilePath= /home/maemo       \n\
    2690                 :                                         TestReportFileName= TestReport        \n\
    2691                 :                                         TestReportFormat= TXT                 \n\
    2692                 :                                         TestReportOutput= FILE                \n\
    2693                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    2694                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    2695               1 :         const char*        expected  = "TestReportMode= FullReport            \n\
    2696                 :                                         CreateTestReport= YES                 \n\
    2697                 :                                         TestReportFilePath= /home/maemo       \n\
    2698                 :                                         TestReportFileName= TestReport        \n\
    2699                 :                                         TestReportFormat= TXT                 \n\
    2700                 :                                         TestReportOutput= FILE                \n\
    2701                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    2702                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    2703               1 :         int                retval    = 0;
    2704               1 :         char*              start_pos = INITPTR;
    2705               1 :         char*              end_pos   = INITPTR;
    2706               1 :         int                length    = 0;
    2707                 : 
    2708               1 :         retval = mmp_parse_start_and_end_pos( msp
    2709                 :                                             , tmp
    2710                 :                                             , "TestReportMode"
    2711                 :                                             , ESTag
    2712                 :                                             , &start_pos
    2713                 :                                             , &end_pos
    2714                 :                                             , &length );
    2715                 : 
    2716               1 :         fail_unless( strcmp(start_pos,expected) == 0
    2717                 :                    , "start_tag differs from expected [%s]"
    2718                 :                    , start_pos );
    2719                 : 
    2720               1 :         mmp_destroy(&msp);
    2721                 : }
    2722               1 : END_TEST
    2723                 : /* ------------------------------------------------------------------------- */
    2724               1 : START_TEST(test_mmp_parse_start_and_end_pos20)
    2725                 : {
    2726               1 :         MinSectionParser* msp       = mmp_create(256);
    2727               1 :         const char*        tmp       = "# -- -- -- -- -- -- -- -- -- -- -- -- \n\
    2728                 :                                         TestReportMode= FullReport            \n\
    2729                 :                                         CreateTestReport= YES                 \n\
    2730                 :                                         TestReportFilePath= /home/maemo       \n\
    2731                 :                                         TestReportFileName= TestReport        \n\
    2732                 :                                         TestReportFormat= TXT                 \n\
    2733                 :                                         TestReportOutput= FILE                \n\
    2734                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    2735                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    2736               1 :         const char*        expected  = "t            \n\
    2737                 :                                         CreateTestReport= YES                 \n\
    2738                 :                                         TestReportFilePath= /home/maemo       \n\
    2739                 :                                         TestReportFileName= TestReport        \n\
    2740                 :                                         TestReportFormat= TXT                 \n\
    2741                 :                                         TestReportOutput= FILE                \n\
    2742                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    2743                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    2744               1 :         int                retval    = 0;
    2745               1 :         char*              start_pos = INITPTR;
    2746               1 :         char*              end_pos   = INITPTR;
    2747               1 :         int                length    = 0;
    2748                 : 
    2749               1 :         retval = mmp_parse_start_and_end_pos( msp
    2750                 :                                             , tmp
    2751                 :                                             , "TestReportMode"
    2752                 :                                             , ESTag
    2753                 :                                             , &start_pos
    2754                 :                                             , &end_pos
    2755                 :                                             , &length );
    2756                 : 
    2757               1 :         fail_unless( strcmp(end_pos,expected) == 0
    2758                 :                    , "end_pos differs from expected [%s]"
    2759                 :                    , end_pos );
    2760                 : 
    2761               1 :         mmp_destroy(&msp);
    2762                 : }
    2763               1 : END_TEST
    2764                 : /* ------------------------------------------------------------------------- */
    2765               1 : START_TEST(test_mmp_parse_start_and_end_pos21)
    2766                 : {
    2767               1 :         MinSectionParser* msp       = mmp_create(256);
    2768               1 :         const char*        tmp       = "CreateTestReport= YES                 \n\
    2769                 :                                         TestReportFilePath= /home/maemo       \n\
    2770                 :                                         TestReportFileName= TestReport        \n\
    2771                 :                                         TestReportFormat= TXT                 \n\
    2772                 :                                         TestReportOutput= FILE                \n\
    2773                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    2774                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    2775               1 :         const char*        expected  = "CreateTestReport= YES                 \n\
    2776                 :                                         TestReportFilePath= /home/maemo       \n\
    2777                 :                                         TestReportFileName= TestReport        \n\
    2778                 :                                         TestReportFormat= TXT                 \n\
    2779                 :                                         TestReportOutput= FILE                \n\
    2780                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    2781                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    2782               1 :         int                retval    = 0;
    2783               1 :         char*              start_pos = INITPTR;
    2784               1 :         char*              end_pos   = INITPTR;
    2785               1 :         int                length    = 0;
    2786                 : 
    2787               1 :         retval = mmp_parse_start_and_end_pos( msp
    2788                 :                                             , tmp
    2789                 :                                             , ""
    2790                 :                                             , ESNoTag
    2791                 :                                             , &start_pos
    2792                 :                                             , &end_pos
    2793                 :                                             , &length );
    2794                 : 
    2795               1 :         fail_unless( strcmp(start_pos,expected) == 0
    2796                 :                    , "start_tag differs from expected [%s]"
    2797                 :                    , start_pos );
    2798                 : 
    2799               1 :         mmp_destroy(&msp);
    2800                 : }
    2801               1 : END_TEST
    2802                 : /* ------------------------------------------------------------------------- */
    2803               1 : START_TEST(test_mmp_parse_start_and_end_pos22)
    2804                 : {
    2805               1 :         MinSectionParser* msp       = mmp_create(256);
    2806               1 :         const char*        tmp       = "CreateTestReport= YES                 \n\
    2807                 :                                         TestReportFilePath= /home/maemo       \n\
    2808                 :                                         TestReportFileName= TestReport        \n\
    2809                 :                                         TestReportFormat= TXT                 \n\
    2810                 :                                         TestReportOutput= FILE                \n\
    2811                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    2812                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    2813               1 :         const char*        expected  = "S                 \n\
    2814                 :                                         TestReportFilePath= /home/maemo       \n\
    2815                 :                                         TestReportFileName= TestReport        \n\
    2816                 :                                         TestReportFormat= TXT                 \n\
    2817                 :                                         TestReportOutput= FILE                \n\
    2818                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    2819                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    2820               1 :         int                retval    = 0;
    2821               1 :         char*              start_pos = INITPTR;
    2822               1 :         char*              end_pos   = INITPTR;
    2823               1 :         int                length    = 0;
    2824                 : 
    2825               1 :         retval = mmp_parse_start_and_end_pos( msp
    2826                 :                                             , tmp
    2827                 :                                             , ""
    2828                 :                                             , ESNoTag
    2829                 :                                             , &start_pos
    2830                 :                                             , &end_pos
    2831                 :                                             , &length );
    2832                 : 
    2833               1 :         fail_unless( strcmp(end_pos,expected) == 0
    2834                 :                    , "end_pos differs from expected [%s]"
    2835                 :                    , end_pos );
    2836                 : 
    2837               1 :         mmp_destroy(&msp);
    2838                 : }
    2839               1 : END_TEST
    2840                 : /* ------------------------------------------------------------------------- */
    2841               1 : START_TEST(test_mmp_parse_start_and_end_pos23)
    2842                 : {
    2843               1 :         MinSectionParser* msp       = mmp_create(256);
    2844               1 :         const char*        tmp       = "CreateTestReport= YES                 \n\
    2845                 :                                         TestReportFilePath= /home/maemo       \n\
    2846                 :                                         TestReportFileName= TestReport        \n\
    2847                 :                                         TestReportFormat= TXT                 \n\
    2848                 :                                         TestReportOutput= FILE                \n\
    2849                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    2850                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    2851               1 :         const char*        expected  = "CreateTestReport= YES                 \n\
    2852                 :                                         TestReportFilePath= /home/maemo       \n\
    2853                 :                                         TestReportFileName= TestReport        \n\
    2854                 :                                         TestReportFormat= TXT                 \n\
    2855                 :                                         TestReportOutput= FILE                \n\
    2856                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    2857                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    2858               1 :         int                retval    = 0;
    2859               1 :         char*              start_pos = INITPTR;
    2860               1 :         char*              end_pos   = INITPTR;
    2861               1 :         int                length    = 0;
    2862                 : 
    2863               1 :         retval = mmp_parse_start_and_end_pos( msp
    2864                 :                                             , tmp
    2865                 :                                             , ""
    2866                 :                                             , ESTag
    2867                 :                                             , &start_pos
    2868                 :                                             , &end_pos
    2869                 :                                             , &length );
    2870                 : 
    2871               1 :         fail_unless( strcmp(start_pos,expected) == 0
    2872                 :                    , "start_tag differs from expected [%s]"
    2873                 :                    , start_pos );
    2874                 : 
    2875               1 :         mmp_destroy(&msp);
    2876                 : }
    2877               1 : END_TEST
    2878                 : /* ------------------------------------------------------------------------- */
    2879               1 : START_TEST(test_mmp_parse_start_and_end_pos24)
    2880                 : {
    2881               1 :         MinSectionParser* msp       = mmp_create(256);
    2882               1 :         const char*        tmp       = "CreateTestReport= YES                 \n\
    2883                 :                                         TestReportFilePath= /home/maemo       \n\
    2884                 :                                         TestReportFileName= TestReport        \n\
    2885                 :                                         TestReportFormat= TXT                 \n\
    2886                 :                                         TestReportOutput= FILE                \n\
    2887                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    2888                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    2889               1 :         const char*        expected  = "S                 \n\
    2890                 :                                         TestReportFilePath= /home/maemo       \n\
    2891                 :                                         TestReportFileName= TestReport        \n\
    2892                 :                                         TestReportFormat= TXT                 \n\
    2893                 :                                         TestReportOutput= FILE                \n\
    2894                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    2895                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    2896               1 :         int                retval    = 0;
    2897               1 :         char*              start_pos = INITPTR;
    2898               1 :         char*              end_pos   = INITPTR;
    2899               1 :         int                length    = 0;
    2900                 : 
    2901               1 :         retval = mmp_parse_start_and_end_pos( msp
    2902                 :                                             , tmp
    2903                 :                                             , ""
    2904                 :                                             , ESTag
    2905                 :                                             , &start_pos
    2906                 :                                             , &end_pos
    2907                 :                                             , &length );
    2908                 : 
    2909               1 :         fail_unless( strcmp(end_pos,expected) == 0
    2910                 :                    , "end_pos differs from expected [%s]"
    2911                 :                    , end_pos );
    2912                 : 
    2913               1 :         mmp_destroy(&msp);
    2914                 : }
    2915               1 : END_TEST
    2916                 : /* ------------------------------------------------------------------------- */
    2917               1 : START_TEST(test_mmp_parse_start_and_end_pos25)
    2918                 : {
    2919               1 :         MinSectionParser* msp       = mmp_create(256);
    2920               1 :         const char*        tmp       = "CreateTestReport= YES                 \n\
    2921                 :                                         TestReportFilePath= /home/maemo       \n\
    2922                 :                                         TestReportFileName= TestReport        \n\
    2923                 :                                         TestReportFormat= TXT                 \n\
    2924                 :                                         TestReportOutput= FILE                \n\
    2925                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    2926                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    2927               1 :         int                retval    = 0;
    2928               1 :         char*              start_pos = INITPTR;
    2929               1 :         char*              end_pos   = INITPTR;
    2930               1 :         int                length    = 0;
    2931                 : 
    2932               1 :         retval = mmp_parse_start_and_end_pos( msp
    2933                 :                                             , tmp
    2934                 :                                             , "CreateTestReport"
    2935                 :                                             , ESTag
    2936                 :                                             , &start_pos
    2937                 :                                             , &end_pos
    2938                 :                                             , &length );
    2939                 : 
    2940               1 :         fail_unless( length == 21
    2941                 :                    , "length differs from expected [%d]"
    2942                 :                    , length );
    2943                 : 
    2944               1 :         mmp_destroy(&msp);
    2945                 : }
    2946               1 : END_TEST
    2947                 : /* ------------------------------------------------------------------------- */
    2948               1 : START_TEST(test_mmp_parse_start_and_end_pos26)
    2949                 : {
    2950               1 :         MinSectionParser* msp       = mmp_create(256);
    2951               1 :         const char*        tmp       = "CreateTestReport= YES                 \n\
    2952                 :                                         TestReportFilePath= /home/maemo       \n\
    2953                 :                                         TestReportFileName= TestReport        \n\
    2954                 :                                         TestReportFormat= TXT                 \n\
    2955                 :                                         TestReportOutput= FILE                \n\
    2956                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    2957                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    2958               1 :         int                retval    = 0;
    2959               1 :         char*              start_pos = INITPTR;
    2960               1 :         char*              end_pos   = INITPTR;
    2961               1 :         int                length    = 0;
    2962                 : 
    2963               1 :         retval = mmp_parse_start_and_end_pos( msp
    2964                 :                                             , tmp
    2965                 :                                             , "CreateTestReport"
    2966                 :                                             , ESNoTag
    2967                 :                                             , &start_pos
    2968                 :                                             , &end_pos
    2969                 :                                             , &length );
    2970                 : 
    2971               1 :         fail_unless( length == 5
    2972                 :                    , "length differs from expected [%d]"
    2973                 :                    , length );
    2974                 : 
    2975               1 :         mmp_destroy(&msp);
    2976                 : }
    2977               1 : END_TEST
    2978                 : /* ------------------------------------------------------------------------- */
    2979               1 : START_TEST(test_mmp_parse_start_and_end_pos27)
    2980                 : {
    2981               1 :         MinSectionParser* msp       = mmp_create(256);
    2982               1 :         const char*        tmp       = "CreateTestReport= YES                 \n\
    2983                 :                                         TestReportFilePath= /home/maemo       \n\
    2984                 :                                         TestReportFileName= TestReport        \n\
    2985                 :                                         TestReportFormat= TXT                 \n\
    2986                 :                                         TestReportOutput= FILE                \n\
    2987                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    2988                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    2989               1 :         int                retval    = 0;
    2990               1 :         char*              start_pos = INITPTR;
    2991               1 :         char*              end_pos   = INITPTR;
    2992               1 :         int                length    = 0;
    2993                 : 
    2994               1 :         retval = mmp_parse_start_and_end_pos( msp
    2995                 :                                             , tmp
    2996                 :                                             , "CreatmTestReport"
    2997                 :                                             , ESNoTag
    2998                 :                                             , &start_pos
    2999                 :                                             , &end_pos
    3000                 :                                             , &length );
    3001                 : 
    3002               1 :         fail_unless( length == 0
    3003                 :                    , "length differs from expected [%d]"
    3004                 :                    , length );
    3005                 : 
    3006               1 :         mmp_destroy(&msp);
    3007                 : }
    3008               1 : END_TEST
    3009                 : /* ------------------------------------------------------------------------- */
    3010               1 : START_TEST(test_mmp_parse_start_and_end_pos28)
    3011                 : {
    3012               1 :         MinSectionParser* msp       = mmp_create(256);
    3013               1 :         const char*        tmp       = "CreateTestReport= YES                 \n\
    3014                 :                                         TestReportFilePath= /home/maemo       \n\
    3015                 :                                         TestReportFileName= TestReport        \n\
    3016                 :                                         TestReportFormat= TXT                 \n\
    3017                 :                                         TestReportOutput= FILE                \n\
    3018                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    3019                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    3020               1 :         int                retval    = 0;
    3021               1 :         char*              start_pos = INITPTR;
    3022               1 :         char*              end_pos   = INITPTR;
    3023               1 :         int                length    = 0;
    3024                 : 
    3025               1 :         retval = mmp_parse_start_and_end_pos( msp
    3026                 :                                             , tmp
    3027                 :                                             , "CreatmTestReport"
    3028                 :                                             , ESNoTag
    3029                 :                                             , &start_pos
    3030                 :                                             , &end_pos
    3031                 :                                             , &length );
    3032                 : 
    3033               1 :         fail_unless( start_pos == INITPTR
    3034                 :                    , "start_pos != INITPTR" );
    3035                 : 
    3036               1 :         mmp_destroy(&msp);
    3037                 : }
    3038               1 : END_TEST
    3039                 : /* ------------------------------------------------------------------------- */
    3040               1 : START_TEST(test_mmp_parse_start_and_end_pos29)
    3041                 : {
    3042               1 :         MinSectionParser* msp       = mmp_create(256);
    3043               1 :         const char*        tmp       = "CreateTestReport= YES                 \n\
    3044                 :                                         TestReportFilePath= /home/maemo       \n\
    3045                 :                                         TestReportFileName= TestReport        \n\
    3046                 :                                         TestReportFormat= TXT                 \n\
    3047                 :                                         TestReportOutput= FILE                \n\
    3048                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    3049                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    3050               1 :         int                retval    = 0;
    3051               1 :         char*              start_pos = INITPTR;
    3052               1 :         char*              end_pos   = INITPTR;
    3053               1 :         int                length    = 0;
    3054                 : 
    3055               1 :         retval = mmp_parse_start_and_end_pos( msp
    3056                 :                                             , tmp
    3057                 :                                             , "CreatmTestReport"
    3058                 :                                             , ESNoTag
    3059                 :                                             , &start_pos
    3060                 :                                             , &end_pos
    3061                 :                                             , &length );
    3062                 : 
    3063               1 :         fail_unless( end_pos == INITPTR
    3064                 :                    , "end_pos != INITPTR" );
    3065                 : 
    3066               1 :         mmp_destroy(&msp);
    3067                 : }
    3068               1 : END_TEST
    3069                 : /* ------------------------------------------------------------------------- */
    3070               1 : START_TEST(test_mmp_parse_start_and_end_pos30)
    3071                 : {
    3072               1 :         MinSectionParser* msp       = mmp_create(256);
    3073               1 :         const char*        tmp       = "";
    3074               1 :         int                retval    = 0;
    3075               1 :         char*              start_pos = INITPTR;
    3076               1 :         char*              end_pos   = INITPTR;
    3077               1 :         int                length    = 0;
    3078                 : 
    3079               1 :         retval = mmp_parse_start_and_end_pos( msp
    3080                 :                                             , tmp
    3081                 :                                             , "CreatmTestReport"
    3082                 :                                             , ESNoTag
    3083                 :                                             , &start_pos
    3084                 :                                             , &end_pos
    3085                 :                                             , &length );
    3086                 : 
    3087               1 :         fail_unless( length == 0
    3088                 :                    , "length != 0 [%d]"
    3089                 :                    , length );
    3090                 : 
    3091               1 :         mmp_destroy(&msp);
    3092                 : }
    3093               1 : END_TEST
    3094                 : /* ------------------------------------------------------------------------- */
    3095               1 : START_TEST(test_mmp_parse_start_and_end_pos31)
    3096                 : {
    3097               1 :         MinSectionParser* msp       = mmp_create(256);
    3098               1 :         const char*        tmp       = "";
    3099               1 :         int                retval    = 0;
    3100               1 :         char*              start_pos = INITPTR;
    3101               1 :         char*              end_pos   = INITPTR;
    3102               1 :         int                length    = 0;
    3103                 : 
    3104               1 :         retval = mmp_parse_start_and_end_pos( msp
    3105                 :                                             , tmp
    3106                 :                                             , "CreatmTestReport"
    3107                 :                                             , ESNoTag
    3108                 :                                             , &start_pos
    3109                 :                                             , &end_pos
    3110                 :                                             , &length );
    3111                 : 
    3112               1 :         fail_unless( start_pos == INITPTR
    3113                 :                    , "start_pos != INITPTR" );
    3114                 : 
    3115               1 :         mmp_destroy(&msp);
    3116                 : }
    3117               1 : END_TEST
    3118                 : /* ------------------------------------------------------------------------- */
    3119               1 : START_TEST(test_mmp_parse_start_and_end_pos32)
    3120                 : {
    3121               1 :         MinSectionParser* msp       = mmp_create(256);
    3122               1 :         const char*        tmp       = "";
    3123               1 :         int                retval    = 0;
    3124               1 :         char*              start_pos = INITPTR;
    3125               1 :         char*              end_pos   = INITPTR;
    3126               1 :         int                length    = 0;
    3127                 : 
    3128               1 :         retval = mmp_parse_start_and_end_pos( msp
    3129                 :                                             , tmp
    3130                 :                                             , "CreatmTestReport"
    3131                 :                                             , ESNoTag
    3132                 :                                             , &start_pos
    3133                 :                                             , &end_pos
    3134                 :                                             , &length );
    3135                 : 
    3136               1 :         fail_unless( end_pos == INITPTR
    3137                 :                    , "end_pos != INITPTR" );
    3138                 : 
    3139               1 :         mmp_destroy(&msp);
    3140                 : }
    3141               1 : END_TEST
    3142                 : /* ------------------------------------------------------------------------- */
    3143               1 : START_TEST(test_mmp_parse_start_and_end_pos33)
    3144                 : {
    3145               1 :         MinSectionParser* msp       = mmp_create(256);
    3146               1 :         const char*        tmp       = "CreateTestReport= YES                 \n\
    3147                 :                                         TestReportFilePath= /home/maemo       \n\
    3148                 :                                         TestReportFileName= TestReport        \n\
    3149                 :                                         TestReportFormat= TXT                 \n\
    3150                 :                                         TestReportOutput= FILE                \n\
    3151                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    3152                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    3153               1 :         int                retval    = 0;
    3154               1 :         char*              start_pos = INITPTR;
    3155               1 :         char*              end_pos   = INITPTR;
    3156               1 :         int                length    = 0;
    3157               1 :         int                backup    = msp->skip_and_mark_pos_;
    3158                 : 
    3159               1 :         retval = mmp_parse_start_and_end_pos( msp
    3160                 :                                             , tmp
    3161                 :                                             , ""
    3162                 :                                             , ESTag
    3163                 :                                             , &start_pos
    3164                 :                                             , &end_pos
    3165                 :                                             , &length );
    3166                 : 
    3167               1 :         fail_unless( backup != msp->skip_and_mark_pos_
    3168                 :                    , "backup == msp->skip_and_mark_pos_ [%d]"
    3169                 :                    , msp->skip_and_mark_pos_ );
    3170                 : 
    3171               1 :         mmp_destroy(&msp);
    3172                 : }
    3173               1 : END_TEST
    3174                 : /* ------------------------------------------------------------------------- */
    3175               1 : START_TEST(test_mmp_parse_start_and_end_pos34)
    3176                 : {
    3177               1 :         MinSectionParser* msp       = mmp_create(256);
    3178               1 :         const char*        tmp       = "CreateTestReport= YES                 \n\
    3179                 :                                         TestReportFilePath= /home/maemo       \n\
    3180                 :                                         TestReportFileName= TestReport        \n\
    3181                 :                                         TestReportFormat= TXT                 \n\
    3182                 :                                         TestReportOutput= FILE                \n\
    3183                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    3184                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    3185               1 :         int                retval    = 0;
    3186               1 :         char*              start_pos = INITPTR;
    3187               1 :         char*              end_pos   = INITPTR;
    3188               1 :         int                length    = 0;
    3189               1 :         int                backup    = 0;
    3190                 : 
    3191               1 :         retval = mmp_parse_start_and_end_pos( msp
    3192                 :                                             , tmp
    3193                 :                                             , ""
    3194                 :                                             , ESTag
    3195                 :                                             , &start_pos
    3196                 :                                             , &end_pos
    3197                 :                                             , &length );
    3198               1 :         backup    = msp->skip_and_mark_pos_;
    3199               1 :         retval = mmp_parse_start_and_end_pos( msp
    3200                 :                                             , tmp
    3201                 :                                             , ""
    3202                 :                                             , ESTag
    3203                 :                                             , &start_pos
    3204                 :                                             , &end_pos
    3205                 :                                             , &length );
    3206                 : 
    3207               1 :         fail_unless( backup != msp->skip_and_mark_pos_
    3208                 :                    , "backup == msp->skip_and_mark_pos_ [%d]"
    3209                 :                    , msp->skip_and_mark_pos_ );
    3210                 : 
    3211               1 :         mmp_destroy(&msp);
    3212                 : }
    3213               1 : END_TEST
    3214                 : /* ------------------------------------------------------------------------- */
    3215               1 : START_TEST(test_mmp_parse_start_and_end_pos35)
    3216                 : {
    3217               1 :         MinSectionParser* msp       = mmp_create(256);
    3218               1 :         const char*        tmp       = "CreateTestReport= YES                 \n\
    3219                 :                                         TestReportFilePath= /home/maemo       \n\
    3220                 :                                         TestReportFileName= TestReport        \n\
    3221                 :                                         TestReportFormat= TXT                 \n\
    3222                 :                                         TestReportOutput= FILE                \n\
    3223                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    3224                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    3225               1 :         int                retval    = 0;
    3226               1 :         char*              start_pos = INITPTR;
    3227               1 :         char*              end_pos   = INITPTR;
    3228               1 :         int                length    = 0;
    3229                 : 
    3230               1 :         retval = mmp_parse_start_and_end_pos( msp
    3231                 :                                             , tmp
    3232                 :                                             , "TestReportFileCreationMode2="
    3233                 :                                             , ESNoTag
    3234                 :                                             , &start_pos
    3235                 :                                             , &end_pos
    3236                 :                                             , &length );
    3237                 : 
    3238               1 :         fail_unless( retval == 0
    3239                 :                    , "Result differs from expected [%d]"
    3240                 :                    , retval );
    3241                 : 
    3242               1 :         mmp_destroy(&msp);
    3243                 : }
    3244               1 : END_TEST
    3245                 : /* ------------------------------------------------------------------------- */
    3246               1 : START_TEST(test_mmp_parse_start_and_end_pos36)
    3247                 : {
    3248               1 :         MinSectionParser* msp       = mmp_create(256);
    3249               1 :         const char*        tmp       = "CreateTestReport= YES                 \n\
    3250                 :                                         TestReportFilePath= /home/maemo       \n\
    3251                 :                                         TestReportFileName= TestReport        \n\
    3252                 :                                         TestReportFormat= TXT                 \n\
    3253                 :                                         TestReportOutput= FILE                \n\
    3254                 :                                         TestReportFileCreationMode= OVERWRITE \n\
    3255                 :                                         # -- -- -- -- -- -- -- -- -- -- -- -- --";
    3256               1 :         int                retval    = 0;
    3257               1 :         char*              start_pos = INITPTR;
    3258               1 :         char*              end_pos   = INITPTR;
    3259               1 :         int                length    = 0;
    3260                 : 
    3261               1 :         retval = mmp_parse_start_and_end_pos( msp
    3262                 :                                             , tmp
    3263                 :                                             , "TestReportFileCreationMode="
    3264                 :                                             , ESNoTag
    3265                 :                                             , &start_pos
    3266                 :                                             , &end_pos
    3267                 :                                             , &length );
    3268                 : 
    3269               1 :         retval = mmp_parse_start_and_end_pos( msp
    3270                 :                                             , tmp
    3271                 :                                             , "TestReportFileCreationMode="
    3272                 :                                             , ESNoTag
    3273                 :                                             , &start_pos
    3274                 :                                             , &end_pos
    3275                 :                                             , &length );
    3276                 : 
    3277               1 :         fail_unless( retval == 0
    3278                 :                    , "Result differs from expected [%d]"
    3279                 :                    , retval );
    3280                 : 
    3281               1 :         mmp_destroy(&msp);
    3282                 : }
    3283               1 : END_TEST
    3284                 : /* ------------------------------------------------------------------------- */
    3285               1 : START_TEST(test_mmp_parse_start_and_end_pos37)
    3286                 : {
    3287               1 :         MinSectionParser* msp       = mmp_create(256);
    3288               1 :         const char*        tmp       = "CreateTestReport= YES                 \n\
    3289                 :                                         TestReportFilePath= /home/maemo       \n\
    3290                 :                                         TestReportFileName= TestReport        \n\
    3291                 :                                         TestReportFormat= TXT                 \n\
    3292                 :                                         TestReportOutput= FILE                \n\
    3293                 :                                         TestReportFileCreationMode= OVERWRITE";
    3294               1 :         int                retval    = 0;
    3295               1 :         char*              start_pos = INITPTR;
    3296               1 :         char*              end_pos   = INITPTR;
    3297               1 :         int                length    = 0;
    3298                 : 
    3299               1 :         retval = mmp_parse_start_and_end_pos( msp
    3300                 :                                             , tmp
    3301                 :                                             , "TestReportFileCreationMode="
    3302                 :                                             , ESNoTag
    3303                 :                                             , &start_pos
    3304                 :                                             , &end_pos
    3305                 :                                             , &length );
    3306                 : 
    3307               1 :         retval = mmp_parse_start_and_end_pos( msp
    3308                 :                                             , tmp
    3309                 :                                             , "TestReportFileCreationMode2="
    3310                 :                                             , ESNoTag
    3311                 :                                             , &start_pos
    3312                 :                                             , &end_pos
    3313                 :                                             , &length );
    3314                 : 
    3315               1 :         fail_unless( retval == 0
    3316                 :                    , "Result differs from expected [%d]"
    3317                 :                    , retval );
    3318                 : 
    3319               1 :         mmp_destroy(&msp);
    3320                 : }
    3321               1 : END_TEST
    3322                 : /* ------------------------------------------------------------------------- */
    3323               1 : START_TEST(test_mmp_parse_start_and_end_pos38)
    3324                 : {
    3325               1 :         MinSectionParser* msp       = mmp_create(256);
    3326               1 :         const char*        tmp       = "CreateTestReport= YES                 \n\
    3327                 :                                         TestReportFilePath= /home/maemo       \n\
    3328                 :                                         TestReportFileName= TestReport        \n\
    3329                 :                                         TestReportFormat= TXT                 \n\
    3330                 :                                         TestReportOutput= FILE                \n\
    3331                 :                                         TestReportFileCreationMode= OVERWRITE";
    3332               1 :         int                retval    = 0;
    3333               1 :         char*              start_pos = INITPTR;
    3334               1 :         char*              end_pos   = INITPTR;
    3335               1 :         int                length    = 0;
    3336                 : 
    3337               1 :         retval = mmp_parse_start_and_end_pos( msp
    3338                 :                                             , tmp
    3339                 :                                             , "TestReportFileCreationMode="
    3340                 :                                             , ESNoTag
    3341                 :                                             , &start_pos
    3342                 :                                             , &end_pos
    3343                 :                                             , &length );
    3344                 : 
    3345               1 :         retval = mmp_parse_start_and_end_pos( msp
    3346                 :                                             , tmp
    3347                 :                                             , "TestReportFileCreationMode2="
    3348                 :                                             , ESNoTag
    3349                 :                                             , &start_pos
    3350                 :                                             , &end_pos
    3351                 :                                             , &length );
    3352                 : 
    3353               1 :         fail_unless( length == 0
    3354                 :                    , "Result differs from expected [%d]"
    3355                 :                    , length );
    3356                 : 
    3357               1 :         mmp_destroy(&msp);
    3358                 : }
    3359               1 : END_TEST
    3360                 : /* ------------------------------------------------------------------------- */
    3361               1 : START_TEST(test_mmp_parse_start_and_end_pos39)
    3362                 : {
    3363               1 :         MinSectionParser* msp       = mmp_create(256);
    3364               1 :         const char*        tmp       = "CreateTestReport= YES                 \n\
    3365                 :                                         TestReportFilePath= /home/maemo       \n\
    3366                 :                                         TestReportFileName= TestReport        \n\
    3367                 :                                         TestReportFormat= TXT                 \n\
    3368                 :                                         TestReportOutput= FILE                \n\
    3369                 :                                         TestReportFileCreationMode= OVERWRITE";
    3370               1 :         int                retval    = 0;
    3371               1 :         char*              start_pos = INITPTR;
    3372               1 :         char*              end_pos   = INITPTR;
    3373               1 :         int                length    = 0;
    3374                 : 
    3375               1 :         retval = mmp_parse_start_and_end_pos( msp
    3376                 :                                             , tmp
    3377                 :                                             , "TestReportFileCreationMode="
    3378                 :                                             , ESNoTag
    3379                 :                                             , &start_pos
    3380                 :                                             , &end_pos
    3381                 :                                             , &length );
    3382                 : 
    3383               1 :         retval = mmp_parse_start_and_end_pos( msp
    3384                 :                                             , tmp
    3385                 :                                             , "TestReportFileCreationMode="
    3386                 :                                             , ESNoTag
    3387                 :                                             , &start_pos
    3388                 :                                             , &end_pos
    3389                 :                                             , &length );
    3390                 : 
    3391               1 :         fail_unless( length == 0
    3392                 :                    , "Result differs from expected [%d]"
    3393                 :                    , length );
    3394                 : 
    3395               1 :         mmp_destroy(&msp);
    3396                 : }
    3397               1 : END_TEST
    3398                 : /* ------------------------------------------------------------------------- */
    3399               1 : START_TEST(test_mmp_parse_start_and_end_pos40)
    3400                 : {
    3401               1 :         MinSectionParser* msp       = mmp_create(256);
    3402               1 :         const char*        tmp       = "CreateTestReport= YES                 \n\
    3403                 :                                         TestReportFilePath= /home/maemo       \n\
    3404                 :                                         TestReportFileName= TestReport        \n\
    3405                 :                                         TestReportFormat= TXT                 \n\
    3406                 :                                         TestReportOutput= FILE                \n\
    3407                 :                                         TestReportFileCreationMode= OVERWRITE";
    3408               1 :         int                retval    = 0;
    3409               1 :         char*              start_pos = INITPTR;
    3410               1 :         char*              end_pos   = INITPTR;
    3411               1 :         int                length    = 0;
    3412                 : 
    3413               1 :         retval = mmp_parse_start_and_end_pos( msp
    3414                 :                                             , tmp
    3415                 :                                             , "TestReportFileCreationMode2="
    3416                 :                                             , ESNoTag
    3417                 :                                             , &start_pos
    3418                 :                                             , &end_pos
    3419                 :                                             , &length );
    3420               1 :         fail_unless( length == 0
    3421                 :                    , "Result differs from expected [%d]"
    3422                 :                    , length );
    3423                 : 
    3424               1 :         mmp_destroy(&msp);
    3425                 : }
    3426               1 : END_TEST
    3427                 : /* ------------------------------------------------------------------------- */
    3428               1 : START_TEST(test_mmp_goto_end_of_line)
    3429                 : {
    3430               1 :         char*              c1  = INITPTR;
    3431               1 :         char*              c2  = INITPTR;
    3432               1 :         MinSectionParser* msp = INITPTR;
    3433                 : 
    3434               1 :         c1 = mmp_goto_end_of_line(msp,&c2);
    3435                 : 
    3436               1 :         fail_unless( c1 == INITPTR
    3437                 :                    , "returned value is not INITPTR" );
    3438                 : 
    3439               1 :         mmp_destroy(&msp);
    3440               1 : }END_TEST
    3441                 : /* ------------------------------------------------------------------------- */
    3442               1 : START_TEST(test_mmp_goto_end_of_line2)
    3443                 : {
    3444               1 :         char*              c1  = INITPTR;
    3445               1 :         char*              c2  = INITPTR;
    3446               1 :         MinSectionParser* msp = INITPTR;
    3447                 : 
    3448               1 :         c1 = mmp_goto_end_of_line(msp,&c2);
    3449                 : 
    3450               1 :         fail_unless( c2 == INITPTR
    3451                 :                    , "returned value is not INITPTR" );
    3452                 : 
    3453               1 :         mmp_destroy(&msp);
    3454               1 : }END_TEST
    3455                 : /* ------------------------------------------------------------------------- */
    3456               1 : START_TEST(test_mmp_goto_end_of_line3)
    3457                 : {
    3458               1 :         const char*        tmp = "ala ma kota\nkot ma ale\nczego sie gapisz\n";
    3459               1 :         char*              c1  = INITPTR;
    3460               1 :         char*              c2  = &tmp[0];
    3461               1 :         MinSectionParser* msp = mmp_create( 100 );
    3462               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    3463                 : 
    3464               1 :         c1 = mmp_goto_end_of_line(msp,&c2);
    3465                 : 
    3466               1 :         fail_unless( c1 != INITPTR
    3467                 :                    , "returned value is an INITPTR" );
    3468                 : 
    3469               1 :         mmp_destroy(&msp);
    3470               1 : }END_TEST
    3471                 : /* ------------------------------------------------------------------------- */
    3472               1 : START_TEST(test_mmp_goto_end_of_line4)
    3473                 : {
    3474               1 :         const char*        tmp = "ala ma kota\nkot ma ale\nczego sie gapisz\n";
    3475               1 :         char*              c1  = INITPTR;
    3476               1 :         char*              c2  = &tmp[0];
    3477               1 :         MinSectionParser* msp = mmp_create( 100 );
    3478               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    3479                 : 
    3480               1 :         c1 = mmp_goto_end_of_line(msp,&c2);
    3481                 : 
    3482               1 :         fail_unless( c2 != INITPTR
    3483                 :                    , "returned value is an INITPTR" );
    3484                 : 
    3485               1 :         mmp_destroy(&msp);
    3486               1 : }END_TEST
    3487                 : /* ------------------------------------------------------------------------- */
    3488               1 : START_TEST(test_mmp_goto_end_of_line5)
    3489                 : {
    3490               1 :         const char*        tmp = "ala ma kota\nkot ma ale\nczego sie gapisz\n";
    3491               1 :         char*              c1  = INITPTR;
    3492               1 :         char*              c2  = &tmp[0];
    3493               1 :         MinSectionParser* msp = mmp_create( 100 );
    3494               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    3495                 : 
    3496               1 :         c1 = mmp_goto_end_of_line(msp,&c2);
    3497                 : 
    3498               1 :         fail_unless( strcmp(c2,"kot ma ale\nczego sie gapisz\n") == 0
    3499                 :                    , "Wrong value returned by param [%s]"
    3500                 :                    , c2 );
    3501                 : 
    3502               1 :         mmp_destroy(&msp);
    3503               1 : }END_TEST
    3504                 : /* ------------------------------------------------------------------------- */
    3505               1 : START_TEST(test_mmp_goto_end_of_line6)
    3506                 : {
    3507               1 :         const char*        tmp = "ala ma kota\nkot ma ale\nczego sie gapisz\n";
    3508               1 :         char*              c1  = INITPTR;
    3509               1 :         char*              c2  = &tmp[0];
    3510               1 :         MinSectionParser* msp = mmp_create( 100 );
    3511               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    3512                 : 
    3513               1 :         c1 = mmp_goto_end_of_line(msp,&c2);
    3514                 : 
    3515               1 :         fail_unless( strcmp(c1,"a\nkot ma ale\nczego sie gapisz\n") == 0
    3516                 :                    , "Wrong value returned by name [%s]"
    3517                 :                    , c1 );
    3518                 : 
    3519               1 :         mmp_destroy(&msp);
    3520               1 : }END_TEST
    3521                 : /* ------------------------------------------------------------------------- */
    3522               1 : START_TEST(test_mmp_goto_end_of_line7)
    3523                 : {
    3524               1 :         const char*        tmp = "ala ma kota\n";
    3525               1 :         char*              c1  = INITPTR;
    3526               1 :         char*              c2  = &tmp[0];
    3527               1 :         MinSectionParser* msp = mmp_create( 100 );
    3528               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    3529                 : 
    3530               1 :         c1 = mmp_goto_end_of_line(msp,&c2);
    3531                 : 
    3532               1 :         fail_unless( strcmp(c1,"a\n") == 0
    3533                 :                    , "Wrong value returned by name [%s]"
    3534                 :                    , c1 );
    3535                 : 
    3536               1 :         mmp_destroy(&msp);
    3537               1 : }END_TEST
    3538                 : /* ------------------------------------------------------------------------- */
    3539               1 : START_TEST(test_mmp_goto_end_of_line8)
    3540                 : {
    3541               1 :         const char*        tmp = "ala ma kota\n";
    3542               1 :         char*              c1  = INITPTR;
    3543               1 :         char*              c2  = &tmp[0];
    3544               1 :         MinSectionParser* msp = mmp_create( 100 );
    3545               1 :         mmp_set_data(msp,tmp,&tmp[0],strlen(tmp));
    3546                 : 
    3547               1 :         c1 = mmp_goto_end_of_line(msp,&c2);
    3548                 : 
    3549               1 :         fail_unless( strcmp(c2,"") == 0
    3550                 :                    , "Wrong value returned by param [%s]"
    3551                 :                    , c2 );
    3552                 : 
    3553               1 :         mmp_destroy(&msp);
    3554               1 : }END_TEST
    3555                 : /* ------------------------------------------------------------------------- */
    3556                 : /* ========================== FUNCTIONS ==================================== */
    3557                 : /* ------------------------------------------------------------------------- */
    3558                 : Suite* min_section_parser_suite()
    3559             181 : {
    3560             181 :         Suite * s = suite_create ("min_section_parser");
    3561                 : 
    3562                 :         /* Core test case */
    3563             181 :         TCase *tc_core = tcase_create ("Core");
    3564                 : 
    3565                 :         /* create */
    3566             181 :         tcase_add_test (tc_core, test_mmp_create);
    3567             181 :         tcase_add_test (tc_core, test_mmp_create2);
    3568             181 :         tcase_add_test (tc_core, test_mmp_create3);
    3569             181 :         tcase_add_test (tc_core, test_mmp_create4);
    3570             181 :         tcase_add_test (tc_core, test_mmp_create5);
    3571             181 :         tcase_add_test (tc_core, test_mmp_create6);
    3572             181 :         tcase_add_test (tc_core, test_mmp_create7);
    3573             181 :         tcase_add_test (tc_core, test_mmp_create8);
    3574             181 :         tcase_add_test (tc_core, test_mmp_create9);
    3575                 : 
    3576                 :         /* destroy */
    3577             181 :         tcase_add_test (tc_core, test_mmp_destroy);
    3578             181 :         tcase_add_test (tc_core, test_mmp_destroy2);
    3579                 : 
    3580                 :         /* get_item_line */
    3581             181 :         tcase_add_test (tc_core, test_mmp_get_item_line);
    3582             181 :         tcase_add_test (tc_core, test_mmp_get_item_line2);
    3583             181 :         tcase_add_test (tc_core, test_mmp_get_item_line3);
    3584             181 :         tcase_add_test (tc_core, test_mmp_get_item_line4);
    3585             181 :         tcase_add_test (tc_core, test_mmp_get_item_line5);
    3586             181 :         tcase_add_test (tc_core, test_mmp_get_item_line6);
    3587             181 :         tcase_add_test (tc_core, test_mmp_get_item_line7);
    3588             181 :         tcase_add_test (tc_core, test_mmp_get_item_line8);
    3589                 : 
    3590                 :         /* get_next_item_line */
    3591             181 :         tcase_add_test (tc_core, test_mmp_get_next_item_line);
    3592             181 :         tcase_add_test (tc_core, test_mmp_get_next_item_line2);
    3593             181 :         tcase_add_test (tc_core, test_mmp_get_next_item_line3);
    3594             181 :         tcase_add_test (tc_core, test_mmp_get_next_item_line4);
    3595             181 :         tcase_add_test (tc_core, test_mmp_get_next_item_line5);
    3596             181 :         tcase_add_test (tc_core, test_mmp_get_next_item_line6);
    3597             181 :         tcase_add_test (tc_core, test_mmp_get_next_item_line7);
    3598             181 :         tcase_add_test (tc_core, test_mmp_get_next_item_line8);
    3599                 : 
    3600                 :         /* get_next_tagged_item_line */
    3601             181 :         tcase_add_test (tc_core, test_mmp_get_next_tagged_item_line);
    3602             181 :         tcase_add_test (tc_core, test_mmp_get_next_tagged_item_line2);
    3603             181 :         tcase_add_test (tc_core, test_mmp_get_next_tagged_item_line3);
    3604             181 :         tcase_add_test (tc_core, test_mmp_get_next_tagged_item_line4);
    3605             181 :         tcase_add_test (tc_core, test_mmp_get_next_tagged_item_line5);
    3606             181 :         tcase_add_test (tc_core, test_mmp_get_next_tagged_item_line6);
    3607                 : 
    3608                 :         /* get_sub_section */
    3609             181 :         tcase_add_test (tc_core, test_mmp_sub_section);
    3610             181 :         tcase_add_test (tc_core, test_mmp_sub_section2);
    3611             181 :         tcase_add_test (tc_core, test_mmp_sub_section3);
    3612             181 :         tcase_add_test (tc_core, test_mmp_sub_section4);
    3613             181 :         tcase_add_test (tc_core, test_mmp_sub_section5);
    3614             181 :         tcase_add_test (tc_core, test_mmp_sub_section6);
    3615                 : 
    3616                 :         /* get_next_sub_section */
    3617             181 :         tcase_add_test (tc_core, test_mmp_next_sub_section);
    3618             181 :         tcase_add_test (tc_core, test_mmp_next_sub_section2);
    3619             181 :         tcase_add_test (tc_core, test_mmp_next_sub_section3);
    3620             181 :         tcase_add_test (tc_core, test_mmp_next_sub_section4);
    3621             181 :         tcase_add_test (tc_core, test_mmp_next_sub_section5);
    3622             181 :         tcase_add_test (tc_core, test_mmp_next_sub_section6);
    3623             181 :         tcase_add_test (tc_core, test_mmp_next_sub_section7);
    3624             181 :         tcase_add_test (tc_core, test_mmp_next_sub_section8);
    3625             181 :         tcase_add_test (tc_core, test_mmp_next_sub_section9);
    3626             181 :         tcase_add_test (tc_core, test_mmp_next_sub_section10);
    3627             181 :         tcase_add_test (tc_core, test_mmp_next_sub_section11);
    3628             181 :         tcase_add_test (tc_core, test_mmp_next_sub_section12);
    3629             181 :         tcase_add_test (tc_core, test_mmp_next_sub_section13);
    3630             181 :         tcase_add_test (tc_core, test_mmp_next_sub_section14);
    3631                 : 
    3632                 :         /* get_line */
    3633             181 :         tcase_add_test (tc_core, test_mmp_get_line);
    3634             181 :         tcase_add_test (tc_core, test_mmp_get_line2);
    3635             181 :         tcase_add_test (tc_core, test_mmp_get_line3);
    3636             181 :         tcase_add_test (tc_core, test_mmp_get_line4);
    3637             181 :         tcase_add_test (tc_core, test_mmp_get_line5);
    3638             181 :         tcase_add_test (tc_core, test_mmp_get_line6);
    3639                 : 
    3640                 :         /* get_next_line */
    3641             181 :         tcase_add_test (tc_core, test_mmp_get_next_line);
    3642             181 :         tcase_add_test (tc_core, test_mmp_get_next_line2);
    3643             181 :         tcase_add_test (tc_core, test_mmp_get_next_line3);
    3644             181 :         tcase_add_test (tc_core, test_mmp_get_next_line4);
    3645             181 :         tcase_add_test (tc_core, test_mmp_get_next_line5);
    3646             181 :         tcase_add_test (tc_core, test_mmp_get_next_line6);
    3647             181 :         tcase_add_test (tc_core, test_mmp_get_next_line7);
    3648             181 :         tcase_add_test (tc_core, test_mmp_get_next_line8);
    3649             181 :         tcase_add_test (tc_core, test_mmp_get_next_line9);
    3650             181 :         tcase_add_test (tc_core, test_mmp_get_next_line10);
    3651                 : 
    3652                 :         /* get_next_tagged_line */
    3653             181 :         tcase_add_test (tc_core, test_mmp_get_next_tagged_line);
    3654             181 :         tcase_add_test (tc_core, test_mmp_get_next_tagged_line2);
    3655             181 :         tcase_add_test (tc_core, test_mmp_get_next_tagged_line3);
    3656             181 :         tcase_add_test (tc_core, test_mmp_get_next_tagged_line4);
    3657             181 :         tcase_add_test (tc_core, test_mmp_get_next_tagged_line5);
    3658             181 :         tcase_add_test (tc_core, test_mmp_get_next_tagged_line6);
    3659             181 :         tcase_add_test (tc_core, test_mmp_get_next_tagged_line7);
    3660             181 :         tcase_add_test (tc_core, test_mmp_get_next_tagged_line8);
    3661             181 :         tcase_add_test (tc_core, test_mmp_get_next_tagged_line9);
    3662             181 :         tcase_add_test (tc_core, test_mmp_get_next_tagged_line10);
    3663             181 :         tcase_add_test (tc_core, test_mmp_get_next_tagged_line11);
    3664                 : 
    3665                 :         /* get_position */
    3666             181 :         tcase_add_test (tc_core, test_mmp_get_position);
    3667             181 :         tcase_add_test (tc_core, test_mmp_get_position2);
    3668             181 :         tcase_add_test (tc_core, test_mmp_get_position3);
    3669                 : 
    3670                 :         /* set_position */
    3671             181 :         tcase_add_test (tc_core, test_mmp_set_position);
    3672             181 :         tcase_add_test (tc_core, test_mmp_set_position2);
    3673             181 :         tcase_add_test (tc_core, test_mmp_set_position3);
    3674                 : 
    3675                 :         /* set_data */
    3676             181 :         tcase_add_test (tc_core, test_mmp_set_data);
    3677             181 :         tcase_add_test (tc_core, test_mmp_set_data2);
    3678             181 :         tcase_add_test (tc_core, test_mmp_set_data3);
    3679             181 :         tcase_add_test (tc_core, test_mmp_set_data4);
    3680             181 :         tcase_add_test (tc_core, test_mmp_set_data5);
    3681                 : 
    3682                 :         /* des */
    3683             181 :         tcase_add_test (tc_core, test_mmp_des);
    3684             181 :         tcase_add_test (tc_core, test_mmp_des2);
    3685             181 :         tcase_add_test (tc_core, test_mmp_des3);
    3686             181 :         tcase_add_test (tc_core, test_mmp_des4);
    3687             181 :         tcase_add_test (tc_core, test_mmp_des5);
    3688             181 :         tcase_add_test (tc_core, test_mmp_des6);
    3689                 : 
    3690                 :         /* goto_end_of_line */
    3691             181 :         tcase_add_test (tc_core, test_mmp_goto_end_of_line);
    3692             181 :         tcase_add_test (tc_core, test_mmp_goto_end_of_line2);
    3693             181 :         tcase_add_test (tc_core, test_mmp_goto_end_of_line3);
    3694             181 :         tcase_add_test (tc_core, test_mmp_goto_end_of_line4);
    3695             181 :         tcase_add_test (tc_core, test_mmp_goto_end_of_line5);
    3696             181 :         tcase_add_test (tc_core, test_mmp_goto_end_of_line6);
    3697             181 :         tcase_add_test (tc_core, test_mmp_goto_end_of_line7);
    3698             181 :         tcase_add_test (tc_core, test_mmp_goto_end_of_line8);
    3699                 : 
    3700                 :         /* parse_start_and_end_pos */
    3701             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos);
    3702             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos2);
    3703             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos3);
    3704             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos4);
    3705             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos5);
    3706             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos6);
    3707             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos7);
    3708             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos8);
    3709             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos9);
    3710             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos10);
    3711             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos11);
    3712             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos12);
    3713             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos13);
    3714             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos14);
    3715             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos15);
    3716             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos16);
    3717             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos17);
    3718             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos18);
    3719             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos19);
    3720             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos20);
    3721             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos21);
    3722             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos22);
    3723             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos23);
    3724             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos24);
    3725             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos25);
    3726             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos26);
    3727             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos27);
    3728             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos28);
    3729             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos29);
    3730             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos30);
    3731             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos31);
    3732             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos32);
    3733             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos33);
    3734             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos34);
    3735             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos35);
    3736             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos36);
    3737             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos37);
    3738             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos38);
    3739             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos39);
    3740             181 :         tcase_add_test (tc_core, test_mmp_parse_start_and_end_pos40);
    3741                 : 
    3742             181 :         suite_add_tcase (s, tc_core);
    3743                 : 
    3744             181 :         return s;
    3745                 : }
    3746                 : /* ------------------------------------------------------------------------- */
    3747                 : int min_section_parser_tests()
    3748             181 : {
    3749             181 :         int number_failed = 0;
    3750             181 :         Suite   * s  = min_section_parser_suite ();
    3751             181 :         SRunner * sr = srunner_create (s);
    3752                 : 
    3753                 :         /*srunner_set_fork_status (sr, CK_NOFORK);*/
    3754                 : 
    3755             181 :         srunner_run_all(sr, CK_NORMAL);
    3756              36 :         number_failed = srunner_ntests_failed(sr);
    3757              36 :         srunner_free(sr);
    3758              36 :         return number_failed;
    3759                 : }
    3760                 : /* ------------------------------------------------------------------------- */
    3761                 : /* End of file */

Generated by: LTP GCOV extension version 1.6