summaryrefslogtreecommitdiffhomepage
path: root/tests/test_vsm.c
diff options
context:
space:
mode:
authorSean Kurtz <seankurtz75@gmail.com>2026-11-27 18:15:26 -0600
committerGitHub <noreply@github.com>2026-11-27 18:15:26 -0600
commit83e8fbc692b36be5ac9011ccf26b1b232d560008 (patch)
treeab62a06c6a49b343b33d41b502487b233128ad80 /tests/test_vsm.c
parent4c95e6490d189b47cad050744de9768465e0307b (diff)
parentb5bb63d4760f6f6e0282fc9f7eec36b41705458c (diff)
downloadztop-main.tar.gz
Merge pull request #7 from skurtz97/feature/views-and-dec-glyphsHEADmain
views: PS, FS and LOG, and a DEC-graphics frame
Diffstat (limited to 'tests/test_vsm.c')
-rw-r--r--tests/test_vsm.c33
1 files changed, 28 insertions, 5 deletions
diff --git a/tests/test_vsm.c b/tests/test_vsm.c
index 371b7ad..284d9b6 100644
--- a/tests/test_vsm.c
+++ b/tests/test_vsm.c
@@ -48,7 +48,7 @@ static int fail_line(int line, const char *what) {
} while (0)
static int test_csa(void) {
- struct vsm_info v;
+ vsm_info v;
len = 0;
put32(2);
@@ -89,7 +89,7 @@ static int test_csa(void) {
}
static int test_merge(void) {
- struct vsm_info v;
+ vsm_info v;
len = 0;
put32(1);
@@ -108,8 +108,30 @@ static int test_merge(void) {
return 0;
}
+static int test_line16(void) {
+ vsm_info v;
+
+ len = 0;
+ put32(1);
+ desc(230, 0x08, 0, 8);
+ put32(2);
+ block(0x00FF0000, 0x1000); /* ends exactly at the line: below */
+ put32(0);
+ block(0x01000000, 0x1000); /* starts at the line: above */
+ put32(0);
+
+ vsm_reset(&v, VSM_CSA, VSM_FREE);
+ CHECK(vsm_parse_alloc(&v, buf, len));
+ CHECK(v.used == 0x2000);
+ CHECK(v.below == 0x1000);
+ CHECK(v.above == 0x1000);
+ CHECK(v.sub[0].below == 0x1000);
+ CHECK(v.sub[0].above == 0x1000);
+ return 0;
+}
+
static int test_pvt(void) {
- struct vsm_info v;
+ vsm_info v;
len = 0;
put32(1);
@@ -131,7 +153,7 @@ static int test_pvt(void) {
}
static int test_unalloc(void) {
- struct vsm_info v;
+ vsm_info v;
len = 0;
put32(2);
@@ -157,7 +179,7 @@ static int test_unalloc(void) {
}
static int test_bad(void) {
- struct vsm_info v;
+ vsm_info v;
/* descriptor length below the documented minimum */
len = 0;
@@ -213,6 +235,7 @@ int main(void) {
rc |= test_csa();
rc |= test_merge();
+ rc |= test_line16();
rc |= test_pvt();
rc |= test_unalloc();
rc |= test_bad();