diff --git a/src/test/java/com/eprosima/fastdds/FastDDSGenTest.java b/src/test/java/com/eprosima/fastdds/FastDDSGenTest.java index ff563da4..5bc21a09 100644 --- a/src/test/java/com/eprosima/fastdds/FastDDSGenTest.java +++ b/src/test/java/com/eprosima/fastdds/FastDDSGenTest.java @@ -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()); @@ -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()); + absolute_idl_dir, new ArrayList()); assertEquals("", ctx.getRelativeDir(null)); } { com.eprosima.idl.context.Context ctx = new com.eprosima.idl.context.Context( - "/home/testing/Prueba.idl", new ArrayList()); + absolute_idl_dir, new ArrayList()); - 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()); + absolute_idl_dir, new ArrayList()); - assertEquals("testing/", ctx.getRelativeDir("/home/")); + assertEquals("testing/", ctx.getRelativeDir(absolute_root_dir)); } }