mirror of
https://github.com/g-truc/glm.git
synced 2024-11-26 10:14:35 +00:00
Test fix and warning fixes #364
This commit is contained in:
parent
e07a6d15c4
commit
562ab0b559
@ -210,7 +210,7 @@ int main()
|
|||||||
# ifdef NDEBUG
|
# ifdef NDEBUG
|
||||||
|
|
||||||
int i, n;
|
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,
|
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,
|
0x3F,6, 0x40,1, 0x41,2, 0x7f,7, 0x80,1, 0x81,2, 0xfe,7, 0xff,8,
|
||||||
0x4000,1, 0x4001,2, 0x7000,3, 0x7fff,15,
|
0x4000,1, 0x4001,2, 0x7000,3, 0x7fff,15,
|
||||||
@ -230,7 +230,7 @@ int main()
|
|||||||
if (pop0(test[i]) != test[i+1]) error(test[i], pop0(test[i]));}
|
if (pop0(test[i]) != test[i+1]) error(test[i], pop0(test[i]));}
|
||||||
TimestampEnd = std::clock();
|
TimestampEnd = std::clock();
|
||||||
|
|
||||||
printf("pop0: %d clocks\n", TimestampEnd - TimestampBeg);
|
printf("pop0: %ld clocks\n", TimestampEnd - TimestampBeg);
|
||||||
|
|
||||||
TimestampBeg = std::clock();
|
TimestampBeg = std::clock();
|
||||||
for (std::size_t k = 0; k < Count; ++k)
|
for (std::size_t k = 0; k < Count; ++k)
|
||||||
@ -238,7 +238,7 @@ int main()
|
|||||||
if (pop1(test[i]) != test[i+1]) error(test[i], pop1(test[i]));}
|
if (pop1(test[i]) != test[i+1]) error(test[i], pop1(test[i]));}
|
||||||
TimestampEnd = std::clock();
|
TimestampEnd = std::clock();
|
||||||
|
|
||||||
printf("pop1: %d clocks\n", TimestampEnd - TimestampBeg);
|
printf("pop1: %ld clocks\n", TimestampEnd - TimestampBeg);
|
||||||
|
|
||||||
TimestampBeg = std::clock();
|
TimestampBeg = std::clock();
|
||||||
for (std::size_t k = 0; k < Count; ++k)
|
for (std::size_t k = 0; k < Count; ++k)
|
||||||
@ -246,7 +246,7 @@ int main()
|
|||||||
if (pop2(test[i]) != test[i+1]) error(test[i], pop2(test[i]));}
|
if (pop2(test[i]) != test[i+1]) error(test[i], pop2(test[i]));}
|
||||||
TimestampEnd = std::clock();
|
TimestampEnd = std::clock();
|
||||||
|
|
||||||
printf("pop2: %d clocks\n", TimestampEnd - TimestampBeg);
|
printf("pop2: %ld clocks\n", TimestampEnd - TimestampBeg);
|
||||||
|
|
||||||
TimestampBeg = std::clock();
|
TimestampBeg = std::clock();
|
||||||
for (std::size_t k = 0; k < Count; ++k)
|
for (std::size_t k = 0; k < Count; ++k)
|
||||||
@ -254,7 +254,7 @@ int main()
|
|||||||
if (pop3(test[i]) != test[i+1]) error(test[i], pop3(test[i]));}
|
if (pop3(test[i]) != test[i+1]) error(test[i], pop3(test[i]));}
|
||||||
TimestampEnd = std::clock();
|
TimestampEnd = std::clock();
|
||||||
|
|
||||||
printf("pop3: %d clocks\n", TimestampEnd - TimestampBeg);
|
printf("pop3: %ld clocks\n", TimestampEnd - TimestampBeg);
|
||||||
|
|
||||||
TimestampBeg = std::clock();
|
TimestampBeg = std::clock();
|
||||||
for (std::size_t k = 0; k < Count; ++k)
|
for (std::size_t k = 0; k < Count; ++k)
|
||||||
@ -262,7 +262,7 @@ int main()
|
|||||||
if (pop4(test[i]) != test[i+1]) error(test[i], pop4(test[i]));}
|
if (pop4(test[i]) != test[i+1]) error(test[i], pop4(test[i]));}
|
||||||
TimestampEnd = std::clock();
|
TimestampEnd = std::clock();
|
||||||
|
|
||||||
printf("pop4: %d clocks\n", TimestampEnd - TimestampBeg);
|
printf("pop4: %ld clocks\n", TimestampEnd - TimestampBeg);
|
||||||
|
|
||||||
TimestampBeg = std::clock();
|
TimestampBeg = std::clock();
|
||||||
for (std::size_t k = 0; k < Count; ++k)
|
for (std::size_t k = 0; k < Count; ++k)
|
||||||
@ -270,7 +270,7 @@ int main()
|
|||||||
if (pop5(test[i]) != test[i+1]) error(test[i], pop5(test[i]));}
|
if (pop5(test[i]) != test[i+1]) error(test[i], pop5(test[i]));}
|
||||||
TimestampEnd = std::clock();
|
TimestampEnd = std::clock();
|
||||||
|
|
||||||
printf("pop5: %d clocks\n", TimestampEnd - TimestampBeg);
|
printf("pop5: %ld clocks\n", TimestampEnd - TimestampBeg);
|
||||||
|
|
||||||
TimestampBeg = std::clock();
|
TimestampBeg = std::clock();
|
||||||
for (std::size_t k = 0; k < Count; ++k)
|
for (std::size_t k = 0; k < Count; ++k)
|
||||||
@ -278,7 +278,7 @@ int main()
|
|||||||
if (pop5a(test[i]) != test[i+1]) error(test[i], pop5a(test[i]));}
|
if (pop5a(test[i]) != test[i+1]) error(test[i], pop5a(test[i]));}
|
||||||
TimestampEnd = std::clock();
|
TimestampEnd = std::clock();
|
||||||
|
|
||||||
printf("pop5a: %d clocks\n", TimestampEnd - TimestampBeg);
|
printf("pop5a: %ld clocks\n", TimestampEnd - TimestampBeg);
|
||||||
|
|
||||||
TimestampBeg = std::clock();
|
TimestampBeg = std::clock();
|
||||||
for (std::size_t k = 0; k < Count; ++k)
|
for (std::size_t k = 0; k < Count; ++k)
|
||||||
@ -286,7 +286,7 @@ int main()
|
|||||||
if (pop6(test[i]) != test[i+1]) error(test[i], pop6(test[i]));}
|
if (pop6(test[i]) != test[i+1]) error(test[i], pop6(test[i]));}
|
||||||
TimestampEnd = std::clock();
|
TimestampEnd = std::clock();
|
||||||
|
|
||||||
printf("pop6: %d clocks\n", TimestampEnd - TimestampBeg);
|
printf("pop6: %ld clocks\n", TimestampEnd - TimestampBeg);
|
||||||
|
|
||||||
TimestampBeg = std::clock();
|
TimestampBeg = std::clock();
|
||||||
for (std::size_t k = 0; k < Count; ++k)
|
for (std::size_t k = 0; k < Count; ++k)
|
||||||
@ -295,7 +295,7 @@ int main()
|
|||||||
if (pop7(test[i]) != test[i+1]) error(test[i], pop7(test[i]));}
|
if (pop7(test[i]) != test[i+1]) error(test[i], pop7(test[i]));}
|
||||||
TimestampEnd = std::clock();
|
TimestampEnd = std::clock();
|
||||||
|
|
||||||
printf("pop7: %d clocks\n", TimestampEnd - TimestampBeg);
|
printf("pop7: %ld clocks\n", TimestampEnd - TimestampBeg);
|
||||||
|
|
||||||
TimestampBeg = std::clock();
|
TimestampBeg = std::clock();
|
||||||
for (std::size_t k = 0; k < Count; ++k)
|
for (std::size_t k = 0; k < Count; ++k)
|
||||||
@ -304,7 +304,7 @@ int main()
|
|||||||
if (pop8(test[i]) != test[i+1]) error(test[i], pop8(test[i]));}
|
if (pop8(test[i]) != test[i+1]) error(test[i], pop8(test[i]));}
|
||||||
TimestampEnd = std::clock();
|
TimestampEnd = std::clock();
|
||||||
|
|
||||||
printf("pop8: %d clocks\n", TimestampEnd - TimestampBeg);
|
printf("pop8: %ld clocks\n", TimestampEnd - TimestampBeg);
|
||||||
|
|
||||||
TimestampBeg = std::clock();
|
TimestampBeg = std::clock();
|
||||||
for (std::size_t k = 0; k < Count; ++k)
|
for (std::size_t k = 0; k < Count; ++k)
|
||||||
@ -313,7 +313,7 @@ int main()
|
|||||||
if (pop9(test[i]) != test[i+1]) error(test[i], pop9(test[i]));}
|
if (pop9(test[i]) != test[i+1]) error(test[i], pop9(test[i]));}
|
||||||
TimestampEnd = std::clock();
|
TimestampEnd = std::clock();
|
||||||
|
|
||||||
printf("pop9: %d clocks\n", TimestampEnd - TimestampBeg);
|
printf("pop9: %ld clocks\n", TimestampEnd - TimestampBeg);
|
||||||
|
|
||||||
if (errors == 0)
|
if (errors == 0)
|
||||||
printf("Passed all %d cases.\n", sizeof(test)/8);
|
printf("Passed all %d cases.\n", sizeof(test)/8);
|
||||||
|
Loading…
Reference in New Issue
Block a user