gitweb on Svarog
projekti pod git sistemom za održavanje verzija -- projects under the git version control system
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bc9eddc)
raw | patch | inline | side by side (parent: bc9eddc)
author | Doni Pracner <quinnuendo@gmail.com> | |
Tue, 17 Nov 2015 17:09:15 +0000 (18:09 +0100) | ||
committer | Doni Pracner <quinnuendo@gmail.com> | |
Tue, 17 Nov 2015 17:09:15 +0000 (18:09 +0100) |
Hash/TestHash.java | patch | blob | history |
diff --git a/Hash/TestHash.java b/Hash/TestHash.java
index 565614b81066a83302cf5267e26730d8aa691046..e1906f7ec54b7897fc4d40367e964463017034c3 100644 (file)
--- a/Hash/TestHash.java
+++ b/Hash/TestHash.java
OHashSet<InfoTip> hash = new OHashSet<>(size);
if (Svetovid.testIn(fajl)) {
while (Svetovid.in(fajl).hasMore()) {
- hash.add(i.ucitaj(Svetovid.in(fajl)));
+ InfoTip sledeci = i.ucitaj(Svetovid.in(fajl));
+ hash.add(sledeci);
}
Svetovid.closeIn(fajl);
+
+ hash.printStats();
+ } else {
+ System.err.println("ne moze se otvoriti fajl!");
}
- hash.printStats();
}
/*
hash.add(i.ucitaj(Svetovid.in(fajl)));
}
Svetovid.closeIn(fajl);
- }
- System.out.println("-- dodatni testovi ubacivanja i izbacivanja --");
- // hash.printStats();
- InfoTip it = hash.someElement();
- if (!hash.add(it)) {
- System.out.println("success: not added again");
- } else {
- System.out.println("fail: added again!");
- }
- if (hash.remove(it)) {
- System.out.println("success: removed");
- } else {
- System.out.println("fail: not removed!");
- }
- if (hash.add(it)) {
- System.out.println("success: added back in");
+
+ System.out
+ .println("-- dodatni testovi ubacivanja i izbacivanja --");
+ // hash.printStats();
+ InfoTip it = hash.someElement();
+ if (!hash.add(it)) {
+ System.out.println("uspeh: nije ponovo dodat");
+ } else {
+ System.out.println("neuspeh: ponovo dodat!");
+ }
+ if (hash.remove(it)) {
+ System.out.println("uspeh: uklonjen");
+ if (hash.add(it)) {
+ System.out.println("uspeh: vracen");
+ } else {
+ System.out.println("neuspeh: nije vracen");
+ }
+ } else {
+ System.out.println("neuspeh: nije uklonjen!");
+ }
} else {
- System.out.println("fail: not added back in");
+ System.err.println("ne moze se otvoriti fajl!");
}
}