use strict;
use warnings;
-use Clutter::TestHelper tests => 5;
+use Clutter::TestHelper tests => 11;
use Champlain ':coords';
sub test_version {
ok($Champlain::VERSION, "Library loaded");
+
+ ok(defined Champlain::MAJOR_VERSION, "MAJOR_VERSION exists");
+ ok(defined Champlain::MINOR_VERSION, "MINOR_VERSION exists");
+ ok(defined Champlain::MICRO_VERSION, "MICRO_VERSION exists");
+
+ ok (Champlain->CHECK_VERSION(0,0,0), "CHECK_VERSION pass");
+ ok (!Champlain->CHECK_VERSION(50,0,0), "CHECK_VERSION fail");
+
+ my @version = Champlain->GET_VERSION_INFO;
+ my @expected = (
+ Champlain::MAJOR_VERSION,
+ Champlain::MINOR_VERSION,
+ Champlain::MICRO_VERSION,
+ );
+ is_deeply(\@version, \@expected, "GET_VERSION_INFO");
}
#include "register.xsh"
#include "boot.xsh"
+
+guint
+MAJOR_VERSION ()
+ CODE:
+ RETVAL = CHAMPLAIN_MAJOR_VERSION;
+
+ OUTPUT:
+ RETVAL
+
+
+guint
+MINOR_VERSION ()
+ CODE:
+ RETVAL = CHAMPLAIN_MINOR_VERSION;
+
+ OUTPUT:
+ RETVAL
+
+
+guint
+MICRO_VERSION ()
+ CODE:
+ RETVAL = CHAMPLAIN_MICRO_VERSION;
+
+ OUTPUT:
+ RETVAL
+
+
+void
+GET_VERSION_INFO (class)
+ PPCODE:
+ EXTEND (SP, 3);
+ PUSHs (sv_2mortal (newSViv (CHAMPLAIN_MAJOR_VERSION)));
+ PUSHs (sv_2mortal (newSViv (CHAMPLAIN_MINOR_VERSION)));
+ PUSHs (sv_2mortal (newSViv (CHAMPLAIN_MICRO_VERSION)));
+ PERL_UNUSED_VAR (ax);
+
+
+gboolean
+CHECK_VERSION (class, int major, int minor, int micro)
+ CODE:
+ RETVAL = CHAMPLAIN_CHECK_VERSION (major, minor, micro);
+
+ OUTPUT:
+ RETVAL