Posted to tcl by mookie at Fri Apr 10 01:10:38 GMT 2026view raw
- ;### QUOTA_EXCEEDED - Multiple
- ;# Tests the dictionary spill defenses
- # crystal_init ./store/test.mem.multi
- variable mem [crystal_open ./store/test.mem.multi]
- ;#
- ;#
- puts "\nERROR TEST for QUOTA_EXCEEDED "
- puts "------ Tests the data book for spillages"
- puts "------ While loop simulates singular multiple transactions"
- variable 0x02 "30783032"
- while {$base16_result ne "$0x02"} {
- incr counter
- catch { crystal_insert $mem "MULTI_ENTRY" "TEST" "[randstr 100000]" } base32_result
- variable base16_result [binary encode hex [encoding convertto utf-8 "$base32_result"]]
- puts ">? $base16_result :: base16_result"
- puts ">? $base32_result :: base32_result"
- puts "counted: $counter"
- switch [string range $base16_result 0 7] { 30783032 { break }}
- }
-
- switch $0x02 {
- 30783032 { puts "TEST PASSED" }
- default { puts "TEST FAILED" ; exit }
- }
- ;#
- ;#
- crystal_close $mem
- puts "------\n"
- ;#
-
- >? 494e534552544544 :: base16_result
- >? INSERTED :: base32_result
- counted: 667
- >? 494e534552544544 :: base16_result
- >? INSERTED :: base32_result
- counted: 668
- >? 494e534552544544 :: base16_result
- >? INSERTED :: base32_result
- counted: 669
- >? 494e534552544544 :: base16_result
- >? INSERTED :: base32_result
- counted: 670
- >? 30783032207c2051756f7461204578636565646564 :: base16_result
- >? 0x02 | Quota Exceeded :: base32_result
- counted: 671
- TEST PASSED
- ------
-
-
- TEST: MAX_ENTRY - When the entry data is larger than the permitted limit
- ------
- >? 30783033207c20456e74727920746f6f206c61726765 :: base16_result
- >? 0x03 | Entry too large :: base32_result
- TEST PASSED
- ------
-
Add a comment