Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  test_date.c   Sprache: C

 

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * test_date.c
 *
 * Test Date Type
 *
 */


#include "testutil.h"
#include "testutil_nss.h"

static void *plContext = NULL;

static void
createDates(char *goodInput, char *diffInput,
            PKIX_PL_Date **goodDate,
            PKIX_PL_Date **equalDate,
            PKIX_PL_Date **diffDate)
{

    subTest("PKIX_PL_Date_Create <goodDate>");
    *goodDate = createDate(goodInput, plContext);

    subTest("PKIX_PL_Date_Create <equalDate>");
    *equalDate = createDate(goodInput, plContext);

    subTest("PKIX_PL_Date_Create <diffDate>");
    *diffDate = createDate(diffInput, plContext);
}

static void
testDestroy(void *goodObject, void *equalObject, void *diffObject)
{
    PKIX_TEST_STD_VARS();

    subTest("PKIX_PL_Date_Destroy");

    PKIX_TEST_DECREF_BC(goodObject);
    PKIX_TEST_DECREF_BC(equalObject);
    PKIX_TEST_DECREF_BC(diffObject);

cleanup:

    PKIX_TEST_RETURN();
}

static void
testDate(char *goodInput, char *diffInput)
{

    PKIX_PL_Date *goodDate = NULL;
    PKIX_PL_Date *equalDate = NULL;
    PKIX_PL_Date *diffDate = NULL;

    /*
     * The ASCII rep of the date will vary by platform and locale
     * This particular string was generated on a SPARC running Solaris 9
     * in an English locale
     */

    /* char *expectedAscii = "Mon Mar 29 08:48:47 2004"; */
    char *expectedAscii = "Mon Mar 29, 2004";

    PKIX_TEST_STD_VARS();

    createDates(goodInput, diffInput,
                &goodDate, &equalDate, &diffDate);

    PKIX_TEST_EQ_HASH_TOSTR_DUP(goodDate, equalDate, diffDate, expectedAscii, Date, PKIX_TRUE);

    testDestroy(goodDate, equalDate, diffDate);

    PKIX_TEST_RETURN();
}

int
test_date(int argc, char *argv[])
{

    char *goodInput = NULL;
    char *diffInput = NULL;
    PKIX_UInt32 actualMinorVersion;
    PKIX_UInt32 j = 0;

    PKIX_TEST_STD_VARS();

    startTests("Date");

    PKIX_TEST_EXPECT_NO_ERROR(
        PKIX_PL_NssContext_Create(0, PKIX_FALSE, NULL, &plContext));

    goodInput = "040329134847Z";
    diffInput = "050329135847Z";
    testDate(goodInput, diffInput);

cleanup:

    PKIX_Shutdown(plContext);

    PKIX_TEST_RETURN();

    endTests("Date");

    return (0);
}

Messung V0.5 in Prozent
C=97 H=100 G=98

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet am  2026-10-04) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1126864
#Domains=2039723