Skip to content

Commit

Permalink
Test fix and warning fixes g-truc#364
Browse files Browse the repository at this point in the history
  • Loading branch information
Groovounet committed Jul 23, 2015
1 parent e07a6d1 commit 562ab0b
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions test/core/core_func_integer_bit_count.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ int main()
# ifdef NDEBUG

int i, n;
static int test[] = {0,0, 1,1, 2,1, 3,2, 4,1, 5,2, 6,2, 7,3,
static unsigned test[] = {0,0, 1,1, 2,1, 3,2, 4,1, 5,2, 6,2, 7,3,
8,1, 9,2, 10,2, 11,3, 12,2, 13,3, 14,3, 15,4, 16,1, 17,2,
0x3F,6, 0x40,1, 0x41,2, 0x7f,7, 0x80,1, 0x81,2, 0xfe,7, 0xff,8,
0x4000,1, 0x4001,2, 0x7000,3, 0x7fff,15,
Expand All @@ -230,63 +230,63 @@ int main()
if (pop0(test[i]) != test[i+1]) error(test[i], pop0(test[i]));}
TimestampEnd = std::clock();

printf("pop0: %d clocks\n", TimestampEnd - TimestampBeg);
printf("pop0: %ld clocks\n", TimestampEnd - TimestampBeg);

TimestampBeg = std::clock();
for (std::size_t k = 0; k < Count; ++k)
for (i = 0; i < n; i += 2) {
if (pop1(test[i]) != test[i+1]) error(test[i], pop1(test[i]));}
TimestampEnd = std::clock();

printf("pop1: %d clocks\n", TimestampEnd - TimestampBeg);
printf("pop1: %ld clocks\n", TimestampEnd - TimestampBeg);

TimestampBeg = std::clock();
for (std::size_t k = 0; k < Count; ++k)
for (i = 0; i < n; i += 2) {
if (pop2(test[i]) != test[i+1]) error(test[i], pop2(test[i]));}
TimestampEnd = std::clock();

printf("pop2: %d clocks\n", TimestampEnd - TimestampBeg);
printf("pop2: %ld clocks\n", TimestampEnd - TimestampBeg);

TimestampBeg = std::clock();
for (std::size_t k = 0; k < Count; ++k)
for (i = 0; i < n; i += 2) {
if (pop3(test[i]) != test[i+1]) error(test[i], pop3(test[i]));}
TimestampEnd = std::clock();

printf("pop3: %d clocks\n", TimestampEnd - TimestampBeg);
printf("pop3: %ld clocks\n", TimestampEnd - TimestampBeg);

TimestampBeg = std::clock();
for (std::size_t k = 0; k < Count; ++k)
for (i = 0; i < n; i += 2) {
if (pop4(test[i]) != test[i+1]) error(test[i], pop4(test[i]));}
TimestampEnd = std::clock();

printf("pop4: %d clocks\n", TimestampEnd - TimestampBeg);
printf("pop4: %ld clocks\n", TimestampEnd - TimestampBeg);

TimestampBeg = std::clock();
for (std::size_t k = 0; k < Count; ++k)
for (i = 0; i < n; i += 2) {
if (pop5(test[i]) != test[i+1]) error(test[i], pop5(test[i]));}
TimestampEnd = std::clock();

printf("pop5: %d clocks\n", TimestampEnd - TimestampBeg);
printf("pop5: %ld clocks\n", TimestampEnd - TimestampBeg);

TimestampBeg = std::clock();
for (std::size_t k = 0; k < Count; ++k)
for (i = 0; i < n; i += 2) {
if (pop5a(test[i]) != test[i+1]) error(test[i], pop5a(test[i]));}
TimestampEnd = std::clock();

printf("pop5a: %d clocks\n", TimestampEnd - TimestampBeg);
printf("pop5a: %ld clocks\n", TimestampEnd - TimestampBeg);

TimestampBeg = std::clock();
for (std::size_t k = 0; k < Count; ++k)
for (i = 0; i < n; i += 2) {
if (pop6(test[i]) != test[i+1]) error(test[i], pop6(test[i]));}
TimestampEnd = std::clock();

printf("pop6: %d clocks\n", TimestampEnd - TimestampBeg);
printf("pop6: %ld clocks\n", TimestampEnd - TimestampBeg);

TimestampBeg = std::clock();
for (std::size_t k = 0; k < Count; ++k)
Expand All @@ -295,7 +295,7 @@ int main()
if (pop7(test[i]) != test[i+1]) error(test[i], pop7(test[i]));}
TimestampEnd = std::clock();

printf("pop7: %d clocks\n", TimestampEnd - TimestampBeg);
printf("pop7: %ld clocks\n", TimestampEnd - TimestampBeg);

TimestampBeg = std::clock();
for (std::size_t k = 0; k < Count; ++k)
Expand All @@ -304,7 +304,7 @@ int main()
if (pop8(test[i]) != test[i+1]) error(test[i], pop8(test[i]));}
TimestampEnd = std::clock();

printf("pop8: %d clocks\n", TimestampEnd - TimestampBeg);
printf("pop8: %ld clocks\n", TimestampEnd - TimestampBeg);

TimestampBeg = std::clock();
for (std::size_t k = 0; k < Count; ++k)
Expand All @@ -313,7 +313,7 @@ int main()
if (pop9(test[i]) != test[i+1]) error(test[i], pop9(test[i]));}
TimestampEnd = std::clock();

printf("pop9: %d clocks\n", TimestampEnd - TimestampBeg);
printf("pop9: %ld clocks\n", TimestampEnd - TimestampBeg);

if (errors == 0)
printf("Passed all %d cases.\n", sizeof(test)/8);
Expand Down

0 comments on commit 562ab0b

Please sign in to comment.