Commit a0b8c5b1 authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter
Browse files

add class declaration test

2007-09-08  Juerg Billeter  <j@bitron.ch>

	* tests/classes.exp, tests/classes.vala: add class declaration test

	* tests/Makefile.am: update

svn path=/trunk/; revision=594
parent 888f918d
2007-09-08 Jürg Billeter <j@bitron.ch>
* tests/classes.exp, tests/classes.vala: add class declaration test
* tests/Makefile.am: update
2007-09-08 Jürg Billeter <j@bitron.ch>
* gobject/valacodegeneratorclass.vala: fix support for static classes
......
......@@ -34,6 +34,7 @@ TESTS_ENVIRONMENT = $(srcdir)/testrunner.sh
TESTS = \
hello.vala \
classes.vala \
property-sample.vala \
\
test-001.vala \
......@@ -80,6 +81,7 @@ EXTRA_DIST = \
$(TESTS) \
\
hello.exp \
classes.exp \
property-sample.exp \
\
test-001.exp \
......
Classes Test:
new SimpleClass ()
new DerivedClass ()
new PublicClass ()
new ClassWithCreationMethod ()
ClassWithCreationMethod
new ClassWithNamedCreationMethod ()
ClassWithNamedCreationMethod
new SimpleGObjectClass ()
new DerivedGObjectClass ()
new PublicGObjectClass ()
new GObjectClassWithCreationMethod ()
new GObjectClassWithNamedCreationMethod ()
.
using GLib;
class SimpleClass {
}
class DerivedClass : SimpleClass {
}
public class PublicClass {
}
abstract class AbstractClass {
}
static class StaticClass {
}
class ClassWithCreationMethod {
public ClassWithCreationMethod () {
stdout.printf ("ClassWithCreationMethod\n");
}
}
class ClassWithNamedCreationMethod {
public ClassWithNamedCreationMethod.named () {
stdout.printf ("ClassWithNamedCreationMethod\n");
}
}
class SimpleGObjectClass : Object {
}
class DerivedGObjectClass : SimpleGObjectClass {
}
public class PublicGObjectClass : Object {
}
abstract class AbstractGObjectClass : Object {
}
class GObjectClassWithCreationMethod : Object {
public GObjectClassWithCreationMethod () {
}
}
class GObjectClassWithNamedCreationMethod : Object {
public GObjectClassWithNamedCreationMethod.named () {
}
}
static class ClassesTest {
static int main (string[] args) {
stdout.printf ("Classes Test:\n");
stdout.printf ("new SimpleClass ()\n");
var simple_class = new SimpleClass ();
stdout.printf ("new DerivedClass ()\n");
var derived_class = new DerivedClass ();
stdout.printf ("new PublicClass ()\n");
var public_class = new PublicClass ();
stdout.printf ("new ClassWithCreationMethod ()\n");
var class_with_creation_method = new ClassWithCreationMethod ();
stdout.printf ("new ClassWithNamedCreationMethod ()\n");
var class_with_named_creation_method = new ClassWithNamedCreationMethod.named ();
stdout.printf ("new SimpleGObjectClass ()\n");
var simple_gobject_class = new SimpleGObjectClass ();
stdout.printf ("new DerivedGObjectClass ()\n");
var derived_gobject_class = new DerivedGObjectClass ();
stdout.printf ("new PublicGObjectClass ()\n");
var public_gobject_class = new PublicGObjectClass ();
stdout.printf ("new GObjectClassWithCreationMethod ()\n");
var gobject_class_with_creation_method = new GObjectClassWithCreationMethod ();
stdout.printf ("new GObjectClassWithNamedCreationMethod ()\n");
var gobject_class_with_named_creation_method = new GObjectClassWithNamedCreationMethod.named ();
stdout.printf (".\n");
return 0;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment