12345678910111213141516171819202122 |
- #include <stdlib.h>
- #include <stdio.h>
- int main(void) {
- char * s = "azAZ9."; // test boundaries
- long l = a64l(s);
- if (l != 194301926) {
- printf("Invalid result: a64l(%s) = %ld\n", s, l);
- return 1;
- }
- printf("Correct a64l: %s = %ld\n", s, l);
-
- s = "azA"; // test null terminated string
- l = a64l(s);
- if (l != 53222) {
- printf("Invalid result: a64l(%s) = %ld\n", s, l);
- return 1;
- }
- printf("Correct a64l: %s = %ld\n", s, l);
- return 0;
- }
|