20 #include <gtest/gtest.h>
37 ASSERT_FALSE ( config.
swap.
value.empty() );
41 ASSERT_EQ ( swapPolicy::autoextendable, config.
policy.
value );
51 ofstream out (
"testconfig.conf" );
52 out <<
"[default]" << std::endl;
53 out <<
"memoryManager = dummyManagedMemory" << std::endl;
54 out <<
"memory = 5 GB" << std::endl;
67 ASSERT_EQ (
"dummyManagedMemory", config.memoryManager.value );
68 ASSERT_EQ ( 5 *
gig, config.memory.value );
77 ofstream out (
"testconfig.conf" );
78 out <<
"[default]" << std::endl;
79 out <<
"#memoryManager = somethingstupid" << std::endl;
80 out <<
"memoryManager = dummyManagedMemory#evenmorestupid" << std::endl;
81 out <<
"#memoryManager = somethingstupid" << std::endl;
82 out <<
" # memoryManager = somethingmorestupid" << std::endl;
93 ASSERT_EQ (
"dummyManagedMemory", config.memoryManager.value );
102 ofstream out (
"testconfig.conf" );
103 out <<
"[default]" << std::endl;
114 ASSERT_FALSE ( config.memoryManager.value.empty() );
123 ofstream out (
"testconfig.conf" );
124 out <<
"[default]" << std::endl;
125 out <<
"memoryManager = cyclicManagedMemory" << std::endl;
126 out <<
"memory = 5GB" << std::endl;
127 out <<
"[rambrain-unittests]" << std::endl;
128 out <<
"memoryManager = dummyManagedMemory" << std::endl;
129 out <<
"[rambrain-tests]" << std::endl;
130 out <<
"memoryManager = dummyManagedMemory" << std::endl;
141 ASSERT_EQ (
"dummyManagedMemory", config.memoryManager.value );
142 ASSERT_EQ ( 5 *
gig, config.memory.value );
151 ofstream out (
"testconfig.conf" );
152 out <<
"[rambrain-unittests]" << std::endl;
153 out <<
"memoryManager = dummyManagedMemory" << std::endl;
154 out <<
"[rambrain-tests]" << std::endl;
155 out <<
"memoryManager = dummyManagedMemory" << std::endl;
156 out <<
"[default]" << std::endl;
157 out <<
"memoryManager = cyclicManagedMemory" << std::endl;
158 out <<
"memory = 5GB" << std::endl;
169 ASSERT_EQ (
"dummyManagedMemory", config.memoryManager.value );
170 ASSERT_EQ ( 5 *
gig, config.memory.value );
189 ofstream out (
"testconfig.conf" );
190 out <<
"[default]" << std::endl;
191 out <<
"memoryManager = cyclicManagedMemory" << std::endl;
192 out <<
"[rambrain-unittests]" << std::endl;
193 out <<
"memoryManager = dummyManagedMemory" << std::endl;
194 out <<
"[rambrain-tests]" << std::endl;
195 out <<
"memoryManager = dummyManagedMemory" << std::endl;
206 ASSERT_EQ (
"dummyManagedMemory", config.memoryManager.value );
215 ofstream out (
"testconfig.conf" );
216 out <<
"[rambrain-unittests]" << std::endl;
217 out <<
"memoryManager = dummyManagedMemory" << std::endl;
218 out <<
"[rambrain-tests]" << std::endl;
219 out <<
"memoryManager = dummyManagedMemory" << std::endl;
220 out <<
"[default]" << std::endl;
221 out <<
"memoryManager = cyclicManagedMemory" << std::endl;
232 ASSERT_EQ (
"dummyManagedMemory", config.memoryManager.value );
241 ofstream out (
"testconfig.conf" );
243 out <<
"[default]" << std::endl << std::endl;
244 out <<
"memoryManager = cyclicManagedMemory" << std::endl << std::endl << std::endl;
245 out <<
"[rambrain-unittests]" << std::endl;
246 out <<
"memoryManager = dummyManagedMemory" << std::endl << std::endl;
247 out <<
"[rambrain-tests]" << std::endl << std::endl << std::endl;;
248 out <<
"memoryManager = dummyManagedMemory" << std::endl;
259 ASSERT_EQ (
"dummyManagedMemory", config.memoryManager.value );
configLine< swapPolicy > policy
configLine< bool > enableDMA
configLine< string > swapfiles
configuration & getConfig()
Simple getter.
Main struct to save configuration variables.
const global_bytesize gig
rambrainConfig config
You will find the object in managedMemory.cpp as we have to define it in some 'used' file in the link...
configLine< global_bytesize > memory
configLine< string > swap
bool readConfig()
Read in and parse config.
string getApplicationName() const
Extract the current binary's name out of the /proc file system.
void setCustomConfigPath(const string &path)
Simple setter.
TEST(configuration, Unit_DefaultValues)
bool readSuccessfully() const
Simple getter.
Reader class to read in and properly parse config files.
configLine< string > memoryManager
configLine< global_bytesize > swapMemory
vector< configLineBase * > configOptions