Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 97 for unsigned (0.18 sec)

  1. src/test/java/jcifs/internal/dfs/DfsReferralRequestBufferTest.java

                int maxReferralLevel = -1;
    
                buffer = new DfsReferralRequestBuffer(path, maxReferralLevel);
    
                assertNotNull(buffer);
                // Negative values will be cast to unsigned when encoded
                assertEquals(4 + 2 * path.length(), buffer.size());
            }
        }
    
        @Nested
        @DisplayName("Size Calculation Tests")
        class SizeTests {
    
            @ParameterizedTest
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 17.5K bytes
    - Viewed (0)
  2. src/test/java/jcifs/internal/smb2/ioctl/SrvCopychunkTest.java

                assertEquals(maxInt, SMBUtil.readInt4(buffer, startIndex + 16));
            }
    
            @Test
            @DisplayName("Should encode negative values as unsigned")
            void testEncodeNegativeValues() {
                // Given
                long negativeOffset = -1L;
                int negativeLength = -1;
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 12.4K bytes
    - Viewed (0)
  3. src/test/java/jcifs/internal/smb2/io/Smb2FlushResponseTest.java

            }
    
            @Test
            @DisplayName("Should handle negative structure size as unsigned")
            void testReadBytesWireFormatNegativeAsUnsigned() {
                // Given
                byte[] buffer = new byte[10];
                // Write -1 which will be read as 65535 unsigned
                buffer[0] = (byte) 0xFF;
                buffer[1] = (byte) 0xFF;
    
                // When & Then
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 10.3K bytes
    - Viewed (0)
  4. src/test/java/jcifs/internal/smb1/SMB1SigningDigestTest.java

            // The verification should succeed (return false) since we're using the same key
            assertFalse(result);
        }
    
        @Test
        @DisplayName("Test verify method with unsigned response")
        void testVerifyWithUnsignedResponse() {
            SMB1SigningDigest digest = new SMB1SigningDigest(testMacSigningKey);
            byte[] data = new byte[100];
    
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 18.1K bytes
    - Viewed (0)
  5. src/test/java/jcifs/internal/smb1/com/SmbComQueryInformationResponseTest.java

        }
    
        @Test
        void testMaximumFileSize() {
            // Test with maximum unsigned 32-bit file size
            // Note: fileSize is stored as signed int in SmbComQueryInformationResponse
            // 0xFFFFFFFF becomes -1 when interpreted as signed int
            response = new SmbComQueryInformationResponse(mockConfig, 0L);
            setFieldValue(response, "wordCount", 10);
    
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 11.9K bytes
    - Viewed (0)
  6. src/test/java/jcifs/smb1/util/HexdumpTest.java

            assertEquals("1234", Hexdump.toHexString(0x1234, 4));
            assertEquals("34", Hexdump.toHexString(0x1234, 2));
    
            // Test negative values (treated as unsigned)
            assertEquals("FFFFFFFF", Hexdump.toHexString(-1, 8));
            assertEquals("FFFF", Hexdump.toHexString(-1, 4));
            assertEquals("FF", Hexdump.toHexString(-1, 2));
        }
    
        @Test
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 11.4K bytes
    - Viewed (0)
  7. src/test/java/jcifs/internal/smb2/lock/Smb2LockTest.java

            void testEncodingWithNegativeValues() {
                long negativeOffset = -1L;
                long negativeLength = -100L;
                int negativeFlags = -1;
    
                lock = new Smb2Lock(negativeOffset, negativeLength, negativeFlags);
                lock.encode(buffer, 0);
    
                // Negative values should be encoded as unsigned
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 10.9K bytes
    - Viewed (0)
  8. src/test/java/jcifs/smb/SSPContextTest.java

            public byte[] calculateMIC(byte[] data) throws CIFSException {
                if (data == null) {
                    throw new CIFSException("data is null");
                }
                // Trivial MIC: 1-byte sum of all unsigned bytes
                int sum = 0;
                for (byte b : data) {
                    sum = (sum + (b & 0xFF)) & 0xFF;
                }
                return new byte[] { (byte) sum };
            }
    
            @Override
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 15.2K bytes
    - Viewed (0)
  9. src/test/java/jcifs/internal/smb1/net/TestSmbComTransactionResponseReader.java

        @Test
        public void testByteOperations() {
            // Test byte operations that were used in the original test
            byte b = (byte) 0xFF;
            int value = b & 0xFF;
            assertEquals(255, value, "Byte to unsigned conversion should work");
    
            // Test comparison operation
            assertTrue(value == 255, "Comparison should work correctly");
        }
    
        /**
         * Encode a string as 16-bit little-endian Unicode
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 4.2K bytes
    - Viewed (0)
  10. src/test/java/jcifs/internal/smb2/info/Smb2SetInfoResponseTest.java

        void testReadBytesWireFormatNegativeStructureSize() {
            byte[] buffer = new byte[1024];
            int bufferIndex = 0;
    
            // Set structure size to -1 (0xFFFF when read as unsigned)
            SMBUtil.writeInt2(0xFFFF, buffer, bufferIndex);
    
            SMBProtocolDecodingException exception =
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 10.3K bytes
    - Viewed (0)
Back to top