summaryrefslogtreecommitdiff
path: root/internal/generate/classify_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-20 07:23:45 +0300
committerPaul Buetow <paul@buetow.org>2026-05-20 07:23:45 +0300
commitdf1225efe494cc81513cf98e93891376e45f9615 (patch)
tree8fe131ba9ae5737022f26fcd60e662c1660329c6 /internal/generate/classify_test.go
parent11a8642b7035ff558fb84d7761e93525c84e4908 (diff)
task 07: add KindMem and separate address-space byte accounting
Diffstat (limited to 'internal/generate/classify_test.go')
-rw-r--r--internal/generate/classify_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/internal/generate/classify_test.go b/internal/generate/classify_test.go
index 367d7c8..2bc0e88 100644
--- a/internal/generate/classify_test.go
+++ b/internal/generate/classify_test.go
@@ -425,6 +425,20 @@ func TestClassifyPselect6(t *testing.T) {
}
}
+func TestClassifyMunmap(t *testing.T) {
+ r := classifyFromData(t, FormatMunmap)
+ if r.Kind != KindMem {
+ t.Errorf("munmap: got kind %d, want KindMem", r.Kind)
+ }
+}
+
+func TestClassifyMremap(t *testing.T) {
+ r := classifyFromData(t, FormatMremap)
+ if r.Kind != KindMem {
+ t.Errorf("mremap: got kind %d, want KindMem", r.Kind)
+ }
+}
+
func TestClassifyKillRequiresGenerationFallback(t *testing.T) {
r := classifyFromData(t, FormatKill)
if r.Kind != KindNone {
@@ -477,6 +491,8 @@ func TestClassifySyscallPairAccepted(t *testing.T) {
{"ppoll", FormatPpoll, FormatExitPpoll, KindPoll},
{"select", FormatSelect, FormatExitSelect, KindPoll},
{"pselect6", FormatPselect6, FormatExitPselect6, KindPoll},
+ {"munmap", FormatMunmap, FormatExitMunmap, KindMem},
+ {"mremap", FormatMremap, FormatExitMremap, KindMem},
{"kill", FormatKill, FormatExitKill, KindNull},
}
@@ -514,6 +530,8 @@ func TestClassifySyscallPairEmitsAllFamilies(t *testing.T) {
{"ppoll", FormatPpoll, FormatExitPpoll, FamilyPolling},
{"select", FormatSelect, FormatExitSelect, FamilyPolling},
{"pselect6", FormatPselect6, FormatExitPselect6, FamilyPolling},
+ {"munmap", FormatMunmap, FormatExitMunmap, FamilyMemory},
+ {"mremap", FormatMremap, FormatExitMremap, FamilyMemory},
{"kill", FormatKill, FormatExitKill, FamilySignals},
}