[med-svn] [Git][med-team/acedb][master] 3 commits: Complete gcc-14 FTBFS fixes for #1066334

Andreas Tille (@tille) gitlab at salsa.debian.org
Tue Sep 22 09:57:53 BST 2026



Andreas Tille pushed to branch master at Debian Med / acedb


Commits:
ade45ccb by Andreas Tille at 2026-09-22T07:46:55+02:00
Complete gcc-14 FTBFS fixes for #1066334

The previous fixes did not fully resolve the gcc-14 build failure:
- wh/lex.h included wh/acelib_.h which redefined AceInstance/AceHandle/
  AceTable/AceContext with conflicting types after wh/acetypes.h
  (fix_implicit_declaration.patch). Use regular.h and keyset.h instead.
- Add missing declarations for dnaDumpKeyCstyle/peptideDumpKeyCstyle
- Add missing standard headers to efetch.c and dbidx.c
- Include acelib.h in metadata.c and dna.h/peptide.h in dump.c

- - - - -
b3edfe76 by Andreas Tille at 2026-09-22T07:49:00+02:00
Fix remaining gcc-15 C23 old-style function pointer FTBFS

- - - - -
ff96c754 by Andreas Tille at 2026-09-22T10:55:44+02:00
Add autopkgtest

- - - - -


11 changed files:

- + debian/README.test
- + debian/acedb-other.docs
- + debian/acedb-other.examples
- debian/changelog
- debian/patches/fix_implicit_declaration.patch
- + debian/source/include-binaries
- + debian/tests/control
- + debian/tests/data/division.lkp
- + debian/tests/data/entrynam.idx
- + debian/tests/data/seq.dat
- + debian/tests/run-unit-test


Changes:

=====================================
debian/README.test
=====================================
@@ -0,0 +1,8 @@
+Notes on how this package can be tested.
+────────────────────────────────────────
+
+This package can be tested by running the provided test:
+
+    sh run-unit-test
+
+in order to confirm its integrity.


=====================================
debian/acedb-other.docs
=====================================
@@ -0,0 +1,2 @@
+debian/README.test
+debian/tests/run-unit-test


=====================================
debian/acedb-other.examples
=====================================
@@ -0,0 +1 @@
+debian/tests/data/*


=====================================
debian/changelog
=====================================
@@ -5,6 +5,12 @@ acedb (4.9.39+dfsg.02-10) UNRELEASED; urgency=medium
      - Add missing readline/history.h header
      - Definition of AceType is broken since it redefines _Int with different
        meaning than in whooks/systags.h
+     - Do not include wh/acelib_.h in wh/lex.h to avoid conflicting type
+       definitions; regular.h and keyset.h provide the needed types
+     - Add missing declarations for dnaDumpKeyCstyle/peptideDumpKeyCstyle
+     - Add missing standard headers to efetch.c and dbidx.c
+     - Include acelib.h in metadata.c and dna.h/peptide.h in dump.c
+     - Fix old-style function pointer declarations that break gcc-15
     Closes: #1066334
   * Build-Depends: libtirpc-dev
   * Replace pkg-config with pkgconf in Build-Depends
@@ -14,6 +20,7 @@ acedb (4.9.39+dfsg.02-10) UNRELEASED; urgency=medium
   * Remove redundant Priority: optional from source stanza.
   * Update standards version to 4.7.4, no changes needed.
   * cme fix dpkg-control
+  * Add autopkgtest
 
   [ Jeremy Sowden ]
   * Fixes for missing declarations


=====================================
debian/patches/fix_implicit_declaration.patch
=====================================
@@ -1,4 +1,4 @@
-Description: Add missing readline/history.h header
+Description: Add missing headers and declarations to fix gcc-14 build
 Bug-Debian: https://bugs.debian.org/1066334
 Author: Andreas Tille <tille at debian.org>
 Last-Update: 2024-04-13
@@ -34,9 +34,30 @@ Forwarded: No (orphaned upstream)
  
  /******************************************************************/
  
