Rename unit tests and adjust according with the namespace change from Memcache -> Memcache.Client

This commit is contained in:
R. Tyler Croy 2011-04-04 23:14:25 -07:00
parent c62f897803
commit 65fc0fe7e8
13 changed files with 61 additions and 61 deletions

View File

@ -1,22 +1,22 @@
with Memcache;
with Memcache.Test;
with Memcache.Test.Delete;
with Memcache.Test.Incr;
with Memcache.Test.Decr;
with Memcache.Test.Store;
with Memcache.Test.Get;
with Memcache.Client.Test;
with Memcache.Client.Test.Delete;
with Memcache.Client.Test.Incr;
with Memcache.Client.Test.Decr;
with Memcache.Client.Test.Store;
with Memcache.Client.Test.Get;
package body Suite is
use AUnit.Test_Suites;
function Suite return Access_Test_Suite is
Result : constant Access_Test_Suite := new Test_Suite;
begin
Result.Add_Test (new Memcache.Test.Client_Test);
Result.Add_Test (new Memcache.Test.Delete.Delete_Test);
Result.Add_Test (new Memcache.Test.Incr.Incr_Test);
Result.Add_Test (new Memcache.Test.Decr.Decr_Test);
Result.Add_Test (new Memcache.Test.Store.Store_Test);
Result.Add_Test (new Memcache.Test.Get.Get_Test);
Result.Add_Test (new Memcache.Client.Test.Client_Test);
Result.Add_Test (new Memcache.Client.Test.Delete.Delete_Test);
Result.Add_Test (new Memcache.Client.Test.Incr.Incr_Test);
Result.Add_Test (new Memcache.Client.Test.Decr.Decr_Test);
Result.Add_Test (new Memcache.Client.Test.Store.Store_Test);
Result.Add_Test (new Memcache.Client.Test.Get.Get_Test);
return Result;
end Suite;
end Suite;

View File

