test_version.c (303975) | test_version.c (305313) |
---|---|
1/*- 2 * Copyright (c) 2003-2007 Tim Kientzle 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 69 unchanged lines hidden (view full) --- 78 while (s > 0 && (*q == '.' || (*q >= '0' && *q <= '9'))) { 79 ++q; 80 --s; 81 } 82 /* Skip a single trailing a,b,c, or d. */ 83 if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd') 84 ++q; 85 /* Skip arbitrary third-party version numbers. */ | 1/*- 2 * Copyright (c) 2003-2007 Tim Kientzle 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 69 unchanged lines hidden (view full) --- 78 while (s > 0 && (*q == '.' || (*q >= '0' && *q <= '9'))) { 79 ++q; 80 --s; 81 } 82 /* Skip a single trailing a,b,c, or d. */ 83 if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd') 84 ++q; 85 /* Skip arbitrary third-party version numbers. */ |
86 while (s > 0 && (*q == ' ' || *q == '/' || *q == '.' || isalnum(*q))) { | 86 while (s > 0 && (*q == ' ' || *q == '-' || *q == '/' || *q == '.' || isalnum(*q))) { |
87 ++q; 88 --s; 89 } 90 /* All terminated by end-of-line. */ 91 assert(s >= 1); 92 /* Skip an optional CR character (e.g., Windows) */ 93 failure("Version output must end with \\n or \\r\\n"); 94 if (*q == '\r') { ++q; --s; } 95 assertEqualMem(q, "\n", 1); 96 free(p); 97} | 87 ++q; 88 --s; 89 } 90 /* All terminated by end-of-line. */ 91 assert(s >= 1); 92 /* Skip an optional CR character (e.g., Windows) */ 93 failure("Version output must end with \\n or \\r\\n"); 94 if (*q == '\r') { ++q; --s; } 95 assertEqualMem(q, "\n", 1); 96 free(p); 97} |