Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
DavePearce committed May 27, 2016
2 parents d78a050 + 34af413 commit c626fc7
Show file tree
Hide file tree
Showing 314 changed files with 12,829 additions and 15,679 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
*.smt2
/report/
/build/
/dist/
/modules/wycs/src/wycs/core/Types.java
/modules/wycs/src/wycs/solver/Solver.java
/modules/wycs/src/wycs/solver/Solver.java
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ jdk:

#
script:
ant test-all
- touch running_on_travis
- ant test-all
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!-- Get the root directory of the project by looking at the directory enclosing this file. -->
<dirname property="rootdir" file="${ant.file.BuildConfig}"/>
<!-- Set the current Whiley version -->
<property name="version" value="0.3.39"/>
<property name="version" value="0.3.40"/>
<!-- Load the Maven Ant tasks so that we can work with Maven repositories. -->
<typedef uri="urn:maven-ant"
classpath="${rootdir}/lib/maven-ant-tasks-2.1.3.jar"
Expand Down
26 changes: 20 additions & 6 deletions modules/wybs/src/wyfs/util/VirtualRoot.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ public static final class Entry<T> extends AbstractEntry<T> implements Path.Entr
*/
private byte[] data;

/**
* Number of bytes in data actually used.
*/
private int length;

/**
* The last modified date. This is a time stamp used to determine when
* the file was last modified in order to calculate which dependents
Expand All @@ -98,22 +103,31 @@ public long lastModified() {
}

public InputStream inputStream() {
return new ByteArrayInputStream(data);
return new ByteArrayInputStream(data,0,length);
}

public OutputStream outputStream() {
lastModified = System.currentTimeMillis();
data = new byte[0];
length = 0;
// create an output stream which will automatically resize the given
// array.
return new OutputStream() {
private int pos = 0;

return new OutputStream() {
public void write(byte[] bytes) {
data = new byte[bytes.length];
System.arraycopy(bytes, 0, data, 0, bytes.length);
length = data.length;
}
public void write(byte[] bytes, int off, int len) {
data = new byte[len];
System.arraycopy(bytes, off, data, 0, len);
length = data.length;
}
public void write(int b) {
if (pos >= data.length) {
if (length >= data.length) {
data = Arrays.copyOf(data, (data.length + 1) * 2);
}
data[pos++] = (byte) b;
data[length++] = (byte) b;
}
};
}
Expand Down
2 changes: 1 addition & 1 deletion modules/wyc/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<property name="test.name.contains" value=""/>

<target name="test" depends="test-compile-wyc">
<junit fork="true" dir="${basedir}" failureProperty="tests.failed" printsummary="yes" outputtoformatters="true">
<junit fork="true" dir="${basedir}" failureProperty="tests.failed" printsummary="yes" showoutput="yes" outputtoformatters="no">
<classpath>
<pathelement path="src:../wyil/src:../wybs/src/:../wycs/src:../../${WYRL_JAR}"/>
<path refid="junit.classpath"/>
Expand Down
Loading

0 comments on commit c626fc7

Please sign in to comment.