Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 118 for teststring (0.05 sec)

  1. src/test/java/jcifs/pac/PacUnicodeStringTest.java

            PacUnicodeString pacString = new PacUnicodeString((short) 10, (short) 20, 100);
            String testString = "abcde";
    
            // The check method should return the same string instance
            String result = pacString.check(testString);
            assertSame(testString, result, "The check method should return the original string on success.");
        }
    
        /**
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 5.7K bytes
    - Viewed (0)
  2. src/test/java/jcifs/smb1/smb1/ServerMessageBlockTest.java

            smb.useUnicode = false;
            String testString = "Hello World";
            byte[] buffer = new byte[testString.length() + 1];
            int len = smb.writeString(testString, buffer, 0);
            assertEquals(testString.length() + 1, len);
            String readString = smb.readString(buffer, 0);
            assertEquals(testString, readString);
        }
    
        @Test
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 9.9K bytes
    - Viewed (0)
  3. src/test/java/jcifs/util/EncdecTest.java

            // Given
            String testString = "Hello";
            byte[] buffer = new byte[testString.length()];
    
            // When - Manual string encoding using individual bytes
            byte[] strBytes = testString.getBytes();
            System.arraycopy(strBytes, 0, buffer, 0, strBytes.length);
    
            // Then
            String decoded = new String(buffer);
            assertEquals(testString, decoded);
        }
    
        @Test
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 5.1K bytes
    - Viewed (0)
  4. src/test/java/jcifs/internal/smb1/ServerMessageBlockTest.java

                testBlock.setUseUnicode(true);
                byte[] buffer = new byte[100];
                String testString = "Test";
    
                int bytesWritten = testBlock.writeString(testString, buffer, 10);
    
                // Unicode strings are written as UTF-16LE with null terminator
                assertTrue(bytesWritten > testString.length());
                // First byte should be 'T' in UTF-16LE (0x54)
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 36.2K bytes
    - Viewed (0)
  5. src/test/java/jcifs/internal/smb1/net/NetShareEnumResponseTest.java

        }
    
        @Test
        @DisplayName("Test readString with ASCII encoding")
        void testReadStringAscii() throws Exception {
            String testString = "TestString";
            byte[] buffer = new byte[128];
            byte[] stringBytes = testString.getBytes(StandardCharsets.US_ASCII);
            System.arraycopy(stringBytes, 0, buffer, 10, stringBytes.length);
            buffer[10 + stringBytes.length] = 0; // null terminator
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 20.2K bytes
    - Viewed (0)
  6. src/test/java/jcifs/pac/PacLogonInfoTest.java

            String testString = "TEST";
            short length = (short) (testString.length() * 2); // Unicode length
            PacUnicodeString unicodeString = new PacUnicodeString(length, length, 100);
    
            // Should validate string length
            String result = unicodeString.check(testString);
            assertEquals(testString, result);
    
            // Should reject wrong length
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 12.3K bytes
    - Viewed (0)
  7. src/test/java/jcifs/dcerpc/ndr/NdrBufferTest.java

        }
    
        @Test
        void testEncDecNdrString() throws NdrException {
            String testString = "Hello World";
            ndrBuffer.enc_ndr_string(testString);
    
            // Expected length: 4 (actual_count) + 4 (offset) + 4 (max_count) + len*2 (unicode) + 2 (null terminator)
            int expectedLength = 4 + 4 + 4 + (testString.length() * 2) + 2;
            assertEquals(expectedLength, ndrBuffer.getIndex());
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 14.3K bytes
    - Viewed (0)
  8. src/test/java/jcifs/util/StringsTest.java

                byte[] result = Strings.getUNIBytes(TEST_STRING);
    
                // Then
                assertNotNull(result, "Result should not be null");
                assertTrue(result.length > 0, "Result should not be empty");
                assertEquals(TEST_STRING.getBytes(StandardCharsets.UTF_16LE).length, result.length, "Length should match UTF-16LE encoding");
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 18.6K bytes
    - Viewed (0)
  9. src/test/java/jcifs/internal/smb1/net/NetServerEnum2ResponseTest.java

        }
    
        @Test
        @DisplayName("Test readString with ASCII encoding")
        void testReadStringAscii() throws Exception {
            String testString = "TestString";
            byte[] buffer = new byte[128];
            byte[] stringBytes = testString.getBytes(StandardCharsets.US_ASCII);
            System.arraycopy(stringBytes, 0, buffer, 10, stringBytes.length);
            buffer[10 + stringBytes.length] = 0; // null terminator
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 25.4K bytes
    - Viewed (0)
  10. src/test/java/jcifs/util/InputValidatorTest.java

            assertEquals("teststring", InputValidator.sanitizeForLogging("test\0string"));
            assertEquals("teststring", InputValidator.sanitizeForLogging("test\nstring"));
            assertEquals("teststring", InputValidator.sanitizeForLogging("test\rstring"));
            assertEquals("teststring", InputValidator.sanitizeForLogging("test\tstring"));
    
            // Test long string truncation
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 11.9K bytes
    - Viewed (0)
Back to top