aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2020-01-01 13:50:18 +0100
committerFabian Groffen <grobian@gentoo.org>2020-01-01 13:50:18 +0100
commitc6537da04a6695656d655bf4e48813fb041ec010 (patch)
tree36a522aa42c84a4511a0002aafcaff8dd0054e8c /tests
parentbuildsys: regen (diff)
downloadportage-utils-c6537da04a6695656d655bf4e48813fb041ec010.tar.gz
portage-utils-c6537da04a6695656d655bf4e48813fb041ec010.tar.bz2
portage-utils-c6537da04a6695656d655bf4e48813fb041ec010.zip
libq/atom: stick to PMS for PVR
rework allocations somewhat, and make sure PVR does NOT include -r0, in addition add PF to the structure, so this one can be grabbed more easily Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/atom_explode/test.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/tests/atom_explode/test.c b/tests/atom_explode/test.c
index 21a5f1db..b794d3b0 100644
--- a/tests/atom_explode/test.c
+++ b/tests/atom_explode/test.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2005-2019 Gentoo Foundation
+ * Copyright 2005-2020 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
*
* Copyright 2005-2008 Ned Ludd - <solar@gentoo.org>
@@ -19,9 +19,23 @@ FILE *warnout;
static inline void boom(depend_atom *a, char *s)
{
- printf("%s -> %s / [%s] %s - %s [%s] [r%i]\n",
- s, (a->CATEGORY?:"null"), a->P, a->PN,
- a->PVR, a->PV, a->PR_int);
+ /* python code:
+ * CATEGORY = cpv[0]
+ * PN = cpv[1]
+ * PV = cpv[2]
+ * PR_int = cpv[3]
+ * P = PN + "-" + PV
+ * PVR = PV + "-" + cpv[3]
+ * print(a+" -> "+CATEGORY+" / ["+P+"] "+PN+" - "+PVR+" ["+PV+"] ["+PR_int+"]")
+ * this most notably doesn't test PVR in compliance with PMS */
+ printf("%s -> %s / [%s] %s - %s%s [%s] [r%i]\n",
+ s,
+ (a->CATEGORY ? a->CATEGORY : "null"),
+ a->P,
+ a->PN,
+ a->PVR, (a->PVR != NULL && a->PR_int == 0) ? "-r0" : "",
+ a->PV,
+ a->PR_int);
}
int main(int argc, char *argv[])