Simulation Core
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 
 
 

39 righe
1.0 KiB

  1. module test_redis
  2. contains
  3. SUBROUTINE test()
  4. use RedisInterface
  5. use SimulationVariables
  6. use json_module
  7. character(len=:),allocatable::s2
  8. character(len=:),allocatable::redisContent
  9. type(json_value),pointer :: jsonvalue
  10. type(json_core) :: jsoncore
  11. call initConnection()
  12. print *,"redis exmaple program"
  13. call jsoncore%create_object(jsonvalue,'')
  14. call ConfigurationToJson(jsonvalue)
  15. call WarningsToJson(jsonvalue)
  16. call ProblemsToJson(jsonvalue)
  17. print *,"write starts"
  18. call jsoncore%serialize(jsonvalue,redisContent)
  19. ! s = "Test redis write!"
  20. call setData(redisContent)
  21. print *,"write ends len=",len(redisContent)
  22. call getData(s2)
  23. print *,"len(read)=",len(s2)
  24. print *, s2(1:10),' .... ', s2(len(s2)-10:len(s2))
  25. call deallocateData()
  26. ! print *,"S2 = ",s2
  27. deallocate(s2)
  28. end SUBROUTINE
  29. end module test_redis
  30. program redis_example
  31. use test_redis
  32. call test()
  33. end program redis_example