Posted to tcl by mookie at Fri Apr 10 01:10:38 GMT 2026view raw

  1. ;### QUOTA_EXCEEDED - Multiple
  2. ;# Tests the dictionary spill defenses
  3. # crystal_init ./store/test.mem.multi
  4. variable mem [crystal_open ./store/test.mem.multi]
  5. ;#
  6. ;#
  7. puts "\nERROR TEST for QUOTA_EXCEEDED "
  8. puts "------ Tests the data book for spillages"
  9. puts "------ While loop simulates singular multiple transactions"
  10. variable 0x02 "30783032"
  11. while {$base16_result ne "$0x02"} {
  12. incr counter
  13. catch { crystal_insert $mem "MULTI_ENTRY" "TEST" "[randstr 100000]" } base32_result
  14. variable base16_result [binary encode hex [encoding convertto utf-8 "$base32_result"]]
  15. puts ">? $base16_result :: base16_result"
  16. puts ">? $base32_result :: base32_result"
  17. puts "counted: $counter"
  18. switch [string range $base16_result 0 7] { 30783032 { break }}
  19. }
  20.  
  21. switch $0x02 {
  22. 30783032 { puts "TEST PASSED" }
  23. default { puts "TEST FAILED" ; exit }
  24. }
  25. ;#
  26. ;#
  27. crystal_close $mem
  28. puts "------\n"
  29. ;#
  30.  
  31. >? 494e534552544544 :: base16_result
  32. >? INSERTED :: base32_result
  33. counted: 667
  34. >? 494e534552544544 :: base16_result
  35. >? INSERTED :: base32_result
  36. counted: 668
  37. >? 494e534552544544 :: base16_result
  38. >? INSERTED :: base32_result
  39. counted: 669
  40. >? 494e534552544544 :: base16_result
  41. >? INSERTED :: base32_result
  42. counted: 670
  43. >? 30783032207c2051756f7461204578636565646564 :: base16_result
  44. >? 0x02 | Quota Exceeded :: base32_result
  45. counted: 671
  46. TEST PASSED
  47. ------
  48.  
  49.  
  50. TEST: MAX_ENTRY - When the entry data is larger than the permitted limit
  51. ------
  52. >? 30783033207c20456e74727920746f6f206c61726765 :: base16_result
  53. >? 0x03 | Entry too large :: base32_result
  54. TEST PASSED
  55. ------
  56.  

Add a comment

Please note that this site uses the meta tags nofollow,noindex for all pages that contain comments.
Items are closed for new comments after 1 week