File: unittest001.cpp

package info (click to toggle)
simulavr 1.0.0%2Bgit20160221.e53413b-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,740 kB
  • sloc: cpp: 35,491; python: 6,995; ansic: 3,567; makefile: 1,075; sh: 653; asm: 414; tcl: 320; javascript: 32
file content (26 lines) | stat: -rw-r--r-- 897 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <iostream>
using namespace std;

#include "gtest.h"

#include "avrdevice.h"
#include "atmega16_32.h"
#include "systemclock.h"

TEST( EXAMPLE_SESSION_001, TEST1)
{
    AvrDevice *dev1= new AvrDevice_atmega32;
    dev1->Load("session_001/avr_code.atmega32.o");
    dev1->SetClockFreq(136);    // 7.3728
    dev1->RegisterTerminationSymbol("myexit");
    SystemClock::Instance().Add(dev1);
    SystemClock::Instance().Endless(); // should break if myexit is reached

    // Read out Register 31
   EXPECT_EQ(0x40, (unsigned char)(*(dev1->rw[16])))<< "Register contains wrong content" << endl;
   EXPECT_EQ(0x41, (unsigned char)(*(dev1->rw[17])))<< "Register contains wrong content" << endl;
   EXPECT_EQ(0x51, (unsigned char)(*(dev1->rw[18])))<< "Register contains wrong content" << endl;
   EXPECT_EQ(0x10, (unsigned char)(*(dev1->rw[19])))<< "Register contains wrong content" << endl;


}