... |
... |
@@ -47,18 +47,29 @@ |
47
|
47
|
(assert-false fd)
|
48
|
48
|
(assert-true (and (integerp errno) (plusp errno)))))
|
49
|
49
|
|
50
|
|
-;; Darwin allows any number of X's (including 0!) in the template but
|
51
|
|
-;; Linux requires exactly 6. Hence skip this test.
|
52
|
|
-#-darwin
|
53
|
50
|
(define-test mkstemp.bad-template
|
54
|
51
|
(:tag :issues)
|
55
|
52
|
(multiple-value-bind (fd errno)
|
56
|
53
|
(unix::unix-mkstemp "test-")
|
57
|
54
|
;; The template doesn't have enough X's so the FD should be NIL,
|
58
|
55
|
;; and a positive Unix errno value should be returned.
|
59
|
|
- ;;
|
60
|
|
- ;; Note that Darwin allows any number of X's (including 0!) in the
|
61
|
|
- ;; template but Linux requires exactly 6.
|
|
56
|
+ (assert-false fd)
|
|
57
|
+ (assert-true (and (integerp errno) (plusp errno)))))
|
|
58
|
+
|
|
59
|
+(define-test mkstemp.bad-template.2
|
|
60
|
+ (:tag :issues)
|
|
61
|
+ (multiple-value-bind (fd errno)
|
|
62
|
+ (unix::unix-mkstemp "test-XXXXXXX")
|
|
63
|
+ ;; The template has too many X's so the FD should be NIL, and a
|
|
64
|
+ ;; positive Unix errno value should be returned.
|
|
65
|
+ (assert-false fd)
|
|
66
|
+ (assert-true (and (integerp errno) (plusp errno)))))
|
|
67
|
+
|
|
68
|
+(define-test mkstemp.bad-template.3
|
|
69
|
+ (:tag :issues)
|
|
70
|
+ (multiple-value-bind (fd errno)
|
|
71
|
+ (unix::unix-mkstemp "test-XXXXXXa")
|
|
72
|
+ ;; The template doesn't end in X's
|
62
|
73
|
(assert-false fd)
|
63
|
74
|
(assert-true (and (integerp errno) (plusp errno)))))
|
64
|
75
|
|
... |
... |
@@ -100,9 +111,6 @@ |
100
|
111
|
(assert-false result)
|
101
|
112
|
(assert-true (and (integerp errno) (plusp errno)))))
|
102
|
113
|
|
103
|
|
-;; Darwin allows any number of X's (including 0!) in the template but
|
104
|
|
-;; Linux requires exactly 6. Hence skip this test.
|
105
|
|
-#-darwin
|
106
|
114
|
(define-test mkdtemp.bad-template
|
107
|
115
|
(:tag :issues)
|
108
|
116
|
(multiple-value-bind (result errno)
|
... |
... |
@@ -111,3 +119,19 @@ |
111
|
119
|
(assert-false result)
|
112
|
120
|
(assert-true (and (integerp errno) (plusp errno)))))
|
113
|
121
|
|
|
122
|
+(define-test mkdtemp.bad-template.2
|
|
123
|
+ (:tag :issues)
|
|
124
|
+ (multiple-value-bind (result errno)
|
|
125
|
+ (unix::unix-mkdtemp "dir-XXXXXXX")
|
|
126
|
+ ;; Too many X's in template.
|
|
127
|
+ (assert-false result)
|
|
128
|
+ (assert-true (and (integerp errno) (plusp errno)))))
|
|
129
|
+
|
|
130
|
+(define-test mkdtemp.bad-template.2
|
|
131
|
+ (:tag :issues)
|
|
132
|
+ (multiple-value-bind (result errno)
|
|
133
|
+ (unix::unix-mkdtemp "dir-XXXXXXa")
|
|
134
|
+ ;; Template doesn't end in X's
|
|
135
|
+ (assert-false result)
|
|
136
|
+ (assert-true (and (integerp errno) (plusp errno)))))
|
|
137
|
+ |