added new utility test to check that all the Cmi defined types have the correct size
authorFilippo Gioachin <gioachin@illinois.edu>
Thu, 24 Mar 2005 00:24:33 +0000 (00:24 +0000)
committerFilippo Gioachin <gioachin@illinois.edu>
Thu, 24 Mar 2005 00:24:33 +0000 (00:24 +0000)
tests/Makefile
tests/util/Makefile [new file with mode: 0644]
tests/util/check.C [new file with mode: 0644]

index 143bf72ce7c3bc51c0a1424e7644d25603e5ea69..492bbff28ebaa262b542dd5f90759f8b1aca0fa6 100644 (file)
@@ -1,4 +1,4 @@
-DIRS=charm++ converse ampi fem
+DIRS=util charm++ converse ampi fem
 
 test:
        for d in $(DIRS); do \
diff --git a/tests/util/Makefile b/tests/util/Makefile
new file mode 100644 (file)
index 0000000..3ea3d4d
--- /dev/null
@@ -0,0 +1,15 @@
+CHARMC=../../bin/charmc $(OPTS)
+
+LINKLINE=$(CHARMC) -o check check.o -language converse++
+
+check: check.o
+       $(LINKLINE)
+
+check.o: check.C
+       $(CHARMC) -c check.C
+
+test: check
+       ./charmrun +p1 check
+
+clean:
+       rm -f conv-host *.o check.* *.bak *.log check.sts *~ charmrun
diff --git a/tests/util/check.C b/tests/util/check.C
new file mode 100644 (file)
index 0000000..2f151b3
--- /dev/null
@@ -0,0 +1,54 @@
+#include "converse.h"
+#include <stdio.h>
+
+void check_test(int argc, char** argv) {
+  CmiInt2 int2;
+  CmiInt4 int4;
+  CmiInt8 int8;
+  CmiUInt2 uint2;
+  CmiUInt4 uint4;
+  CmiUInt8 uint8;
+  CmiFloat4 float4;
+  CmiFloat8 float8;
+
+  if (sizeof(int2) != 2) {
+    CmiPrintf("Error: sizeof(CmiInt2) is %d!\n",sizeof(int2));
+    exit(1);
+  }
+  if (sizeof(int4) != 4) {
+    CmiPrintf("Error: sizeof(CmiInt4) is %d!\n",sizeof(int4));
+    exit(1);
+  }
+  if (sizeof(int8) != 8) {
+    CmiPrintf("Error: sizeof(CmiInt8) is %d!\n",sizeof(int8));
+    exit(1);
+  }
+
+  if (sizeof(uint2) != 2) {
+    CmiPrintf("Error: sizeof(CmiUInt2) is %d!\n",sizeof(uint2));
+    exit(1);
+  }
+  if (sizeof(uint4) != 4) {
+    CmiPrintf("Error: sizeof(CmiUInt4) is %d!\n",sizeof(uint4));
+    exit(1);
+  }
+  if (sizeof(uint8) != 8) {
+    CmiPrintf("Error: sizeof(CmiUInt8) is %d!\n",sizeof(uint8));
+    exit(1);
+  }
+
+  if (sizeof(float4) != 4) {
+    CmiPrintf("Error: sizeof(CmiFloat4) is %d!\n",sizeof(float4));
+    exit(1);
+  }
+  if (sizeof(float8) != 8) {
+    CmiPrintf("Error: sizeof(CmiFloat8) is %d!\n",sizeof(float8));
+    exit(1);
+  }
+}
+
+int main(int argc, char **argv)
+{
+  ConverseInit(argc,argv,check_test,1,0);
+}
+