/*
 * This file is covered by the terms of the Common Public License v1.0.
 *
 * Copyright (c) SZEDER Gábor
 *
 * Parts of this software were developed within the JEOPARD research
 * project, which received funding from the European Union's Seventh
 * Framework Programme under grant agreement No. 216682.
 */

package de.fzi.cjunit.jpf.util;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;

import org.junit.Test;


public class StackFrameConverterTest {

	StackFrameConverter sfc = new StackFrameConverter();

	@Test
	public void sourceFileBasenameStripDirs() {
		String filename = "Object.java";
		assertThat(sfc.sourceFileBasename("java/lang/" + filename),
				equalTo(filename));
	}

	@Test
	public void sourceFileBasenameNothingToStrip() {
		String magicFilename = "<direct call>";
		assertThat(sfc.sourceFileBasename(magicFilename),
				equalTo(magicFilename));
	}
}

@@ -430,16 +430,38 @@
 ers.*;%0A%0A
+import java.io.File;%0A%0A
 import o
@@ -659,16 +659,119 @@
 .java%22;%0A
+%09%09String filenameWithPath = %22java%22 + File.separatorChar%0A%09%09%09%09+ %22lang/%22 + File.separatorChar + filename;%0A
 %09%09assert
@@ -802,31 +802,16 @@
 ame(
-%22java/lang/%22 + 
 filename
 ),%0A%09
@@ -802,24 +802,32 @@
 ame(filename
+WithPath
 ),%0A%09%09%09%09equal

use system-dependent path name separator