-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* `snakemake testall` combines all test cases in a single binary, tests/test_all. You may use gtest's filter options to run only specific test cases. * `snakemake test` builds individual executables for each test suite. This is for isolated, faster-iteration test cases. * `snakemake cleantest` removes test-related binaries. (It does NOT remove other framework/element binaries, though. You should use `snakemake clean` to remove them.)
- Loading branch information
Showing
3 changed files
with
34 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,4 @@ | |
|
||
using namespace nba; | ||
|
||
int main() { | ||
return 0; | ||
} | ||
|
||
// vim: ts=8 sts=4 sw=4 et |
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,24 +1,19 @@ | ||
#include <nba/core/assert.hh> | ||
#include <nba/core/shiftedint.hh> | ||
#include <cstdio> | ||
#include <gtest/gtest.h> | ||
|
||
using namespace nba; | ||
|
||
int main() { | ||
printf("TEST: core.shiftedint\n"); | ||
{ | ||
test_assert(sizeof(ShiftedInt<uint16_t, 0>) == sizeof(uint16_t), | ||
"The size of ShfitedInt must be same to the given template."); | ||
} | ||
{ | ||
auto x = ShiftedInt<uint16_t, 2>(123); | ||
test_assert((uint32_t) x == 120, "Expected precision loss due to shift."); | ||
} | ||
{ | ||
auto x = ShiftedInt<uint16_t, 2>(120); | ||
test_assert((uint32_t) x == 120, "Expected exactly same value."); | ||
} | ||
return 0; | ||
TEST(CoreShiftedIntTest, StorageSize) { | ||
EXPECT_EQ(sizeof(ShiftedInt<uint16_t, 0>), sizeof(uint16_t)); | ||
} | ||
|
||
TEST(CoreShiftedIntTest, Assignment) { | ||
auto x = ShiftedInt<uint16_t, 2>(123); | ||
EXPECT_EQ((uint32_t) x, 120) << "Precision loss due to shift should occur."; | ||
auto y = ShiftedInt<uint16_t, 2>(120); | ||
EXPECT_EQ((uint32_t) y, 120) << "Should be exactly same."; | ||
} | ||
|
||
// vim: ts=8 sts=4 sw=4 et |