Numworks Epsilon  1.4.1
Graphing Calculator Operating System
runner.cpp
Go to the documentation of this file.
1 #include "quiz.h"
2 #include "symbols.h"
3 #include <string.h>
4 #include <kandinsky.h>
5 #include <ion.h>
6 
7 void quiz_print(const char * message) {
8 #if QUIZ_USE_CONSOLE
10 #else
11  static int line_y = 0;
13  int line_height = KDText::stringSize("M").height();
14  ctx->drawString(message, KDPoint(0, line_y));
15  line_y += line_height;
16  if (line_y > Ion::Display::Height) {
17  line_y = 0;
18  // Clear screen maybe?
19  }
20 #endif
21 }
22 
23 void ion_main(int argc, char * argv[]) {
24  int i = 0;
25  while (quiz_cases[i] != NULL) {
26  QuizCase c = quiz_cases[i];
28  c();
29  i++;
30  }
31  quiz_print("ALL TESTS FINISHED");
32 #if !QUIZ_USE_CONSOLE
33  while (1) {
34  Ion::msleep(1000);
35  }
36 #endif
37 }
char * quiz_case_names[]
KDPoint drawString(const char *text, KDPoint p, KDText::FontSize size=KDText::FontSize::Large, KDColor textColor=KDColorBlack, KDColor backgroundColor=KDColorWhite, int maxLength=-1)
Definition: context_text.cpp:9
static KDSize stringSize(const char *text, FontSize size=FontSize::Large)
Definition: text.cpp:6
void msleep(long ms)
Definition: ion.cpp:4
void(* QuizCase)(void)
Definition: symbols.h:1
Definition: point.h:6
void writeLine(const char *line)
Definition: console_line.cpp:9
c(generic_all_nodes)
void quiz_print(const char *message)
Definition: runner.cpp:7
#define NULL
Definition: stddef.h:4
static KDIonContext * sharedContext()
Definition: ion_context.cpp:4
QuizCase quiz_cases[]
void ion_main(int argc, char *argv[])
Definition: runner.cpp:23
constexpr int Height
Definition: display.h:27
constexpr KDCoordinate height() const
Definition: size.h:11