+--- a/w4/dump.c
++++ b/w4/dump.c
+@@ -47,6 +47,8 @@
+ #include <wh/a.h>
+ #include <wh/bs.h>
+ #include <wh/dump.h>
++#include <wh/dna.h>
++#include <wh/peptide.h>
+ #include <wh/pick.h>
+ #include <wh/session.h>
+ #include <wh/query.h>
+--- a/w4/metadata.c
++++ b/w4/metadata.c
+@@ -38,6 +38,7 @@
+ /* $Id: metadata.c,v 1.14 2003/07/09 13:20:25 rnc Exp $ */
+ 
+ #include "acedb.h"
++#include "acelib.h"
+ 
+ #include "lex.h"
+ #include "a.h"
 --- a/w5/idacedb.h
 +++ b/w5/idacedb.h
-@@ -49,4 +49,17 @@ ID* idaChildren (IdCnxn ix, char *domain
+@@ -49,4 +49,17 @@
  IdHistory* idaHistory (IdCnxn ix, char *domain, ID id, int version) ;
  ID* idaChanged (IdCnxn ix, char *domain, char* timeStamp) ;
  
@@ -54,18 +75,55 @@ Forwarded: No (orphaned upstream)
 +IdError idaAddNameType (IdCnxn ix, char *domain, BOOL isUnique, BOOL isPrimary);
 +
  #endif /* !IDCURATE_ACEDB_H */
+--- a/w9/dbidx.c
++++ b/w9/dbidx.c
+@@ -39,7 +39,7 @@
+ 
+ #include "dbidx.h"
+ #include <string.h>
+-/*#include <ctype.h>*/
++#include <ctype.h>
+ #include <stdarg.h>
+ 
+ 
+--- a/w9/efetch.c
++++ b/w9/efetch.c
+@@ -35,6 +35,10 @@
+ 
+ /* $Id: efetch.c,v 1.3 1999/09/01 10:59:19 fw Exp $ */
+ 
++#include <string.h>
++#include <stdlib.h>
++#include <ctype.h>
++#include <unistd.h>
+ #include "dbidx.h"
+ 
+ #define MAXFILE 128
+--- a/wh/dna.h
++++ b/wh/dna.h
+@@ -179,6 +179,7 @@
+ 
+ /* ace dump routines */
+ BOOL dnaDump (ACEOUT dump_out, KEY key); /* DumpFuncType */
++BOOL dnaDumpKeyCstyle (ACEOUT dump_out, KEY key);
+ ParseFuncReturn dnaParse (ACEIN parse_in, KEY key, char **errtext); /* ParseFuncType */
+ 
+ BOOL baseQualityDump (ACEOUT dump_out, KEY key) ; /* DumpFuncType */
 --- a/wh/lex.h
 +++ b/wh/lex.h
-@@ -37,7 +37,7 @@
+@@ -36,9 +36,10 @@
+ 
  /************************************************************/
  
++#include <wh/regular.h>
++#include <wh/keyset.h>
  #include <wh/disk.h>		/* for DISK type */
--
-+#include <wh/acelib_.h>
  
+-
  /* Returned by iskey, LEXKEY_IS_UNKNOWN: key is not known to acedb
   *                        LEXKEY_IS_VOC: key is vocabulary entry only
-@@ -52,6 +52,7 @@ int   lexMax(int t) ;  /* Numbers of ent
+  *                        LEXKEY_IS_OBJ: key is a full object. 
+@@ -52,6 +53,7 @@
  int   lexi2Max(int t) ;  /* Numbers of cached entries of the t lexique */
  int   vocMax(int t) ;
  void  lex2clear (KEY key) ; /* call this function to clear the lex2 array */
@@ -73,3 +131,327 @@ Forwarded: No (orphaned upstream)
  
  LexKeyType   iskey(KEY kk);
  BOOL  iskeyold(KEY kk);					    /* TRUE if key is on disk or in first cache */
+--- a/wh/peptide.h
++++ b/wh/peptide.h
+@@ -89,6 +89,7 @@
+ 
+ /* ace parsing/dumping routines */
+ BOOL peptideDump (ACEOUT dump_out, KEY k) ;/* DumpFuncType */
++BOOL peptideDumpKeyCstyle (ACEOUT dump_out, KEY k);
+ ParseFuncReturn peptideParse (ACEIN parse_in, KEY key, char **errtext) ; /* ParseFuncType */
+ 
+ 
+--- a/w1/msort.c
++++ b/w1/msort.c
+@@ -43,7 +43,7 @@
+ 
+ #include "regular.h"
+ 
+-static void mDoSortInt (int *b, int n, int (*cmp)(), int *buf)
++static void mDoSortInt (int *b, int n, int (*cmp)(void *, void *), int *buf)
+ {
+   int *b0 = buf, *b1, *b2 ;
+   int  n1, n2 ;
+@@ -70,7 +70,7 @@
+ 
+ /***********************************************************/
+ 
+-static void mDoSort (char *b, int n, int s, int (*cmp)(), char *buf)
++static void mDoSort (char *b, int n, int s, int (*cmp)(void *, void *), char *buf)
+ {
+   char *b0 = buf, *b1, *b2 ;
+   int  n1, n2 ;
+@@ -105,7 +105,7 @@
+ 
+ /***********************************************************/
+ 
+-void mSort (void *b, int n, int s, int (*cmp)())
++void mSort (void *b, int n, int s, int (*cmp)(void *, void *))
+ { 
+   int size = n * s, s_of_i = sizeof (int) ;
+   char  sBuf [4*1024] ;
+--- a/wh/regular.h
++++ b/wh/regular.h
+@@ -680,7 +680,7 @@
+ 
+ 
+ /****************** alternative qsort() ************************/
+-void mSort (void *b, int n, int s, int (*cmp)()) ;
++void mSort (void *b, int n, int s, int (*cmp)(void *, void *)) ;
+ 
+ 
+ /******************* Unix debugging.  ****************************/
+
+--- a/w1/dict.c
++++ b/w1/dict.c
+@@ -236,7 +236,7 @@
+ BOOL dictFind (_DICT *dict, char *s, int *ip)
+ {
+   register int ii, h, dh = 0 ;
+-  int (*mystrcmp)() = dict->caseSensitive ?
++  int (*mystrcmp)(const char *, const char *) = dict->caseSensitive ?
+     strcmp : strcasecmp ;
+ 
+   if (!dict || !s || !*s)
+--- a/w2/graph_.h
++++ b/w2/graph_.h
+@@ -96,7 +96,7 @@
+   float         xFac,yFac ;				    /*  and scale factors */
+   int           textX,textY ;				    /* text size in pixels */
+   int           h,w ;					    /* device coords (0,0) to (w-1,h-1) */
+-  void          (*func[NEVENTS])() ;			    /* Used in graphxt with either 0 or 2 args */
++  void          (*func[NEVENTS])(void) ;		    /* Used in graphxt with either 0 or 2 args */
+   float         pointsize ;
+   GraphLineStyle line_style ;
+   float         linewidth ;
+--- a/w2/graphcon.c
++++ b/w2/graphcon.c
+@@ -442,7 +442,7 @@
+ 	      mouse_event == GRAPHDEV_MIDDLE_UP)
+ 	    graphBusyCursorAll ();
+ 	  
+-	  (*gActive->func[myEv])(graphEventX, graphEventY) ; 
++	  (*(MouseFunc)gActive->func[myEv])(graphEventX, graphEventY) ; 
+ 	}
+     }
+ }
+@@ -549,7 +549,7 @@
+   else if (key_type == GRAPHDEV_SAVEKEY)
+     callSave(graph) ;
+   else if (kval && gActive->func[KEYBOARD])
+-    (*gActive->func[KEYBOARD])(kval, modifier) ;
++    (*(KeyBoardFunc)gActive->func[KEYBOARD])(kval, modifier) ;
+     
+   return ;
+ }
+@@ -595,7 +595,7 @@
+ 
+   graphActivate(graph->id) ;
+   if (gActive->func[RAMP_CHANGE])
+-    (*gActive->func[RAMP_CHANGE])(isDrag);
++    (*(void (*)(BOOL))gActive->func[RAMP_CHANGE])(isDrag);
+   graphActivate(gsave) ;
+   
+ }
+--- a/w5/lexsubs4.c
++++ b/w5/lexsubs4.c
+@@ -944,7 +944,7 @@
+   BOOL isCaseSensitive = pickList[class(key) & 255 ].isCaseSensitive ;
+ /*   int (*lexstrIsCasecmp)(const char *a,const char *b) = isCaseSensitive ? */
+ /*    lexstrCasecmp : lexstrcmp ; */
+-  int (*lexstrIsCasecmp)() = isCaseSensitive ?
++  int (*lexstrIsCasecmp)(const char *, const char *) = isCaseSensitive ?
+     strcmp : strcasecmp ;
+  
+   while (TRUE)
+@@ -1707,7 +1707,7 @@
+   int  classe = class(key) ;
+   KEY  newKey ;
+   BOOL isCaseSensitive = pickList[classe & 255 ].isCaseSensitive ;
+-  int (*lexstrIsCasecmp)() = isCaseSensitive ?
++  int (*lexstrIsCasecmp)(const char *, const char *) = isCaseSensitive ?
+     strcmp : strcasecmp ;
+ 
+      /********** Protections *************/ 
+@@ -1915,7 +1915,7 @@
+   LEXI1 *lexi ;
+   char *voc ;
+   BOOL isCaseSensitive ;
+-  int (*lexstrIsCasecmp)() ; 
++  int (*lexstrIsCasecmp)(const char *, const char *) ; 
+ 
+   pickIsA(&classe, &mask) ; t = classe ;
+   isCaseSensitive = pickList[t & 255 ].isCaseSensitive ;
+--- a/w7/fmaposp.c
++++ b/w7/fmaposp.c
+@@ -1381,7 +1381,7 @@
+   int  classe = class(key) ;
+   KEY  newKey ;
+   BOOL isCaseSensitive = pickList[classe & 255 ].isCaseSensitive ;
+-  int (*lexstrIsCasecmp)() = isCaseSensitive ?
++  int (*lexstrIsCasecmp)(const char *, const char *) = isCaseSensitive ?
+     strcmp : strcasecmp ;
+   int ret;
+ 
+--- a/w9/belvu.c
++++ b/w9/belvu.c
+@@ -489,7 +489,7 @@
+     GRAY
+ };
+ 
+-static void     externalCommand();
++static void     externalCommand(char *command);
+ 
+ /* Global variables
+ *******************/
+@@ -3364,7 +3364,7 @@
+ }
+ 
+ 
+-static void treeTraverse(treeNode *node, void (*func)()) {
++static void treeTraverse(treeNode *node, void (*func)(treeNode *)) {
+     if (!node) return;
+ 
+     treeTraverse(node->left, func);
+--- a/w9/blxview.c
++++ b/w9/blxview.c
+@@ -1055,7 +1055,7 @@
+ }
+ 
+ 
+-static void sortMSPs(int (*func)())
++static void sortMSPs(int (*func)(MSP *, MSP *))
+ {
+   MSP tmpmsp, *msp1, *msp2;
+ 
+--- a/w9/fetch.c
++++ b/w9/fetch.c
+@@ -34,6 +34,10 @@
+ 
+ /* $Id: fetch.c,v 1.9 1999/09/01 10:59:41 fw Exp $ */
+ 
++#include <string.h>
++#include <stdlib.h>
++#include <ctype.h>
++#include <unistd.h>
+ #include "dbidx.h"
+ 
+ char  *env, dbsource[32]="", dbdir[128]="";
+--- a/wabi/intron2.c
++++ b/wabi/intron2.c
+@@ -149,7 +149,7 @@
+     int **p_mat3;            /* pointeur sur le pointeur de lignes */
+     static int mat3[4][6];      /* matrice des scores */
+     static int *pl_mat3[4];     /* pointeur sur les lignes de la matrice */
+-    FILE *fp,*fopen();
++    FILE *fp;
+     int l,c;
+     int val;
+ 
+@@ -227,7 +227,7 @@
+ void lecture(int *plancher,int *penabonus)
+   {
+     int i;
+-    FILE *fopen(),*fpl,*fpe;
++    FILE *fpl,*fpe;
+ 
+     if ((fpl=fopen("plancher","r"))==NULL) {
+       printf("Probleme d'ouverture du fichier plancher"); exit(0);
+@@ -1971,7 +1971,7 @@
+ 
+ void compl(char nom[])
+   {
+-    FILE *fopen(),*fseq,*fseq2;
++    FILE *fseq,*fseq2;
+     char **tab;
+     static char s[2];
+     long stop,i,j,lgt,reste,ind,fin,saut;
+@@ -2052,7 +2052,7 @@
+ 
+ void main()
+   {
+-    FILE *gp4,*gp7,*fep,*fseq,*fopen();
++    FILE *gp4,*gp7,*fep,*fseq;
+     char cont[6],rep[3];
+     long pos_ab,lgt,**cp7,**fen;
+     int **pp7c,**pp7,pos_p7,*pc,i,j,k;
+--- a/wh/call.h
++++ b/wh/call.h
+@@ -41,7 +41,7 @@
+ #include "aceiotypes.h"
+ 
+ typedef int MESSAGERETURN ;
+-typedef void (*CallFunc)() ;
++typedef void (*CallFunc)(va_list) ;
+ 
+ 
+ void callRegister (char *name, CallFunc func) ;
+--- a/wh/colcontrol.h
++++ b/wh/colcontrol.h
+@@ -170,7 +170,7 @@
+   void (*doColour)(COLINSTANCE instance, int box);
+   void (*followBox)(COLINSTANCE instance, int box, double x, double y);
+   void (*pick)(COLINSTANCE instance, int box, double x, double y);
+-  void (*conversionRegister)();
++  void (*conversionRegister)(MAPCONTROL, COLINSTANCE);
+   void (*configFinal)(COLINSTANCE instance, void *locals,BOOL okay);
+   Graph configGraph;
+   void *private;
+@@ -190,7 +190,7 @@
+   void *specialisation;
+   BOOL unique;						    /* If set, only one instance of this 
+ 							       column allowed */ 
+-  void *(*conRoutine)();				    /* how to convert the map */
++  void *(*conRoutine)(MAPCONTROL, void *);		    /* how to convert the map */
+   void *convertParams;					    /* params for above */
+   char *helpText;					    /* What the column does , what the 
+ 							       configparams do. */
+@@ -243,7 +243,7 @@
+ void controlOverlay(void);
+ void controlDrawControl(void *control);
+ void controlConvertRegister(COLCONTROL control);
+-void **controlConvert(Array conversionRoutines, MAPCONTROL map, void *(*conRoutine)(), void *params);
++void **controlConvert(Array conversionRoutines, MAPCONTROL map, void *(*conRoutine)(MAPCONTROL, void *), void *params);
+ void controlConvertPerm(MAPCONTROL map);
+ void controlConvertTrans(MAPCONTROL map);
+ 
+--- a/wh/colcontrol_.h
++++ b/wh/colcontrol_.h
+@@ -54,7 +54,7 @@
+ 
+ 
+ struct ConversionRecord {   /* record of a conversion routine to be called */
+-  void *(*convertRoutine)();
++  void *(*convertRoutine)(MAPCONTROL, void *);
+   void *params;
+   void *results;
+ };
+--- a/wh/dbidx.h
++++ b/wh/dbidx.h
+@@ -193,16 +193,14 @@
+ int bin_search(char *query, FILE *idx, Header *head, char *(*getname)(FILE *idx, Header *head, int pos) );
+ char *getAcname(FILE *idx, Header *head, int pos);
+ 
+-void printActrg(),
+-     printPIRseq(),
+-     printGBseq(),
+-     printEMBLseq(),
+-     printAnn(),
+-     printheader();
+-
+-char *printFastaseq();
+-
+-int  getAcentry_rec_num();
++void printheader(Header *head);
++void printActrg(Acnum *rec);
++void printPIRseq(FILE *db, Entrynam *rec, int Start, int End);
++void printGBseq(FILE *db, Entrynam *rec, int Start, int End);
++void printEMBLseq(FILE *db, Entrynam *rec, int Start, int End);
++void printAnn(FILE *db, Entrynam *rec);
++char *printFastaseq(FILE *db, Entrynam *rec, int Start, int End);
++int  getAcentry_rec_num(FILE *achit, Header *achithead, int offset);
+ 
+ 
+ /********************** end of file *********************/
+--- a/wh/session.h
++++ b/wh/session.h
+@@ -164,7 +164,7 @@
+ BOOL sessionSetUserSessionUser(char *user);		    /* Username must be alphanumerics. */
+ mytime_t sessionUserSession2Time(KEY userSession);
+ mytime_t sessionStartTime(void);
+-void swapSuperBlock();
++void swapSuperBlock(struct block *bp);
+ 
+ #if defined (MACINTOSH)
+ void seteuid (uid_t uid) ;
+--- a/wsocket/saceclient.c
++++ b/wsocket/saceclient.c
+@@ -479,7 +479,7 @@
+ 		  else if (!strncasecmp(cp, "parse", 5) && strNumWords(cp) == 1)
+ 		    {
+ 		      /* If someone just enters "parse" then get the ace data from stdin. */
+-		      cp = getAceData("parse> ") ;
++		      cp = getAceData() ;
+ 		      if (!cp)
+ 			sendRequest = FALSE ;
+ 		    }


=====================================
debian/source/include-binaries
=====================================
@@ -0,0 +1,2 @@
+debian/tests/data/division.lkp
+debian/tests/data/entrynam.idx


=====================================
debian/tests/control
=====================================
@@ -0,0 +1,3 @@
+Tests: run-unit-test
+Depends: @
+Restrictions: allow-stderr


=====================================
debian/tests/data/division.lkp
=====================================
Binary files /dev/null and b/debian/tests/data/division.lkp differ


=====================================
debian/tests/data/entrynam.idx
=====================================
Binary files /dev/null and b/debian/tests/data/entrynam.idx differ


=====================================
debian/tests/data/seq.dat
=====================================
@@ -0,0 +1,34 @@
+ID   ALBU_HUMAN                     STANDARD;      PRT;    609 AA.
+AC   P02768;
+DE   ALBUMIN (HUMAN).
+SQ   SEQUENCE   609 AA;  100 MW;
+     MKWVTFISLLFLFSSAYSRGVFRRDTHKSEIAHRFKDLGEENFKALVLIAFAQYLQQCPF
+     EDHVKLVNEVTEFAKTCVADESAENCDKSLHTLFGDKLCTVATLRETYGEMADCCAKQEP
+     ERNECFLQHKDDNPNLPRLVRPEVDVMCTAFHDNEETFLKKYLYEIARRHPYFYAPELLF
+     FAKRYKAAFTECCQAADKAACLLPKLDELRDEGKASSAKQRLKCASLQKFGERAFKAWAV
+     ARLSQRFPKAEFAEVSKLVTDLTKVHTECCHGDLLECADDRADLAKYICENQDSISSKLK
+     ECCEKPLLEKSHCIAEVENDEMPADLPSLAADFVESKDVCKNYAEAKDVFLGMFLYEYAR
+     RHPDYSVVLLLRLAKTYETTLEKCCAAADPHECYAKVFDEFKPLVEEPQNLIKQNCELFE
+     QLGEYKFQNALLVRYTKKVPQVSTPTLVEVSRNLGKVGSKCCKHPEAKRMPCAEDYLSVV
+     LNQLCVLHEKTPVSDRVTKCCTESLVNRRPCFSALEVDETYVPKEFNAETFTFHADICTL
+     SEKERQIKKQTALVELVKHKPKATKEQLKAVMDDFAAFVEKCCKADDKETCFAEEGKKLV
+     AASQAALGL
+//
+ID   CYC_HUMAN                      STANDARD;      PRT;    105 AA.
+AC   P99999;
+DE   CYTOCHROME C (HUMAN).
+SQ   SEQUENCE   105 AA;  100 MW;
+     MGDVEKGKKIFIMKCSQCHTVEKGGKHKTGPNLHGLFGRKTGQAPGYSYTAANKNKGIIW
+     GEDTLMEYLENPKKYIPGTKMIFVGIKKKEERADLIAYLKKATNE
+//
+ID   G3P_HUMAN                      STANDARD;      PRT;    335 AA.
+AC   P04406;
+DE   GLYCERALDEHYDE-3-PHOSPHATE DEHYDROGENASE (HUMAN).
+SQ   SEQUENCE   335 AA;  100 MW;
+     MGKVKVGVNGFGRIGRLVTRAAFNSGKVDIVAINDPFIDLNYMVYMFQYDSTHGKFHGTV
+     KAENGKLVINGNPITIFQERDPANIKWGDAGAEYVVESTGVFTTMEKAGAHLQGGAKRVI
+     ISAPSADAPMFVMGVNHEKYDNSLKIISNASCTTNCLAPLAKVIHDNFGIVEGLMTTVHA
+     ITATQKTVDGPSGKLWRDGRGALQNIIPASTGAAKAVGKVIPELNGKLTGMAFRVPTANV
+     SVVDLTCRLEKPAKYDDIKKVVKQASEGPLKGILGYTEHQVVSSDFNSDTHSSTFDAGAG
+     IALNDHFVKLISWYDNEFGYSNRVVDLMAHMASKE
+//


=====================================
debian/tests/run-unit-test
=====================================
@@ -0,0 +1,92 @@
+#!/bin/bash
+set -e
+
+pkg=acedb-other
+
+export LC_ALL=C.UTF-8
+if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
+  AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
+  # shellcheck disable=SC2064
+  trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
+fi
+
+cp -a /usr/share/doc/${pkg}/examples/* "${AUTOPKGTEST_TMP}"
+
+cd "${AUTOPKGTEST_TMP}"
+
+# efetch retrieves entries from sequence databases using EMBL CD-ROM format
+# binary index files.  This test queries a small SWISS-PROT-style pre-generated
+# database and checks that efetch works in the main output modes.
+#
+# The database files were generated from this SWISS-PROT
+# data (entrynam.idx: record_size 22, entry names padded to 12 bytes,
+# big-endian numeric fields; division.lkp maps division code 1 to seq.dat):
+#   ALBU_HUMAN / P02768 / ALBUMIN (HUMAN).
+#   CYC_HUMAN  / P99999 / CYTOCHROME C (HUMAN).
+#   G3P_HUMAN  / P04406 / GLYCERALDEHYDE-3-PHOSPHATE DEHYDROGENASE (HUMAN).
+#
+# NOTE: efetch's main() is declared void, so the exit status of a successful
+# run is undefined (it happens to be 2 on current builds).  This test
+# therefore checks output content, not exit status, for the success cases.
+# The explicit exit(1) on "not found" is reliable and is tested below.
+
+set -eu
+
+# Expect $1 to appear in the combined output of the efetch command in $@.
+check_contains()
+{
+    needle=$1
+    shift
+    output=$("$@" 2>&1) || true
+    case "$output" in
+        *"$needle"*)
+            ;;
+        *)
+            echo "FAIL: output of '$*' does not contain '$needle'" >&2
+            echo "----- output -----" >&2
+            echo "$output" >&2
+            echo "------------------" >&2
+            exit 1
+            ;;
+    esac
+}
+
+# Command must fail (used for the "not found" error path, which exits 1).
+check_fails()
+{
+    if "$@" >/dev/null 2>&1; then
+        echo "FAIL: command unexpectedly succeeded: $*" >&2
+        exit 1
+    fi
+}
+
+D="$(pwd)/"
+
+# Annotation output for the first, middle and last index records.
+check_contains "P02768" efetch -D "$D" ALBU_HUMAN
+check_contains "ALBUMIN (HUMAN)." efetch -D "$D" ALBU_HUMAN
+check_contains "P99999" efetch -D "$D" CYC_HUMAN
+check_contains "P04406" efetch -D "$D" G3P_HUMAN
+
+# Fasta output.
+check_contains ">ALBU_HUMAN" efetch -D "$D" -f ALBU_HUMAN
+check_contains "MKWVTFISL" efetch -D "$D" -f ALBU_HUMAN
+
+# Sequence-only output equals the full sequence on a single line.
+out=$(efetch -D "$D" -q ALBU_HUMAN) || true
+exp="MKWVTFISLLFLFSSAYSRGVFRRDTHKSEIAHRFKDLGEENFKALVLIAFAQYLQQCPFEDHVKLVNEVTEFAKTCVADESAENCDKSLHTLFGDKLCTVATLRETYGEMADCCAKQEPERNECFLQHKDDNPNLPRLVRPEVDVMCTAFHDNEETFLKKYLYEIARRHPYFYAPELLFFAKRYKAAFTECCQAADKAACLLPKLDELRDEGKASSAKQRLKCASLQKFGERAFKAWAVARLSQRFPKAEFAEVSKLVTDLTKVHTECCHGDLLECADDRADLAKYICENQDSISSKLKECCEKPLLEKSHCIAEVENDEMPADLPSLAADFVESKDVCKNYAEAKDVFLGMFLYEYARRHPDYSVVLLLRLAKTYETTLEKCCAAADPHECYAKVFDEFKPLVEEPQNLIKQNCELFEQLGEYKFQNALLVRYTKKVPQVSTPTLVEVSRNLGKVGSKCCKHPEAKRMPCAEDYLSVVLNQLCVLHEKTPVSDRVTKCCTESLVNRRPCFSALEVDETYVPKEFNAETFTFHADICTLSEKERQIKKQTALVELVKHKPKATKEQLKAVMDDFAAFVEKCCKADDKETCFAEEGKKLVAASQAALGL"
+if [ "$out" != "$exp" ]; then
+    echo "FAIL: sequence-only output mismatch" >&2
+    exit 1
+fi
+
+# Subsequence extraction.
+check_contains "MKWVT" efetch -D "$D" -f -s 1 -e 5 ALBU_HUMAN
+
+# Unknown entry must fail with a non-zero exit status.
+check_fails efetch -D "$D" NOSUCH
+
+# -h prints usage.
+check_contains "EFETCH - retrieve entries from sequence databases" efetch -h
+
+echo "All efetch autopkgtests passed."



View it on GitLab: https://salsa.debian.org/med-team/acedb/-/compare/c41689ec061f1e1445940addff5567fec7ffcb18...ff96c754b5ddcaa36f908861d2ce920562c01015

-- 
View it on GitLab: https://salsa.debian.org/med-team/acedb/-/compare/c41689ec061f1e1445940addff5567fec7ffcb18...ff96c754b5ddcaa36f908861d2ce920562c01015
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20260922/60c2ca2c/attachment-0001.htm>


More information about the debian-med-commit mailing list