-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created a test for the MemMgr. See #4
Had to modify a bunch of files to allow c++ linkage. Removed the old testing. Also modified build to allow configure to still work without cppunit
- Loading branch information
1 parent
c6715f9
commit 6e83d36
Showing
17 changed files
with
168 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright (C) 2011 by Project SESA, Boston University | ||
|
||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
|
||
# The above copyright notice and this permission notice shall be included in | ||
# all copies or substantial portions of the Software. | ||
|
||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
# THE SOFTWARE. | ||
|
||
l0_tests = l0/test/MemMgrPrim_SingleCoreTest | ||
|
||
l0_test_MemMgrPrim_SingleCoreTest_SOURCES = \ | ||
l0/test/MemMgrPrim_SingleCoreTest.C $(ebbtest_SOURCES) | ||
l0_test_MemMgrPrim_SingleCoreTest_CXXFLAGS = $(CPPUNIT_CFLAGS) | ||
l0_test_MemMgrPrim_SingleCoreTest_LDFLAGS = $(CPPUNIT_LIBS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
* Copyright (C) 2011 by Project SESA, Boston University | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
|
||
#include <config.h> | ||
#include <stdint.h> | ||
#include <cppunit/ui/text/TestRunner.h> | ||
#include <cppunit/extensions/HelperMacros.h> | ||
#include <l0/lrt/pic.h> | ||
#include <l0/lrt/mem.h> | ||
#include <l0/lrt/trans.h> | ||
#include <l0/types.h> | ||
#include <l0/sys/trans.h> | ||
#include <l0/cobj/cobj.h> | ||
#include <l0/cobj/CObjEBB.h> | ||
#include <l0/MemMgr.h> | ||
#include <l0/MemMgrPrim.h> | ||
|
||
class MemMgrPrim_Test : public CppUnit::TestFixture { | ||
CPPUNIT_TEST_SUITE(MemMgrPrim_Test); | ||
CPPUNIT_TEST(test); | ||
CPPUNIT_TEST_SUITE_END(); | ||
public: | ||
//I have a static function as the reset function | ||
// I have to do all my setup here because I cannot return back off a reset | ||
// exit(0) will be intercepted by the test infrastructure and it will accept | ||
// the test as successful. Unfortunately, I cannot run a second test because | ||
// it will be in this address space, so a new file/runner | ||
// would need to be created | ||
static void do_test() | ||
{ | ||
EBBRC rc; | ||
int *i; | ||
lrt_mem_init(); | ||
lrt_trans_init(); | ||
trans_init(); | ||
EBBMemMgrPrimInit(); | ||
rc = EBBPrimMalloc(sizeof(int), &i, EBB_MEM_DEFAULT); | ||
CPPUNIT_ASSERT(EBBRC_SUCCESS(rc)); | ||
rc = EBBPrimFree(i); | ||
CPPUNIT_ASSERT(EBBRC_SUCCESS(rc)); | ||
exit(0); | ||
} | ||
|
||
void test() | ||
{ | ||
lrt_pic_init(do_test); | ||
} | ||
|
||
}; | ||
|
||
int | ||
main () | ||
{ | ||
CppUnit::TextUi::TestRunner runner; | ||
runner.addTest(MemMgrPrim_Test::suite()); | ||
return !runner.run(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
include misc/test/Makefile.am | ||
|
||
misc_ctrprim_sources = misc/Ctr.h misc/CtrPrim.c misc/CtrPrim.h \ | ||
misc/CtrPrimDistributed.c misc/CtrPrimDistributed.h | ||
|
||
misc_ctrcplus_sources = misc/CtrCPlus.C misc/CtrCPlus.H | ||
|
||
misc_sources = $(misc_ctrprim_sources) $(misc_ctrcplus_sources) | ||
|
||
misc_cppunit_sources = $(misc_test_cppunit_sources) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.