38 lines
824 B
Text
38 lines
824 B
Text
$NetBSD: patch-be,v 1.1 2005/10/17 20:18:34 is Exp $
|
|
|
|
--- vsuite/quick/ptrstr/pointer.mpd.orig 2005-10-17 22:06:31.000000000 +0200
|
|
+++ vsuite/quick/ptrstr/pointer.mpd
|
|
@@ -0,0 +1,33 @@
|
|
+resource pointer()
|
|
+ type pt = ptr int
|
|
+ pt foo
|
|
+ pt bar
|
|
+ pt baz
|
|
+ pt nul
|
|
+ string[20] foos
|
|
+ string[20] bars
|
|
+
|
|
+ write("Testing pointer-string-pointer conversions:")
|
|
+
|
|
+ nul = null
|
|
+ write("Null pointer:", nul, "; string:", string(nul),
|
|
+ "; int:", int(nul), "; pt(==null==):", pt("==null=="))
|
|
+
|
|
+ baz = new(int)
|
|
+
|
|
+ foo = new(int)
|
|
+ foos= string(foo)
|
|
+
|
|
+ bar = pt(foos)
|
|
+ bars= string(bar)
|
|
+
|
|
+ baz = pt(foos||"X")
|
|
+
|
|
+ write("pointer identity:", foo == bar)
|
|
+ write("string identity:", foos == bars)
|
|
+ write("pointerX identity:", foo == baz)
|
|
+
|
|
+ write("Expect invalid conversion:")
|
|
+ baz = pt("invalid")
|
|
+
|
|
+end
|