Prepare for the 2.0.7 release.

* Fix API for contexts
* Set version
* fixed test target
This commit is contained in:
Per Sandberg 2010-05-23 10:19:26 +02:00
parent b9ac7136eb
commit 815a6cf25e
8 changed files with 23 additions and 26 deletions

View File

@ -38,3 +38,5 @@ generate:
setup:
${MAKE} -C eBindings install
test:
${MAKE} -C tests

View File

@ -45,9 +45,7 @@ package body ZMQ.Contexts is
not overriding procedure Initialize
(This : in out Context;
App_Threads : Positive;
IO_Threads : Positive;
Flags : Context_Flags := No_Flags)
App_Threads : Positive)
is
begin
Validate_Library_Version;
@ -55,19 +53,13 @@ package body ZMQ.Contexts is
raise ZMQ_Error with "Alredy Initialized";
end if;
This.c := Low_Level.zmq_init
(int (App_Threads), int (IO_Threads), int (Flags));
(int (App_Threads), 1, 0);
if This.c = Null_Address then
raise ZMQ_Error with Error_Message (GNAT.OS_Lib.Errno) & " in " &
GNAT.Source_Info.Enclosing_Entity;
end if;
end Initialize;
overriding
procedure Initialize (This : in out Context) is
begin
This.c := Null_Address;
end Initialize;
--------------
-- Finalize --
--------------
@ -77,7 +69,7 @@ package body ZMQ.Contexts is
is
rc : int;
begin
if This.c /= Null_Address then
if This.Is_Connected then
rc := Low_Level.zmq_term (This.c);
This.c := Null_Address;
if rc /= 0 then

View File

@ -37,19 +37,10 @@ package ZMQ.Contexts is
type Context is new Ada.Finalization.Limited_Controlled with private;
type Any_Context is access all Context'Class;
type Context_Flags is mod 2 ** 32;
function "+" (L, R : Context_Flags) return Context_Flags renames "or";
No_Flags : constant Context_Flags := 0;
not overriding
procedure Initialize (This : in out Context;
App_Threads : Positive;
IO_Threads : Positive;
Flags : Context_Flags := No_Flags);
overriding
procedure Initialize (This : in out Context);
App_Threads : Positive);
overriding
procedure Finalize (This : in out Context);

View File

@ -30,8 +30,8 @@
-- --
------------------------------------------------------------------------------
-- The contents of this file is derived from zmq.h using the
-- -fdump-ada-spec switch for gcc.
-- The contents of this file is derived from zmq.h using the
-- -fdump-ada-spec switch for gcc.
with Interfaces.C; use Interfaces.C;
with Interfaces.C.Strings;

View File

@ -39,7 +39,7 @@ package ZMQ is
Patch : Natural;
end record;
Binding_Version : constant Version_Type := (0, 0, 1);
Binding_Version : constant Version_Type := (2, 0, 7);
function Library_Version return Version_Type;
function image (item : Version_Type) return String;

12
tests/Makefile Normal file
View File

@ -0,0 +1,12 @@
all: compile test
compile:
gprbuild -p -P zmq-tests.gpr
test:
bin/test_all

View File

@ -26,7 +26,7 @@ package body ZMQ.Tests.Testcases.Test_Pubsub is
procedure initialize (Test : in out AUnit.Test_Cases.Test_Case'Class) is
T : Test_Case renames Test_Case (Test);
begin
T.Ctx.Initialize (1, 1, 0);
T.Ctx.Initialize (1);
T.pub.Initialize (T.Ctx, Sockets.PUB);
T.Sub.Initialize (T.Ctx, Sockets.SUB);

View File

@ -12,7 +12,7 @@ project ZMQ.Tests is
for Exec_Dir use "bin";
package Builder is
-- for executable ("zmq-tests-testharnesess-test_all.adb") use "zmq-tests-testharnesess-test_all";
for executable ("zmq-tests-testharnesess-test_all.adb") use "test_all";
for Default_Switches ("ada") use ("-k", "-j2");
end Builder;