Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for assertInvariants (0.13 sec)

  1. guava-testlib/src/com/google/common/collect/testing/MapInterfaceTest.java

          } catch (NullPointerException optional) {
          }
        }
        assertInvariants(map);
      }
    
      public void testEntrySet() {
        Map<K, V> map;
        try {
          map = makePopulatedMap();
        } catch (UnsupportedOperationException e) {
          return;
        }
        assertInvariants(map);
    
        Set<Entry<K, V>> entrySet = map.entrySet();
        K unmappedKey;
        V unmappedValue;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 43.8K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/hash/AbstractStreamingHasherTest.java

        sink.putBytes(new byte[] {});
        sink.putBytes(new byte[] {8});
        HashCode unused = sink.hash();
        sink.assertInvariants(8);
        sink.assertBytes(expected);
      }
    
      public void testShort() {
        Sink sink = new Sink(4);
        sink.putShort((short) 0x0201);
        HashCode unused = sink.hash();
        sink.assertInvariants(2);
        sink.assertBytes(new byte[] {1, 2, 0, 0}); // padded with zeros
      }
    
      public void testInt() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Jul 23 14:22:54 UTC 2024
    - 8.5K bytes
    - Viewed (0)
  3. android/guava-testlib/src/com/google/common/collect/testing/MapInterfaceTest.java

          } catch (NullPointerException optional) {
          }
        }
        assertInvariants(map);
      }
    
      public void testEntrySet() {
        Map<K, V> map;
        try {
          map = makePopulatedMap();
        } catch (UnsupportedOperationException e) {
          return;
        }
        assertInvariants(map);
    
        Set<Entry<K, V>> entrySet = map.entrySet();
        K unmappedKey;
        V unmappedValue;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 43.8K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/hash/AbstractStreamingHasherTest.java

        sink.putBytes(new byte[] {});
        sink.putBytes(new byte[] {8});
        HashCode unused = sink.hash();
        sink.assertInvariants(8);
        sink.assertBytes(expected);
      }
    
      public void testShort() {
        Sink sink = new Sink(4);
        sink.putShort((short) 0x0201);
        HashCode unused = sink.hash();
        sink.assertInvariants(2);
        sink.assertBytes(new byte[] {1, 2, 0, 0}); // padded with zeros
      }
    
      public void testInt() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Jul 23 14:22:54 UTC 2024
    - 8.5K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/hash/HashingTest.java

        HashTestUtils.assertInvariants(Hashing.sha512());
        assertEquals("Hashing.sha512()", Hashing.sha512().toString());
      }
    
      public void testCrc32() {
        HashTestUtils.assertInvariants(Hashing.crc32());
        assertEquals("Hashing.crc32()", Hashing.crc32().toString());
      }
    
      public void testAdler32() {
        HashTestUtils.assertInvariants(Hashing.adler32());
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Jul 09 17:40:09 UTC 2024
    - 26.3K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/hash/Murmur3Hash32Test.java

        // https://github.com/aappleby/smhasher/blob/master/src/main.cpp
        HashTestUtils.verifyHashFunction(hf, 32, 0xB0F57EE3);
      }
    
      public void testInvariants() {
        HashTestUtils.assertInvariants(murmur3_32());
      }
    
      @SuppressWarnings("deprecation")
      public void testInvalidUnicodeHashString() {
        String str =
            new String(
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:29:46 UTC 2024
    - 8.3K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/collect/TableCollectionTest.java

            assertEquals(initialSize - 1, map.size());
          } else {
            assertThrows(UnsupportedOperationException.class, () -> map.remove(keyToRemove));
          }
          assertInvariants(map);
        }
      }
    
      abstract static class RowMapTests extends MapMapTests {
        RowMapTests(
            boolean allowsNullValues,
            boolean supportsRemove,
            boolean supportsClear,
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 35.2K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/collect/TableCollectionTest.java

            assertEquals(initialSize - 1, map.size());
          } else {
            assertThrows(UnsupportedOperationException.class, () -> map.remove(keyToRemove));
          }
          assertInvariants(map);
        }
      }
    
      abstract static class RowMapTests extends MapMapTests {
        RowMapTests(
            boolean allowsNullValues,
            boolean supportsRemove,
            boolean supportsClear,
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 35.2K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/hash/HashTestUtils.java

            }
          }
        }
      }
    
      /**
       * Checks that a Hasher returns the same HashCode when given the same input, and also that the
       * collision rate looks sane.
       */
      static void assertInvariants(HashFunction hashFunction) {
        int objects = 100;
        Set<HashCode> hashcodes = Sets.newHashSetWithExpectedSize(objects);
        Random random = new Random(314159);
        for (int i = 0; i < objects; i++) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Jul 23 14:22:54 UTC 2024
    - 25.5K bytes
    - Viewed (0)
Back to top