Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application #3

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 46 additions & 3 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,46 @@
Sky Wave Design, LLC

This repository is a take-home test for applicants for the Software Engineer position
Sky Wave Design, LLC

Since I haven't heard anything yet I took the opportunity this morning to restructure the code. Ideally I'd further restructure TestIt.cpp. The code to transform txt to html should be split off into a separate file and made general purpose (a passed in file name etc.) But I hesitate to add too much complexty to a test. If the test becomes more complex than the thing under test it sort of defeats the purpose of the test.

20141116 edit:
I reworked the gui. Now there's a text edit box which contains the html. This is also written to log.html. The filename is hardcoded but should be set by the command line or other user input.

Don Jindra
323-463-4843
[email protected]


A brief summary of my experience:

I worked for 20 months (until mid-October 2011) at Element Technica (ET) as a software engineer. ET manufactured 3D camera rigs. My responsibilities were primarily concerned with motion control and an LCD graphics interface. Code was written in C for Atmel ATmega and TI Stellaris ARM processors using TI's (eclipse based) Code Composer and Atmel Studio. Everything was state-machine driven. There was no OS. I implemented a subset of CANOpen to communicate with third-party motor controller daughter boards. I wrote the LCD library from scratch (somewhat based on my previous work). In late 2011 ET merged into another company, then called 3ality Technica.

Prior to ET I was in the test engineering group at Hypercom (in Phoenix). After I moved to LA (~seven years ago), Hypercom kept me on as a telecommuter for another 18 months.

