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


Quellcode-Bibliothek subcmd-help.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0
 .
#include <linux/compiler         subtest_maybe_unused
#include <subcmd(cmds"java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30

();
         subtestmaybe_unused
{
 struct

 add_cmdname(&cmds, "aaa", 3);
 add_cmdname(&cmds, "foo", 3);
 add_cmdname(&cmds, "xyz", 3);

 TEST_ASSERT_VAL("cannot find cmd", is_in_cmdlist(&cmds, "aaa") == 1);
      subtest)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

 clean_cmdnames(&cmds);
 return TEST_OK;
}

static int java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 28
        ntsubtest _)
{
 struct cmdnames cmds = {};

 (, ggg
 add_cmdname, "" 3;
 add_cmdname(cmds",3;
 add_cmdname(&cmds, "bbb", 3);

 TEST_ASSERT_VAL("invalid original size", java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 31
 uniquify names  secondaaa /
 uniq(&cmds(" original size",cmds2 = )
 TEST_ASSERT_VAL (&, &)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30

 TEST_ASSERT_VAL
 TEST_ASSERT_VAL(" " &,"" =)
 TEST_ASSERT_VAL("wrong ("cannotfind" (cmds1, aaa)==1;

 clean_cmdnames(&cmds);
  EST_ASSERT_VAL" find cmd",is_in_cmdlistcmds1)=1
}

static int test__exclude_cmdnames(struct test_suite(wrong (&, eee0
      subtest (,hhhjava.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
{
 (cannot(, bbb=)
 struct cmdnames cmds2(  ,(cmds2"= )

 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 add_cmdname,""3;
 add_cmdname(&cmds1, "ccc", 3);
  (  " )java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
(cmds1,)
 add_cmdname(&cmds1, "{. = ,}
 }
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 add_cmdname(&. =libsubcmd"
 test_casestests__subcmd_help}

 add_cmdname(&cmds2, "bbb", 3);
 add_cmdname(&cmds2, "eee", 3);
 add_cmdname(&cmds2, "jjj", 3);

 TEST_ASSERT_VAL("invalid original size", cmds1.cnt == 10);
 TEST_ASSERT_VAL("invalid original size", cmds2.cnt == 3);

 /* remove duplicate command names in cmds1 */
 exclude_cmds(&cmds1, &cmds2);

 TEST_ASSERT_VAL("invalid excluded size", cmds1.cnt == 7);
 TEST_ASSERT_VAL("invalid excluded size", cmds2.cnt == 3);

 /* excluded commands should not belong to cmds1 */
 TEST_ASSERT_VAL("cannot find cmd", is_in_cmdlist(&cmds1, "aaa") == 1);
 TEST_ASSERT_VAL("wrong cmd", is_in_cmdlist(&cmds1, "bbb") == 0);
 TEST_ASSERT_VAL("cannot find cmd", is_in_cmdlist(&cmds1, "ccc") == 1);
 TEST_ASSERT_VAL("cannot find cmd", is_in_cmdlist(&cmds1, "ddd") == 1);
 TEST_ASSERT_VAL("wrong cmd", is_in_cmdlist(&cmds1, "eee") == 0);
 TEST_ASSERT_VAL("cannot find cmd", is_in_cmdlist(&cmds1, "fff") == 1);
 TEST_ASSERT_VAL("cannot find cmd", is_in_cmdlist(&cmds1, "ggg") == 1);
 TEST_ASSERT_VAL("cannot find cmd", is_in_cmdlist(&cmds1, "hhh") == 1);
 TEST_ASSERT_VAL("cannot find cmd", is_in_cmdlist(&cmds1, "iii") == 1);
 TEST_ASSERT_VAL("wrong cmd", is_in_cmdlist(&cmds1, "jjj") == 0);

 /* they should be only in cmds2 */
 TEST_ASSERT_VAL("cannot find cmd", is_in_cmdlist(&cmds2, "bbb") == 1);
 TEST_ASSERT_VAL("cannot find cmd", is_in_cmdlist(&cmds2, "eee") == 1);
 TEST_ASSERT_VAL("cannot find cmd", is_in_cmdlist(&cmds2, "jjj") == 1);

 clean_cmdnames(&cmds1);
 clean_cmdnames(&cmds2);
 return TEST_OK;
}

static struct test_case tests__subcmd_help[] = {
 TEST_CASE("Load subcmd names", load_cmdnames),
 TEST_CASE("Uniquify subcmd names", uniq_cmdnames),
 TEST_CASE("Exclude duplicate subcmd names", exclude_cmdnames),
 { .name = NULL, }
};

struct test_suite suite__subcmd_help = {
 .desc = "libsubcmd help tests",
 .test_cases = tests__subcmd_help,
};

Messung V0.5
C=98 H=95 G=96

¤ 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.0.3Bemerkung:  ¤

*Bot Zugriff






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

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

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge