Skip to content

Commit

Permalink
Refs #18687. Fix test on windows
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo González <[email protected]>
  • Loading branch information
richiware committed Sep 11, 2023
1 parent 7e57393 commit 478a280
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/test/java/com/eprosima/fastdds/FastDDSGenTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ private static boolean isUnix()
@Test
public void Context_getRelativeDir_Test()
{
String absolute_idl_dir = isUnix() ?
"/home/testing/Prueba.idl" : "C:/Users/testing/Prueba.idl";
String absolute_dir = isUnix() ?
"/home/testing/" : "C:/Users/testing/";
String absolute_root_dir = isUnix() ?
"/home/" : "C:/Users/";

{
com.eprosima.idl.context.Context ctx = new com.eprosima.idl.context.Context(
"Prueba.idl", new ArrayList<String>());
Expand Down Expand Up @@ -72,23 +79,23 @@ public void Context_getRelativeDir_Test()

{
com.eprosima.idl.context.Context ctx = new com.eprosima.idl.context.Context(
"/home/testing/Prueba.idl", new ArrayList<String>());
absolute_idl_dir, new ArrayList<String>());

assertEquals("", ctx.getRelativeDir(null));
}

{
com.eprosima.idl.context.Context ctx = new com.eprosima.idl.context.Context(
"/home/testing/Prueba.idl", new ArrayList<String>());
absolute_idl_dir, new ArrayList<String>());

assertEquals("", ctx.getRelativeDir("/home/testing/"));
assertEquals("", ctx.getRelativeDir(absolute_dir));
}

{
com.eprosima.idl.context.Context ctx = new com.eprosima.idl.context.Context(
"/home/testing/Prueba.idl", new ArrayList<String>());
absolute_idl_dir, new ArrayList<String>());

assertEquals("testing/", ctx.getRelativeDir("/home/"));
assertEquals("testing/", ctx.getRelativeDir(absolute_root_dir));
}
}

Expand Down

0 comments on commit 478a280

Please sign in to comment.