Skip to content

Commit

Permalink
Disable UNC tests on ANSI API
Browse files Browse the repository at this point in the history
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
  • Loading branch information
T-Svensson authored and dbwiddis committed Jul 10, 2020
1 parent cda654c commit de8b6fc
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
*/
package com.sun.jna.platform.win32;

import com.sun.jna.win32.W32APITypeMapper;

import junit.framework.TestCase;

public class ShlwapiTest extends TestCase {
Expand All @@ -35,12 +37,14 @@ public void testPathIsUNC() {
assertEquals(true, Shlwapi.INSTANCE.PathIsUNC("\\\\path1"));
assertEquals(false, Shlwapi.INSTANCE.PathIsUNC("acme\\\\path4\\\\path5"));
assertEquals(true, Shlwapi.INSTANCE.PathIsUNC("\\\\"));
assertEquals(true, Shlwapi.INSTANCE.PathIsUNC("\\\\?\\UNC\\path1\\path2"));
assertEquals(true, Shlwapi.INSTANCE.PathIsUNC("\\\\?\\UNC\\path1"));
assertEquals(true, Shlwapi.INSTANCE.PathIsUNC("\\\\?\\UNC\\"));
assertEquals(false, Shlwapi.INSTANCE.PathIsUNC("\\path1"));
assertEquals(false, Shlwapi.INSTANCE.PathIsUNC("path1"));
assertEquals(false, Shlwapi.INSTANCE.PathIsUNC("c:\\path1"));
assertEquals(false, Shlwapi.INSTANCE.PathIsUNC("\\\\?\\c:\\path1"));
if (W32APITypeMapper.DEFAULT == W32APITypeMapper.UNICODE) { // UNC is only available on UNICODE API
assertEquals(true, Shlwapi.INSTANCE.PathIsUNC("\\\\?\\UNC\\path1\\path2"));
assertEquals(true, Shlwapi.INSTANCE.PathIsUNC("\\\\?\\UNC\\path1"));
assertEquals(true, Shlwapi.INSTANCE.PathIsUNC("\\\\?\\UNC\\"));
assertEquals(false, Shlwapi.INSTANCE.PathIsUNC("\\\\?\\c:\\path1"));
}
}
}

0 comments on commit de8b6fc

Please sign in to comment.