Skip to content

Commit

Permalink
Merge pull request #171 from crocs-muni/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
petrs authored Sep 17, 2018
2 parents 45c684c + 2c5c7af commit b3f27cc
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
Binary file modified AlgTest_JClient/dist/AlgTestJClient.jar
Binary file not shown.
25 changes: 17 additions & 8 deletions AlgTest_JClient/src/algtestjclient/PerformanceTesting.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public PerformanceTesting(DirtyLogger logger) {
m_testDataLengths.add(512);
}

String getCurrentTestInfoString() {
String getCurrentTestInfoString(boolean bAppendTime) {
String testInfo = m_cardName + "___";
testInfo += "_PERFORMANCE_";

Expand All @@ -111,7 +111,9 @@ String getCurrentTestInfoString() {
testInfo += "DATAFIXED_";
}

testInfo += System.currentTimeMillis() + "_"; // add unique time counter
if (bAppendTime) {
testInfo += System.currentTimeMillis() + "_"; // add unique time counter
}

return testInfo;
}
Expand Down Expand Up @@ -176,9 +178,10 @@ public void testPerformance(String[] args, boolean bTestVariableDataLengths, Car
m_cardName = requestCardName(sc);

// Try to open and load list of already measured algorithms (if provided)
LoadAlreadyMeasuredAlgs(m_cardName);
String testType = getCurrentTestInfoString(false);
LoadAlreadyMeasuredAlgs(m_cardName, testType);

String testInfo = getCurrentTestInfoString();
String testInfo = getCurrentTestInfoString(true);

// Connect to card
this.m_perfResultsFile = m_cardManager.establishConnection(testClassPerformance, m_cardName, testInfo, selectedTerminal);
Expand Down Expand Up @@ -386,8 +389,8 @@ void finalizeMeasurement() throws IOException {
m_perfResultsFile.write(message.getBytes());
}

void LoadAlreadyMeasuredAlgs(String cardName) {
String filePath = cardName + "_already_measured.list";
void LoadAlreadyMeasuredAlgs(String cardName, String testType) {
String filePath = cardName + testType + "_already_measured.list";
String filePathOld = filePath + ".old";
File f = new File(filePath);
File fOld = new File(filePathOld);
Expand Down Expand Up @@ -765,7 +768,10 @@ public double perftest_measure(byte appletCLA, byte appletPrepareINS, byte apple
if (m_algsMeasuredList.contains(info)) {
// we already measured this algorithm before, just log it into new measurementsDone file
String message = info + "\n";
if (m_algsMeasuredFile != null) { m_algsMeasuredFile.write(message.getBytes()); }
if (m_algsMeasuredFile != null) {
m_algsMeasuredFile.write(message.getBytes());
m_algsMeasuredFile.flush();
}

message = "\nmethod name:; " + info + "\n";
message += "ALREADY_MEASURED\n";
Expand Down Expand Up @@ -811,7 +817,10 @@ public double perftest_measure(byte appletCLA, byte appletPrepareINS, byte apple
// log succesfull measurement of current algorithm - although exception ocurred, it is expected value like NO_SUCH_ALGORITHM
m_bAlgsMeasuredSomeNew = true;
message = info + "\n";
if (m_algsMeasuredFile != null) {m_algsMeasuredFile.write(message.getBytes()); }
if (m_algsMeasuredFile != null) {
m_algsMeasuredFile.write(message.getBytes());
m_algsMeasuredFile.flush();
}

return -1;
}
Expand Down
Binary file added AlgTest_JavaCard/AlgTest_v1.7.5_jc222.cap
Binary file not shown.
2 changes: 1 addition & 1 deletion AlgTest_JavaCard/src/AlgTest/JCAlgTestApplet.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public class JCAlgTestApplet extends javacard.framework.Applet
AlgStorageTest m_storageTest = null;

public final static short RAM1_ARRAY_LENGTH = (short) 600;
public final static short RAM2_ARRAY_LENGTH = (short) 512;
public final static short RAM2_ARRAY_LENGTH = (short) 528;
byte[] m_ramArray = null; // auxalarity array used for various purposes. Length of this array is added to value returned as amount of available RAM memory
byte[] m_ramArray2 = null; // auxalarity array used for various purposes. Length of this array is added to value returned as amount of available RAM memory

Expand Down
Binary file added AlgTest_dist_1.7.5.zip
Binary file not shown.

0 comments on commit b3f27cc

Please sign in to comment.