@ -2,7 +2,7 @@
with AUnit.Test_Cases, AUnit.Assertions;
use AUnit.Test_Cases, AUnit.Assertions;
package body Memcache.Test.Decr is
package body Memcache.Client.Test.Decr is
procedure Register_Tests (T : in out Decr_Test) is
use AUnit.Test_Cases.Registration;
begin
@ -26,7 +26,7 @@ package body Memcache.Test.Decr is
procedure Test_Gen_Decr (T :
in out AUnit.Test_Cases.Test_Case'Class) is
Command : String := Memcache.Generate_Decr ("GoodKey", 100, False);
Command : String := Memcache.Client.Generate_Decr ("GoodKey", 100, False);
Expected : String := Append_CRLF ("decr GoodKey 100");
begin
Assert (Command = Expected, "Bad command string");
@ -35,7 +35,7 @@ package body Memcache.Test.Decr is
procedure Test_Gen_Decr_No_Reply (T :
in out AUnit.Test_Cases.Test_Case'Class) is
Command : String := Memcache.Generate_Decr ("GoodKey", 100, True);
Command : String := Memcache.Client.Generate_Decr ("GoodKey", 100, True);
Expected : String := Append_CRLF ("decr GoodKey 100 noreply");
begin
Assert (Command = Expected, "Bad command string");
@ -46,7 +46,7 @@ package body Memcache.Test.Decr is
in out AUnit.Test_Cases.Test_Case'Class) is
begin
declare
Command : String := Memcache.Generate_Decr ("Bad Key", 0, False);
Command : String := Memcache.Client.Generate_Decr ("Bad Key", 0, False);
begin
Assert (False, "Should have raised an Invalid_Key_Error");
end;
@ -54,4 +54,4 @@ package body Memcache.Test.Decr is
when Invalid_Key_Error =>
Assert (True, "Properly raised Invalid_Key_Error");
end Test_Gen_Decr_Bad_Key;
end Memcache.Test.Decr;
end Memcache.Client.Test.Decr;

View File

@ -2,7 +2,7 @@
with AUnit;
with AUnit.Test_Cases;
package Memcache.Test.Decr is
package Memcache.Client.Test.Decr is
type Decr_Test is new AUnit.Test_Cases.Test_Case with null record;
procedure Register_Tests (T : in out Decr_Test);
@ -14,5 +14,5 @@ package Memcache.Test.Decr is
in out AUnit.Test_Cases.Test_Case'Class);
procedure Test_Gen_Decr_Bad_Key (T :
in out AUnit.Test_Cases.Test_Case'Class);
end Memcache.Test.Decr;
end Memcache.Client.Test.Decr;

View File

@ -3,7 +3,7 @@ with Ada.Calendar;
with AUnit.Test_Cases, AUnit.Assertions;
use AUnit.Test_Cases, AUnit.Assertions;
package body Memcache.Test.Delete is
package body Memcache.Client.Test.Delete is
procedure Register_Tests (T : in out Delete_Test) is
use AUnit.Test_Cases.Registration;
begin
@ -30,7 +30,7 @@ package body Memcache.Test.Delete is
procedure Test_Gen_Delete (T :
in out AUnit.Test_Cases.Test_Case'Class) is
Command : String := Memcache.Generate_Delete ("GoodKey", 0.0, False);
Command : String := Memcache.Client.Generate_Delete ("GoodKey", 0.0, False);
Expected : String := "delete GoodKey" & ASCII.CR & ASCII.LF;
begin
Assert (Command = Expected, "Bad command string");
@ -41,7 +41,7 @@ package body Memcache.Test.Delete is
in out AUnit.Test_Cases.Test_Case'Class) is
Some_Time : Ada.Calendar.Time :=
Ada.Calendar.Time_Of (1985, 11, 20);
Command : String := Memcache.Generate_Delete ("GoodKey",
Command : String := Memcache.Client.Generate_Delete ("GoodKey",
Some_Time, False);
Expected : String := Append_CRLF ("delete GoodKey 501292800");
begin
@ -51,7 +51,7 @@ package body Memcache.Test.Delete is
procedure Test_Gen_Delete_Delayed (T :
in out AUnit.Test_Cases.Test_Case'Class) is
Command : String := Memcache.Generate_Delete ("GoodKey", 10.0, False);
Command : String := Memcache.Client.Generate_Delete ("GoodKey", 10.0, False);
Expected : String := Append_CRLF ("delete GoodKey 10");
begin
Assert (Command = Expected, "Bad command string");
@ -60,7 +60,7 @@ package body Memcache.Test.Delete is
procedure Test_Gen_Delete_No_Reply (T :
in out AUnit.Test_Cases.Test_Case'Class) is
Command : String := Memcache.Generate_Delete ("GoodKey", 0.0, True);
Command : String := Memcache.Client.Generate_Delete ("GoodKey", 0.0, True);
Expected : String := Append_CRLF ("delete GoodKey noreply");
begin
Assert (Command = Expected, "Bad command string");
@ -69,9 +69,9 @@ package body Memcache.Test.Delete is
procedure Test_Gen_Delete_Delayed_No_Reply (T :
in out AUnit.Test_Cases.Test_Case'Class) is
Command : String := Memcache.Generate_Delete ("GoodKey", 10.0, True);
Command : String := Memcache.Client.Generate_Delete ("GoodKey", 10.0, True);
Expected : String := Append_CRLF ("delete GoodKey 10 noreply");
begin
Assert (Command = Expected, "Bad command string");
end Test_Gen_Delete_Delayed_No_Reply;
end Memcache.Test.Delete;
end Memcache.Client.Test.Delete;

View File

@ -3,7 +3,7 @@
with AUnit;
with AUnit.Test_Cases;
package Memcache.Test.Delete is
package Memcache.Client.Test.Delete is
type Delete_Test is new AUnit.Test_Cases.Test_Case with null record;
procedure Register_Tests (T : in out Delete_Test);
@ -20,4 +20,4 @@ package Memcache.Test.Delete is
in out AUnit.Test_Cases.Test_Case'Class);
procedure Test_Gen_Delete_Delayed_No_Reply (T :
in out AUnit.Test_Cases.Test_Case'Class);
end Memcache.Test.Delete;
end Memcache.Client.Test.Delete;

View File

@ -2,7 +2,7 @@
with AUnit.Test_Cases, AUnit.Assertions;
use AUnit.Test_Cases, AUnit.Assertions;
package body Memcache.Test.Get is
package body Memcache.Client.Test.Get is
procedure Register_Tests (T : in out Get_Test) is
use AUnit.Test_Cases.Registration;
begin
@ -23,7 +23,7 @@ package body Memcache.Test.Get is
procedure Test_Gen_Get (T :
in out AUnit.Test_Cases.Test_Case'Class) is
Command : String := Memcache.Generate_Get ("GoodKey");
Command : String := Memcache.Client.Generate_Get ("GoodKey");
Expected : String := Append_CRLF ("get GoodKey");
begin
Assert (Command = Expected, "Bad command string");
@ -34,7 +34,7 @@ package body Memcache.Test.Get is
in out AUnit.Test_Cases.Test_Case'Class) is
begin
declare
Command : String := Memcache.Generate_Get ("Bad Key");
Command : String := Memcache.Client.Generate_Get ("Bad Key");
begin
Assert (False, "Should have raised an Invalid_Key_Error");
end;
@ -42,4 +42,4 @@ package body Memcache.Test.Get is
when Invalid_Key_Error =>
Assert (True, "Properly raised Invalid_Key_Error");
end Test_Gen_Get_Bad_Key;
end Memcache.Test.Get;
end Memcache.Client.Test.Get;

View File

@ -2,7 +2,7 @@
with AUnit;
with AUnit.Test_Cases;
package Memcache.Test.Get is
package Memcache.Client.Test.Get is
type Get_Test is new AUnit.Test_Cases.Test_Case with null record;
procedure Register_Tests (T : in out Get_Test);
@ -12,6 +12,6 @@ package Memcache.Test.Get is
in out AUnit.Test_Cases.Test_Case'Class);
procedure Test_Gen_Get_Bad_Key (T :
in out AUnit.Test_Cases.Test_Case'Class);
end Memcache.Test.Get;
end Memcache.Client.Test.Get;

View File

@ -2,7 +2,7 @@
with AUnit.Test_Cases, AUnit.Assertions;
use AUnit.Test_Cases, AUnit.Assertions;
package body Memcache.Test.Incr is
package body Memcache.Client.Test.Incr is
procedure Register_Tests (T : in out Incr_Test) is
use AUnit.Test_Cases.Registration;
begin
@ -26,7 +26,7 @@ package body Memcache.Test.Incr is
procedure Test_Gen_Incr (T :
in out AUnit.Test_Cases.Test_Case'Class) is
Command : String := Memcache.Generate_Incr ("GoodKey", 100, False);
Command : String := Memcache.Client.Generate_Incr ("GoodKey", 100, False);
Expected : String := Append_CRLF ("incr GoodKey 100");
begin
Assert (Command = Expected, "Bad command string");
@ -35,7 +35,7 @@ package body Memcache.Test.Incr is
procedure Test_Gen_Incr_No_Reply (T :
in out AUnit.Test_Cases.Test_Case'Class) is
Command : String := Memcache.Generate_Incr ("GoodKey", 100, True);
Command : String := Memcache.Client.Generate_Incr ("GoodKey", 100, True);
Expected : String := Append_CRLF ("incr GoodKey 100 noreply");
begin
Assert (Command = Expected, "Bad command string");
@ -46,7 +46,7 @@ package body Memcache.Test.Incr is
in out AUnit.Test_Cases.Test_Case'Class) is
begin
declare
Command : String := Memcache.Generate_Incr ("Bad Key", 0, False);
Command : String := Memcache.Client.Generate_Incr ("Bad Key", 0, False);
begin
Assert (False, "Should have raised an Invalid_Key_Error");
end;
@ -54,4 +54,4 @@ package body Memcache.Test.Incr is
when Invalid_Key_Error =>
Assert (True, "Properly raised Invalid_Key_Error");
end Test_Gen_Incr_Bad_Key;
end Memcache.Test.Incr;
end Memcache.Client.Test.Incr;

View File

@ -2,7 +2,7 @@
with AUnit;
with AUnit.Test_Cases;
package Memcache.Test.Incr is
package Memcache.Client.Test.Incr is
type Incr_Test is new AUnit.Test_Cases.Test_Case with null record;
procedure Register_Tests (T : in out Incr_Test);
@ -14,5 +14,5 @@ package Memcache.Test.Incr is
in out AUnit.Test_Cases.Test_Case'Class);
procedure Test_Gen_Incr_Bad_Key (T :
in out AUnit.Test_Cases.Test_Case'Class);
end Memcache.Test.Incr;
end Memcache.Client.Test.Incr;

View File

@ -2,7 +2,7 @@
with AUnit.Test_Cases, AUnit.Assertions;
use AUnit.Test_Cases, AUnit.Assertions;
package body Memcache.Test.Store is
package body Memcache.Client.Test.Store is
procedure Register_Tests (T : in out Store_Test) is
use AUnit.Test_Cases.Registration;
begin
@ -37,7 +37,7 @@ package body Memcache.Test.Store is
procedure Test_Gen_Set (T :
in out AUnit.Test_Cases.Test_Case'Class) is
Command : constant String := Generate_Store (Memcache.Set,
Command : constant String := Generate_Store (Memcache.Client.Set,
"sets", "magicvalue", 0,
60.0, False);
Expected : constant String := "set sets 0 60 10" &
@ -51,7 +51,7 @@ package body Memcache.Test.Store is
in out AUnit.Test_Cases.Test_Case'Class) is
Some_Time : constant Ada.Calendar.Time :=
Ada.Calendar.Time_Of (1985, 11, 20);
Command : constant String := Generate_Store (Memcache.Set,
Command : constant String := Generate_Store (Memcache.Client.Set,
"sets", "magicvalue", 0,
Some_Time, False);
Expected : constant String := "set sets 0 501292800 10" &
@ -64,7 +64,7 @@ package body Memcache.Test.Store is
procedure Test_Gen_Add (T :
in out AUnit.Test_Cases.Test_Case'Class) is
Command : constant String := Generate_Store (Memcache.Add,
Command : constant String := Generate_Store (Memcache.Client.Add,
"sets", "magicvalue", 0,
60.0, False);
Expected : constant String := "add sets 0 60 10" &
@ -77,7 +77,7 @@ package body Memcache.Test.Store is
procedure Test_Gen_Replace (T :
in out AUnit.Test_Cases.Test_Case'Class) is
Command : constant String := Generate_Store (Memcache.Replace,
Command : constant String := Generate_Store (Memcache.Client.Replace,
"sets", "magicvalue", 0,
60.0, False);
Expected : constant String := "replace sets 0 60 10" &
@ -90,7 +90,7 @@ package body Memcache.Test.Store is
procedure Test_Gen_Append (T :
in out AUnit.Test_Cases.Test_Case'Class) is
Command : constant String := Generate_Store (Memcache.Append,
Command : constant String := Generate_Store (Memcache.Client.Append,
"sets", "magicvalue", 0,
60.0, False);
Expected : constant String := "append sets 0 60 10" &
@ -103,7 +103,7 @@ package body Memcache.Test.Store is
procedure Test_Gen_Prepend (T :
in out AUnit.Test_Cases.Test_Case'Class) is
Command : constant String := Generate_Store (Memcache.Prepend,
Command : constant String := Generate_Store (Memcache.Client.Prepend,
"sets", "magicvalue", 0,
60.0, False);
Expected : constant String := "prepend sets 0 60 10" &
@ -113,4 +113,4 @@ package body Memcache.Test.Store is
Assert (Command = Expected, "Bad `prepend` command string");
end Test_Gen_Prepend;
end Memcache.Test.Store;
end Memcache.Client.Test.Store;

View File

@ -2,7 +2,7 @@
with AUnit;
with AUnit.Test_Cases;
package Memcache.Test.Store is
package Memcache.Client.Test.Store is
type Store_Test is new AUnit.Test_Cases.Test_Case with null record;
procedure Register_Tests (T : in out Store_Test);
@ -20,4 +20,4 @@ package Memcache.Test.Store is
in out AUnit.Test_Cases.Test_Case'Class);
procedure Test_Gen_Append (T :
in out AUnit.Test_Cases.Test_Case'Class);
end Memcache.Test.Store;
end Memcache.Client.Test.Store;

View File

@ -2,7 +2,7 @@
with AUnit.Test_Cases, AUnit.Assertions;
use AUnit.Test_Cases, AUnit.Assertions;
package body Memcache.Test is
package body Memcache.Client.Test is
procedure Register_Tests (T : in out Client_Test) is
use AUnit.Test_Cases.Registration;
begin
@ -35,7 +35,7 @@ package body Memcache.Test is
procedure Test_Validate_Empty_Key (T :
in out AUnit.Test_Cases.Test_Case'Class) is
begin
Memcache.Validate ("");
Memcache.Client.Validate ("");
Assert (False, "Should have raised an Invalid_Key_Error");
exception
when Invalid_Key_Error =>
@ -53,7 +53,7 @@ package body Memcache.Test is
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" &
"xxxxxxx";
begin
Memcache.Validate (Long_Key);
Memcache.Client.Validate (Long_Key);
Assert (False, "Should have raised an Invalid_Key_Error");
exception
when Invalid_Key_Error =>
@ -64,7 +64,7 @@ package body Memcache.Test is
procedure Test_Validate_Space_Key (T :
in out AUnit.Test_Cases.Test_Case'Class) is
begin
Memcache.Validate ("Bad Key");
Memcache.Client.Validate ("Bad Key");
Assert (False, "Should have raised an Invalid_Key_Error");
exception
when Invalid_Key_Error =>
@ -75,7 +75,7 @@ package body Memcache.Test is
procedure Test_Validate_Space_End_Key (T :
in out AUnit.Test_Cases.Test_Case'Class) is
begin
Memcache.Validate ("BadKey ");
Memcache.Client.Validate ("BadKey ");
Assert (False, "Should have raised an Invalid_Key_Error");
exception
when Invalid_Key_Error =>
@ -86,7 +86,7 @@ package body Memcache.Test is
procedure Test_Validate_Tab_Key (T :
in out AUnit.Test_Cases.Test_Case'Class) is
begin
Memcache.Validate ("Bad" & Character'Val (9));
Memcache.Client.Validate ("Bad" & Character'Val (9));
Assert (False, "Should have raised an Invalid_Key_Error");
exception
when Invalid_Key_Error =>
@ -97,10 +97,10 @@ package body Memcache.Test is
procedure Test_Validate_Newline_Key (T :
in out AUnit.Test_Cases.Test_Case'Class) is
begin
Memcache.Validate ("Bad" & Character'Val (10));
Memcache.Client.Validate ("Bad" & Character'Val (10));
Assert (False, "Should have raised an Invalid_Key_Error");
exception
when Invalid_Key_Error =>
Assert (True, "Properly raised Invalid_Key_Error");
end Test_Validate_Newline_Key;
end Memcache.Test;
end Memcache.Client.Test;

View File

@ -2,7 +2,7 @@
with AUnit;
with AUnit.Test_Cases;
package Memcache.Test is
package Memcache.Client.Test is
type Client_Test is new AUnit.Test_Cases.Test_Case with null record;
procedure Register_Tests (T : in out Client_Test);
@ -22,4 +22,4 @@ package Memcache.Test is
procedure Test_Validate_Newline_Key (T :
in out AUnit.Test_Cases.Test_Case'Class);
end Memcache.Test;
end Memcache.Client.Test;