Secret testing with multiplier working.

This commit is contained in:
Geoffrey Challen
2016-01-31 09:53:13 -05:00
parent 59d447acf6
commit 716d33964b
6 changed files with 105 additions and 92 deletions

View File

@@ -44,6 +44,7 @@
* allows normally compilation and operation.
*/
#define KERNEL_SECRET ""
#define SECRET_TESTING
#define SECRET 1755184289
#endif /* _SECRET_H_ */

View File

@@ -32,6 +32,7 @@
/* Get __PF() for declaring printf-like functions. */
#include <cdefs.h>
#include <kern/secret.h>
#include "opt-synchprobs.h"
#include "opt-automationtest.h"
@@ -165,16 +166,26 @@ int ll1test(int, char **);
int ll16test(int, char **);
#endif
#define SUCCESS 0
#define FAIL 1
void success(bool, uint32_t, const char *);
void random_yielder(uint32_t);
void random_spinner(uint32_t);
/*
* Testing variants of kprintf. tprintf is silent during automated testing.
* sprintf prefixes the kernel secret to kprintf messages during automated
* testing. nprintf is not silent during automated testing.
* kprintf variants that do not (or only) print during automated testing.
*/
int tkprintf(const char *format, ...) __PF(1,2);
int nkprintf(const char *format, ...) __PF(1,2);
#ifdef SECRET_TESTING
#define kprintf_t(...) kprintf(__VA_ARGS__)
#define kprintf_n(...) silent(__VA_ARGS__)
#else
#define kprintf_t(...) silent(__VA_ARGS__)
#define kprintf_n(...) kprintf(__VA_ARGS__)
#endif
static inline void silent(const char * fmt, ...) { (void)fmt; };
#endif /* _TEST_H_ */