OSDN Git Service

update test case
authormzp <mzpppp@gmail.com>
Sun, 8 Nov 2009 10:06:20 +0000 (19:06 +0900)
committermzp <mzpppp@gmail.com>
Sun, 8 Nov 2009 10:06:20 +0000 (19:06 +0900)
link/OMakefile
link/compact.ml [new file with mode: 0644]
link/compact.mli [new file with mode: 0644]
link/compactTest.ml [moved from link/uniqTest.ml with 63% similarity]
link/emptyAbc.ml [new file with mode: 0644]
link/linkTest.ml
link/relocTest.ml
link/uniq.ml [deleted file]

index 6d32f9a..fae3174 100644 (file)
@@ -30,9 +30,9 @@ OCamlProgram($(PROGRAM), main $(FILES))
 # Test
 # ------------------------------
 OUnitTest(cmdOpt, cmdOpt $(ROOT)/config)
-OUnitTest(link,   link reloc)
-OUnitTest(reloc,  reloc)
-OUnitTest(uniq,  uniq)
+OUnitTest(link,   link reloc emptyAbc)
+OUnitTest(reloc,  reloc emptyAbc)
+OUnitTest(compact,   compact emptyAbc)
 
 # ------------------------------
 # PHONY target
diff --git a/link/compact.ml b/link/compact.ml
new file mode 100644 (file)
index 0000000..4a9705f
--- /dev/null
@@ -0,0 +1,3 @@
+open Base
+
+let compact _ = undef
diff --git a/link/compact.mli b/link/compact.mli
new file mode 100644 (file)
index 0000000..dd32c18
--- /dev/null
@@ -0,0 +1 @@
+val compact : Swflib.Abc.abc -> Swflib.Abc.abc
similarity index 63%
rename from link/uniqTest.ml
rename to link/compactTest.ml
index 8c7cf79..3714475 100644 (file)
@@ -2,48 +2,11 @@ open Base
 open OUnit
 open Swflib.AbcType
 
-open Uniq
-
-let cpool = {
-  Swflib.AbcType.int = [];
-  uint          = [];
-  double        = [];
-  string        = [];
-  namespace     = [];
-  namespace_set = [];
-  multiname     = [];
-}
-
-let abc = {
-  Swflib.AbcType.cpool         = cpool;
-  method_info   = [];
-  metadata      = [];
-  classes       = [];
-  instances     = [];
-  scripts       = [];
-  method_bodies = []
-}
-
-let info = {
-  params       = [];
-  return       = 0;
-  method_name  = 0;
-  method_flags = []
-}
-
-let body = {
-  method_sig       = 0;
-  max_stack        = 0;
-  local_count      = 0;
-  init_scope_depth = 0;
-  max_scope_depth  = 0;
-  code             = [];
-  exceptions       = [];
-  method_traits    = []
-}
+open EmptyAbc
+open Compact
 
 let ok x y =
-  assert_equal x (uniq y)
+  assert_equal x (compact y)
 
 let _ = begin "uniq.ml" >::: [
   "id" >:: begin fun () ->
diff --git a/link/emptyAbc.ml b/link/emptyAbc.ml
new file mode 100644 (file)
index 0000000..75c2cd4
--- /dev/null
@@ -0,0 +1,54 @@
+open Swflib.AbcType
+
+let cpool = {
+  Swflib.AbcType.int = [];
+  uint          = [];
+  double        = [];
+  string        = [];
+  namespace     = [];
+  namespace_set = [];
+  multiname     = [];
+}
+
+let abc = {
+  Swflib.AbcType.cpool         = cpool;
+  method_info   = [];
+  metadata      = [];
+  classes       = [];
+  instances     = [];
+  scripts       = [];
+  method_bodies = []
+}
+
+let info = {
+  params       = [];
+  return       = 0;
+  method_name  = 0;
+  method_flags = []
+}
+
+let body = {
+  method_sig       = 0;
+  max_stack        = 0;
+  local_count      = 0;
+  init_scope_depth = 0;
+  max_scope_depth  = 0;
+  code             = [];
+  exceptions       = [];
+  method_traits    = []
+}
+
+let class_ = {
+  cinit=0;
+  class_traits=[];
+}
+
+let instance={
+  instance_name=0;
+  super_name=0;
+  instance_flags=[];
+  interfaces=[];
+  iinit=0;
+  instance_traits=[]
+}
+
index 6bbea7c..316c381 100644 (file)
@@ -3,64 +3,14 @@ open OUnit
 open Link
 open Swflib.AbcType
 
+open EmptyAbc
+
 let ok ?msg x y z =
   assert_equal ?msg ~printer:Std.dump x (link y z)
 
 let lok ?msg x y =
   ok ?msg x y y
 
-let cpool = {
-  int           = [];
-  uint          = [];
-  double        = [];
-  string        = [];
-  namespace     = [];
-  namespace_set = [];
-  multiname     = []
-}
-
-let abc = {
-  cpool         = cpool;
-  method_info   = [];
-  metadata      = [];
-  classes       = [];
-  instances     = [];
-  scripts       = [];
-  method_bodies = []
-}
-
-let info = {
-  params       = [];
-  return       = 0;
-  method_name  = 0;
-  method_flags = []
-}
-
-let body = {
-  method_sig       = 0;
-  max_stack        = 0;
-  local_count      = 0;
-  init_scope_depth = 0;
-  max_scope_depth  = 0;
-  code             = [];
-  exceptions       = [];
-  method_traits    = []
-}
-
-let class_ = {
-  cinit=0;
-  class_traits=[];
-}
-
-let instance={
-  instance_name=0;
-  super_name=0;
-  instance_flags=[];
-  interfaces=[];
-  iinit=0;
-  instance_traits=[]
-}
-
 let _ = begin "link.ml" >::: [
   "ident" >:: begin fun () ->
     ok abc abc abc
index 16a7743..c3f2896 100644 (file)
@@ -1,6 +1,7 @@
 open Base
 open OUnit
 open Swflib.AbcType
+open EmptyAbc
 open Reloc
 
 let plus n x = n + x
@@ -17,59 +18,6 @@ let ctx = {
 }
 let ok x y = assert_equal x @@ reloc ctx y
 
-let cpool = {
-  Swflib.AbcType.int = [];
-  uint          = [];
-  double        = [];
-  string        = [];
-  namespace     = [];
-  namespace_set = [];
-  multiname     = [];
-}
-
-let abc = {
-  Swflib.AbcType.cpool         = cpool;
-  method_info   = [];
-  metadata      = [];
-  classes       = [];
-  instances     = [];
-  scripts       = [];
-  method_bodies = []
-}
-
-let info = {
-  params       = [];
-  return       = 0;
-  method_name  = 0;
-  method_flags = []
-}
-
-let body = {
-  method_sig       = 0;
-  max_stack        = 0;
-  local_count      = 0;
-  init_scope_depth = 0;
-  max_scope_depth  = 0;
-  code             = [];
-  exceptions       = [];
-  method_traits    = []
-}
-
-let class_ = {
-  cinit=0;
-  class_traits=[];
-}
-
-let instance={
-  instance_name=0;
-  super_name=0;
-  instance_flags=[];
-  interfaces=[];
-  iinit=0;
-  instance_traits=[]
-}
-
-
 let _ = begin "reloc.ml" >::: [
   "cpool" >:: begin fun () ->
     ok
diff --git a/link/uniq.ml b/link/uniq.ml
deleted file mode 100644 (file)
index 9d21cc1..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-open Base
-
-let uniq _ = undef