added a test for term functions
This commit is contained in:
31
testing/test_term.cpp
Normal file
31
testing/test_term.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include <Windows.h>
|
||||
#include <iostream>
|
||||
#include "test_term.h"
|
||||
void term_run(struct pickle_shelf* shelf) {
|
||||
struct pickle_shelf __pickle_shelf__ = *shelf; //start
|
||||
|
||||
|
||||
CREATEJAR(Test_Term);
|
||||
|
||||
PICKLE(Test_get_window_size) {
|
||||
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
||||
|
||||
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
|
||||
int columns = (unsigned int)(csbi.srWindow.Right - csbi.srWindow.Left + 1);
|
||||
int rows = (unsigned int)(csbi.srWindow.Bottom - csbi.srWindow.Top + 1);
|
||||
|
||||
std::cout << "\n";
|
||||
std::cout << term_current_size().x << "term_current_size()\n";
|
||||
std::cout << columns << " columns\n";
|
||||
|
||||
if(term_current_size().x != columns)
|
||||
ASSERT("current_size.x is not the same as columns", false);
|
||||
if(term_current_size().y != rows)
|
||||
ASSERT("current_size.y is not the same as rows", false);
|
||||
ASSERT("GOOD", true);
|
||||
}();
|
||||
|
||||
ADDPICKLE(Test_Term, Test_get_window_size);
|
||||
PUTJARONSHELF(Test_Term);
|
||||
*shelf = __pickle_shelf__; // end
|
||||
}
|
||||
Reference in New Issue
Block a user