for kv_pair in kv_pairs: memlib.setSuccess(kv_pair, testset) for kv_pair in kv_pairs: memlib.getSuccess(kv_pair, testset) # rotation values = values[1:] + values[0:1] return testset ################################################################################ if len(keySizes) > len(keyChars): sys.exit("Error: Not enough key characters.") if len(valueSizes) > len(valueChars): sys.exit("Error: Not enough value characters.") keyPairs = zip(keySizes, keyChars) valuePairs = zip(valueSizes, valueChars) keys = map(lambda (size, char): char * size, keyPairs) values = map(lambda (size, char): char * size, valuePairs) memlib.generate("SEQ1-EXTENDED", seq1(keys, values, 5)) memlib.generate_hls("SEQ1-EXTENDED", seq1(keys, values, 5)) memlib.generate("SEQ2-EXTENDED", seq2(keys, values)) memlib.generate_hls("SEQ2-EXTENDED", seq2(keys, values)) memlib.generate("SEQ3-EXTENDED", seq1(keys, values, 1)) memlib.generate_hls("SEQ3-EXTENDED", seq1(keys, values, 1))
kv_pairs.append( memlib.kv_pair(key, value, "%08x" % flag, 42) ) kv_pairs_last = [] for key in keys: v = values[-1] f = flags[-1] kv_pairs_last.append( memlib.kv_pair(key, v, "%08x" % f, 42) ) testset = memlib.newTestset() for pair in kv_pairs_last: memlib.getFail(pair, testset) for pair in kv_pairs: memlib.setSuccess(pair, testset) for pair in kv_pairs_last: memlib.getSuccess(pair, testset) for pair in kv_pairs_last: memlib.delete(pair, testset) for pair in kv_pairs_last: memlib.getFail(pair, testset) for pair in kv_pairs_last: memlib.setSuccess(pair, testset) memlib.flush(testset) for pair in kv_pairs_last: memlib.getFail(pair, testset) for pair in kv_pairs_last: memlib.deleteFail(pair, testset) memlib.generate("ALLOPS", testset) memlib.generate_hls("ALLOPS", testset)
#!/usr/bin/python import memlib testset = memlib.newTestset() for i in range(300): pair = memlib.kv_pair("K%03d" % i, "V%03d" % i, "ABCDEF01", 0) memlib.set(pair, testset) memlib.generate("MANYKEYS", testset) memlib.generate_hls("MANYKEYS", testset)
memlib.getSuccess(p, testset) def do_getsFail(keys, value_chars, testset): pairs = get_pairs(keys, value_chars) for p in pairs: memlib.getFail(p, testset) testset = memlib.newTestset() do_sets(keys, valueChars1, testset) do_sets(keys, valueChars2, testset) do_sets(keys, valueChars3, testset) do_sets(keys, valueChars4, testset) do_sets(keys, valueChars5, testset) do_sets(keys, valueChars6, testset) do_sets(keys, valueChars7, testset) do_sets(keys, valueChars8, testset) do_sets(keys, valueChars9, testset) do_sets(keys, valueChars10, testset) do_sets(keys, valueChars11, testset) do_sets(keys, valueChars12, testset) do_sets(keys, valueChars13, testset) do_sets(keys, valueChars14, testset) do_sets(keys, valueChars15, testset) do_getsSuccess(keys, valueChars15, testset) memlib.flush(testset) do_getsFail(keys, valueChars15, testset) memlib.generate("MANYSETS", testset) memlib.generate_hls("MANYSETS", testset)