Combine duplicate unordered_set unordered_map testcases

Merge cpp11_li_std_unordered_map into cpp11_std_unordered_map
Merge cpp11_li_std_unordered_set into cpp11_std_unordered_set
This commit is contained in:
William S Fulton 2019-02-12 06:36:01 +00:00
commit 82d1632071
7 changed files with 16 additions and 33 deletions

View file

@ -1,11 +0,0 @@
/*
* A test of unordered_map containers.
*/
%module cpp11_li_std_unordered_map
%include <std_string.i>
%include <std_unordered_map.i>
%template(IntIntUnorderedMap) std::unordered_map<int, int>;
%template(StringIntUnorderedMap) std::unordered_map<std::string, int>;

View file

@ -1,10 +0,0 @@
/*
* A test of unordered_set containers.
*/
%module cpp11_li_std_unordered_set
%include <std_string.i>
%include <std_unordered_set.i>
%template(StringUnorderedSet) std::unordered_set<std::string>;

View file

@ -1,5 +1,7 @@
%module cpp11_std_unordered_map %module cpp11_std_unordered_map
%include <std_string.i>
%include <std_unordered_map.i> %include <std_unordered_map.i>
%template(UnorderedMapIntInt) std::unordered_map<int, int>; %template(UnorderedMapIntInt) std::unordered_map<int, int>;
%template(UnorderedMapStringInt) std::unordered_map<std::string, int>;

View file

@ -1,5 +1,7 @@
%module cpp11_std_unordered_set %module cpp11_std_unordered_set
%include <std_string.i>
%include <std_unordered_set.i> %include <std_unordered_set.i>
%template(UnorderedSetInt) std::unordered_set<int>; %template(UnorderedSetInt) std::unordered_set<int>;
%template(UnorderedSetString) std::unordered_set<std::string>;

View file

@ -53,9 +53,9 @@ CPP11_TEST_CASES = \
cpp11_shared_ptr_nullptr_in_containers \ cpp11_shared_ptr_nullptr_in_containers \
cpp11_shared_ptr_overload \ cpp11_shared_ptr_overload \
cpp11_shared_ptr_upcast \ cpp11_shared_ptr_upcast \
cpp11_std_unordered_map \
cpp11_std_unordered_set \
cpp11_strongly_typed_enumerations_simple \ cpp11_strongly_typed_enumerations_simple \
cpp11_li_std_unordered_map \
cpp11_li_std_unordered_set \
DOXYGEN_TEST_CASES := \ DOXYGEN_TEST_CASES := \
doxygen_parsing_enums_simple \ doxygen_parsing_enums_simple \

View file

@ -1,10 +1,10 @@
import cpp11_li_std_unordered_map.*; import cpp11_std_unordered_map.*;
public class cpp11_li_std_unordered_map_runme { public class cpp11_std_unordered_map_runme {
static { static {
try { try {
System.loadLibrary("cpp11_li_std_unordered_map"); System.loadLibrary("cpp11_std_unordered_map");
} catch (UnsatisfiedLinkError e) { } catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e); System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
System.exit(1); System.exit(1);
@ -20,8 +20,8 @@ public class cpp11_li_std_unordered_map_runme {
public static void main(String argv[]) throws Throwable public static void main(String argv[]) throws Throwable
{ {
java.util.AbstractMap<String, Integer> sim = new StringIntUnorderedMap(); java.util.AbstractMap<String, Integer> sim = new UnorderedMapStringInt();
java.util.AbstractMap<Integer, Integer> iim = new IntIntUnorderedMap(); java.util.AbstractMap<Integer, Integer> iim = new UnorderedMapIntInt();
checkThat(sim.isEmpty()); checkThat(sim.isEmpty());
checkThat(iim.isEmpty()); checkThat(iim.isEmpty());

View file

@ -1,10 +1,10 @@
import cpp11_li_std_unordered_set.*; import cpp11_std_unordered_set.*;
public class cpp11_li_std_unordered_set_runme { public class cpp11_std_unordered_set_runme {
static { static {
try { try {
System.loadLibrary("cpp11_li_std_unordered_set"); System.loadLibrary("cpp11_std_unordered_set");
} catch (UnsatisfiedLinkError e) { } catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e); System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
System.exit(1); System.exit(1);
@ -20,7 +20,7 @@ public class cpp11_li_std_unordered_set_runme {
public static void main(String argv[]) throws Throwable public static void main(String argv[]) throws Throwable
{ {
java.util.AbstractSet<String> ss = new StringUnorderedSet(); java.util.AbstractSet<String> ss = new UnorderedSetString();
checkThat(ss.isEmpty()); checkThat(ss.isEmpty());
checkThat(!ss.contains("key")); checkThat(!ss.contains("key"));
@ -63,7 +63,7 @@ public class cpp11_li_std_unordered_set_runme {
checkThat(ss.containsAll(found)); checkThat(ss.containsAll(found));
checkThat(found.containsAll(ss)); checkThat(found.containsAll(ss));
java.util.AbstractSet<String> ss2 = new StringUnorderedSet(ss); java.util.AbstractSet<String> ss2 = new UnorderedSetString(ss);
checkThat(ss2.containsAll(ss)); checkThat(ss2.containsAll(ss));
checkThat(ss.containsAll(ss2)); checkThat(ss.containsAll(ss2));