summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFedja Beader <fedja@protonmail.ch>2025-02-22 21:16:47 +0100
committerJesusalva Jesusalva <jesusalva@tmw2.org>2025-05-03 14:50:16 +0000
commit7f77544c3531c763807bae021bced8f3cc4692bc (patch)
treecf4ab8f37b9ba8ff2da5a572bfdfa3d8c2b5a5cc
parent9ea5916f54b6af525487f033e3df1813f6a46ddc (diff)
downloadserverdata-7f77544c3531c763807bae021bced8f3cc4692bc.tar.gz
serverdata-7f77544c3531c763807bae021bced8f3cc4692bc.tar.bz2
serverdata-7f77544c3531c763807bae021bced8f3cc4692bc.tar.xz
serverdata-7f77544c3531c763807bae021bced8f3cc4692bc.zip
Whatever, add some tests
-rw-r--r--npc/dev/test.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/npc/dev/test.txt b/npc/dev/test.txt
index b430dd57d..2d657b838 100644
--- a/npc/dev/test.txt
+++ b/npc/dev/test.txt
@@ -638,6 +638,12 @@ function script HerculesSelfTestHelper {
callsub(OnCheck, "min()", min(5, -10, 8, 3, -2, 1000), -10);
callsub(OnCheck, "max()", max(5, -10, 8, 3, -2, 1000), 1000);
+ // bit flag helpers
+ callsub(OnCheck, "bitmask_count(0)", bitmask_count(0), 0);
+ callsub(OnCheck, "bitmask_count(1)", bitmask_count(1), 1);
+ callsub(OnCheck, "bitmask_count(0x180000000)", bitmask_count(3 << 31), 1); // first bit falls out.
+ callsub(OnCheck, "bitmask_count(0x55555555)", bitmask_count(0x55555555), 16);
+
// Constants
callsub(OnCheck, "'true' constant", true, 1);