The Bible speaks often about the inner parts of the human body, such as the heart and reins. The reins is a reference to the kidneys and is usually connected with the emotional aspects or motivations or intents of the person.
From the previous verse, the Lord tests the heart and reins.
The heart is the physical pump which circulates the blood throughout the body, and in the sense of the soul, this is a reference to the circulation of thoughts throughout ones soul. Combined together this is a reference to the thoughts and intents of the soul.
Using the inner parts of the human body to symbolize ones thoughts and feelings, is also a mechanism to demonstrate that God can see into places that no person can see. That is, into the soul.
Remember that the soul is the unseen and undetectable part of your life, which is the real you. The brain is the biological part of you, that links the soul to the biological you and thus to the world.
The idea here is that God can see into places within the human soul, that no one else can see. Even the individual cannot see in to his own subconscious, but God can see deep into even the hidden parts of the soul.
What you think is what you are, and God, knowing what you think, knows exactly what you are – righteous or evil.
And the righteous, is one who strives good and pursues truth as prescribed by God, not as defined arbitrarily by man.
The person whose thoughts are of truth, is one who has learned Bible doctrine and the principles contained therein.
For that person, God is a defense, a shield, a protector, a fortress. This word describes the scaly hide of a crocodile, and comes to mean the total covering within an impregnable defense. The world is an unprotected enemy and to a crocodile, the enemy is the defenseless attacker incapable of dealing with Gods fortress arsenal.
There is no greater force or power, than God.
Living inside His fortress, due to being right in thoughts and intents, means total and complete and permanent security.
End of study