Skip to content

Commit 210cc61

Browse files
committed
m
1 parent 0be1e0d commit 210cc61

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

TestVectors/dafny/DDBEncryption/src/TestVectors.dfy

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ module {:options "-functionSyntax:4"} DdbEncryptionTestVectors {
112112
Validate();
113113
StringOrdering();
114114
LargeTests();
115+
PerfQueryTests();
115116
BasicIoTest();
116117
RunIoTests();
117118
BasicQueryTest();
@@ -539,6 +540,35 @@ module {:options "-functionSyntax:4"} DdbEncryptionTestVectors {
539540
}
540541
}
541542

543+
method PerfQueryTests()
544+
{
545+
print "\n";
546+
RunQueryTest("one", map["x" := SE.DO_NOTHING], None, Some(""), None);
547+
RunQueryTest("two", map["x" := SE.DO_NOTHING], None, Some("this is a fairly long query string but I dont see why it should cause a problem."), None);
548+
RunQueryTest("three", map["x" := SE.DO_NOTHING], None,
549+
Some("begins_with (#param_0, :param_0_v0) AND begins_with (#param_1, :param_1_v0)"),
550+
Some(map["#param_0" := "rangeKey", "#param_1" := "hashKey"]));
551+
}
552+
553+
method RunQueryTest(
554+
name : string,
555+
actions : Types.AttributeActions,
556+
keyExpr : Option<DDB.KeyExpression>,
557+
filterExpr : Option<DDB.ConditionExpression>,
558+
names : Option<DDB.ExpressionAttributeNameMap>
559+
)
560+
{
561+
var time := Time.GetAbsoluteTime();
562+
for i : uint32 := 0 to 10000 {
563+
var x := Filter.TestBeaconize(actions, keyExpr, filterExpr, names);
564+
if x.Failure? {
565+
print "\nRunQueryTest ", name, " Failed : ", x.error, "\n\n";
566+
return;
567+
}
568+
}
569+
Time.PrintTimeSinceLong(time, "TestBeaconize " + name, DecryptManifest.LogFileName());
570+
}
571+
542572
method RunLargeTest(record : LargeRecord, client : Trans.IDynamoDbEncryptionTransformsClient, config : string)
543573
requires client.ValidState()
544574
ensures client.ValidState()

0 commit comments

Comments
 (0)