I started with Hypercom in August 1998 as a Senior Software Engineer in the OS/R&D department. Three years later I was moved to Test Engineering as their sole programmer. I wrote virtually all of the software Hypercom used in the manufacturing process. Hypercom manufactured embedded POS systems (they've since been acquired by VeriFone).

Through those (almost) ten years my duties included: supporting the proprietary RTOS, porting the OS to new platforms, designing and developing a low-level GUI, supporting firmware, and developing and supporting the manufacturing, validation, and testing software.

I've written drivers and reliability/functional tests for a wide variety of hardware, including: Magnetic card reader, SmartCard, RFID, modem (telco, ISDN, WiFi, and GSM), Ethernet, RS232/485, USB, biometric (fingerprint), LCD, keyboards printers, eeprom and flash. I've worked with a multitude of synchronous and asynchronous communication protocols, both industry standard and proprietary.

One fourth of my programming for Hypercom was in assembly, three fourths in C. Most of my work was on the Z80 (Lauterbach emulator), 8051 (Keil C compiler and SDCC) and Intel PX255 and Zilog ARM (EPI JTAG, Nucleus OS, Accelerated Technology and GNU C compilers). We used both PVCS and Subversion for version control.

In both the OS and Test Engineering groups I worked closely with hardware engineering. I'm comfortable with schematics.

Prior to my Hypercom experience I had my own software business, Information Modes, in Texas. My products were mass marketed by myself and my distributors all over the world. One of those products, a DOS/Windows peer to peer LAN ("Little Big LAN") was named "LAN product of the year" in 1994 by PC World of Great Britain. Other products I designed and marketed included DOS technical documentation, another network (The $25 Network) an 8048 CPU Simulator, and graphics tools.

Virtually everything in my business was done in x86 assembler. I wrote ethernet, COM, LPT, RF, and modem drivers, packet driver and NDIS interfaces, print spoolers, installation programs, a network operating system, and many diagnostic tools. I also handled all tech support for 40,000 customers (LBL was used for everything from mom and pop video stores to the NASA Space Shuttle engine test program).

Prior to those 11 years I was a self-employed consultant. My biggest project during those years was for an aerospace bushing manufacturer where I developed a parts quoting program, an invoicing and shipping program, a Manufacturing Planning and Control System, and a CNC program generator -- all done in Wang BASIC over a 3 year period. In another project I helped develop several educational games and wrote a sprite animation engine to implement them.

My education was somewhat unconventional. I spent 6+ years at the University of North Texas but never filled out a degree plan. Most of my hours were accumulated in the Computer Science, English and Philosophy departments. Toward the end I got interested in electronics, which wasn't offered at UNT so I learned that on my own.

In my free time I write both fiction and non-fiction. I also shoot video shorts.

My background is very extensive and unique.

Thanks for reading this far,

Don Jindra.
323-463-4843


Expand Down
276 changes: 276 additions & 0 deletions cqtest.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,276 @@
// must be in .h file!
//#include <QApplication>
//#include <QtTest/QtTest>

#include "cqtest.h"

//============================================================
//====================== housekeeping ========================
//============================================================

void CQTest::initTestCase(void)
{
// Calculate how many bytes we need.
elementsz=CqueueElementSize();
sz=CqueueSize();
// Get memory for two queues to test. Set them up.
queue1array=(CqueueElement *) malloc( sz*elementsz );
CqueueInit( &queue1, queue1array );
queue2array=(CqueueElement *) malloc( sz*elementsz );
CqueueInit( &queue2, queue2array );
}

void CQTest::cleanupTestCase(void)
{
free(queue1array);
free(queue2array);
}

void CQTest::init()
{
// executed before each test function
}

void CQTest::cleanup()
{
// executed after each test function
}

//============================================================
//====================== testAddFirst ========================
//============================================================

// Start super simple, with just one member in and out.

void CQTest::testAddFirst()
{
int currentsz;
CqueueAdd(&queue1,10);
// Check the count. Should be just the 1 member.
currentsz=CqueueCount(&queue1);
QCOMPARE( currentsz, 1 );
}

//============================================================
//====================== testEmptyFirst ======================
//============================================================

void CQTest::testEmptyFirst()
{
int currentsz;
int element;
element=CqueueRemove(&queue1);
currentsz=CqueueCount(&queue1);
// We wrote '10' so it better be '10'
QVERIFY2(element==10, "Bad Data!");
// and the count should be back to 0
QCOMPARE( currentsz, 0 );
}

//============================================================
//====================== testAddSecond =======================
//============================================================

// Now do two members ...

void CQTest::testAddSecond()
{
int currentsz;
CqueueAdd(&queue1,11);
CqueueAdd(&queue1,12);
currentsz=CqueueCount(&queue1);
QCOMPARE( currentsz, 2 );
}

//============================================================
//====================== testEmptySecond =====================
//============================================================

// ... and check we get those two members back.

void CQTest::testEmptySecond()
{
int currentsz;
int element1;
int element2;
element1=CqueueRemove(&queue1);
QVERIFY2(element1==11, "Bad Data1!");
currentsz=CqueueCount(&queue1);
QVERIFY2( currentsz==1,"Bad Count, expect 1!" );
element2=CqueueRemove(&queue1);
QVERIFY2(element2==12, "Bad Data2!");
currentsz=CqueueCount(&queue1);
QVERIFY2( currentsz==0,"Bad Count, expect 0!" );
}

//============================================================
//====================== testAddAll ==========================
//============================================================

// Fill to the brink.

void CQTest::testAddAll()
{
int currentsz;

for (int i=0; i<sz; i++ )
{
CqueueAdd( &queue1, i );
currentsz=CqueueCount(&queue1);
QCOMPARE( currentsz, i+1 );
}
}

//============================================================
//====================== testRemoveAll =======================
//============================================================

// Make sure a full queue reads back properly.

void CQTest::testRemoveAll()
{
int currentsz;
int element;

for (int i=0; i<sz; i++ )
{
element=CqueueRemove( &queue1 );
currentsz=CqueueCount(&queue1);
QCOMPARE( currentsz, (sz-i)-1 );
QCOMPARE( element, i );
}
}

//============================================================
//====================== testOverflow ========================
//============================================================

// Stuff too much data in and see what happens.

void CQTest::testOverflow()
{
int currentsz;
int status;

for (int i=0; i<sz; i++ )
{
CqueueAdd( &queue1, i );
currentsz=CqueueCount(&queue1);
QCOMPARE( currentsz, i+1 );
}
// This should overflow.
status=CqueueAdd( &queue1, 77 );
// Did it overflow?
QVERIFY2( status==FULL, "Expected FULL!" );
// Did the count remain at the max?
currentsz=CqueueCount(&queue1);
QVERIFY2( currentsz==sz, "Unexpected count!" );
}

//============================================================
//====================== testRemoveOverflow ==================
//============================================================

// Make sure all of the data that fit is still good.

void CQTest::testRemoveOverflow()
{
int currentsz;
int element;

for (int i=0; i<sz; i++ )
{
element=CqueueRemove( &queue1 );
currentsz=CqueueCount(&queue1);
QCOMPARE( currentsz, (sz-i)-1 );
QCOMPARE( element, i );
}
}

//============================================================
//====================== testDual ============================
//============================================================

// Run two queues at once to see if there is
// corruption between them.

void CQTest::testDual()
{
int currentsz;
int element;

CqueueAdd(&queue1,20);
currentsz=CqueueCount(&queue1);
QVERIFY2( currentsz==1, "Bad queue1 count1!" );

currentsz=CqueueCount(&queue2);
QVERIFY2( currentsz==0, "Bad queue2 count0!" );

CqueueAdd(&queue2,30);
CqueueAdd(&queue2,31);
currentsz=CqueueCount(&queue2);
QVERIFY2( currentsz==2, "Bad queue2 count2!" );

currentsz=CqueueCount(&queue1);
QVERIFY2( currentsz==1, "Bad queue1 count1a!" );

element=CqueueRemove( &queue1 );
QVERIFY2( element==20, "Bad queue1 Data!" );

currentsz=CqueueCount(&queue1);
QVERIFY2( currentsz==0, "Bad queue1 count0!" );

currentsz=CqueueCount(&queue2);
QVERIFY2( currentsz==2, "Bad queue2 count2a!" );

element=CqueueRemove( &queue2 );
QVERIFY2( element==30, "Bad queue2 Data30!" );

currentsz=CqueueCount(&queue2);
QVERIFY2( currentsz==1, "Bad queue2 count1a!" );

element=CqueueRemove( &queue2 );
QVERIFY2( element==31, "Bad queue2 Data31!" );

currentsz=CqueueCount(&queue2);
QVERIFY2( currentsz==0, "Bad queue2 count0a" );

currentsz=CqueueCount(&queue1);
QVERIFY2( currentsz==0, "Bad queue1 count0a" );
}

//============================================================
//====================== testEmpty ===========================
//============================================================

// make sure an empty queue returns empty.

void CQTest::testEmptyData()
{
int currentsz;
int element;
element=CqueueRemove(&queue1);
currentsz=CqueueCount(&queue1);
QVERIFY2(element==EMPTY, "Bad EMPTY Data!");
QCOMPARE( currentsz, 0 );
}

//============================================================
//====================== testBenchmark =======================
//============================================================

// See how fast it is because we can.

void CQTest::testBenchmark()
{
QBENCHMARK
{
for( int i=0; i<100000; i++ )
{
CqueueAdd( &queue1, 1 );
CqueueRemove( &queue1 );
}
}
}


Loading