Hello,

please find the patch attached. Along with the fix, a test exhibiting
the issue.

Paolo, can you please apply this or accept pull request 7 on github?

Thanks,
Regards,

Thomas
fix issue#659

2012-09-14  Thomas Girard  <[email protected]>

	* tests/cobjects.st: Add CBoolean test case for issue#659.
	* tests/cobjects.ok: Regenerate.
	* kernel/CObject.st: Add missing CBoolean class>>#type.

diff --git a/kernel/CObject.st b/kernel/CObject.st
index 7db8d0d..f757699 100644
--- a/kernel/CObject.st
+++ b/kernel/CObject.st
@@ -1541,6 +1541,13 @@ CByte subclass: CBoolean [
     <category: 'Language-C interface'>
     <comment: 'I return true if a byte is not zero, false otherwise.'>
 
+    CBoolean class >> type [
+	"Answer a CType for the receiver"
+
+	<category: 'conversion'>
+	^CBooleanType
+    ]
+
     value [
 	"Get the receiver's value - answer true if it is != 0, false if it is 0."
 
diff --git a/tests/cobjects.ok b/tests/cobjects.ok
index bfaaa55..c90ee87 100644
--- a/tests/cobjects.ok
+++ b/tests/cobjects.ok
@@ -163,3 +163,7 @@ $2
 $3
 $<0>
 returned value is nil
+
+Execution begins...
+true
+returned value is nil
diff --git a/tests/cobjects.st b/tests/cobjects.st
index 9aa1a51..79c95a8 100644
--- a/tests/cobjects.st
+++ b/tests/cobjects.st
@@ -238,5 +238,12 @@ Eval [
     c free.
 ]
 
+" Play with conversion for Boolean"
+Eval [
+    c := CBoolean value: true.
+    c value printNl.
+    c free.
+]
+
 " ### need a lot more!"
 
_______________________________________________
help-smalltalk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to