-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathntupleUnity.c
More file actions
49 lines (40 loc) · 1.33 KB
/
ntupleUnity.c
File metadata and controls
49 lines (40 loc) · 1.33 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include "ntuple.h"
#include "unity.h"
void setUp(void) {}
void tearDown(void) {}
void test1(void){
ntuple testTuple1 = newTuple(1, "print please");
TEST_ASSERT_EQUAL_STRING("print please", get(0, testTuple1));
put(0, "hi mom", testTuple1);
TEST_ASSERT_EQUAL_STRING("hi mom", get(0, testTuple1));
ntuple testTuple2 = newTuple(1, "hi mom");
TEST_ASSERT_TRUE(equal(testTuple1, testTuple2));
put(0, "hello mum", testTuple1);
TEST_ASSERT_EQUAL_STRING("hello mum", get(0, testTuple1));
ntuple testTuple3 = newTuple(1,"hello mum");
TEST_ASSERT_TRUE(equal(testTuple1, testTuple3));
//TEST_ASSERT_EQUAL_STRING("hello mum", ntupToString(testTuple1));
printf("%s\n",ntupToString(testTuple1));
ntuple testTuple4 = newTuple(2,"hello mum", "fuck");
TEST_ASSERT_EQUAL_STRING("fuck", get(1, testTuple4));
printf("%s\n",ntupToString(testTuple4));
put(2, "asdf", testTuple4);
printf("%s\n",ntupToString(testTuple4));
ntuple zeroTuple = newTuple(0);
printf("%s\n",ntupToString(zeroTuple));
//TEST_ASSERT_EQUAL_STRING("");
}
void test2(void){
}
// test suites will go here - see class notes
int main(void){
UNITY_BEGIN();
RUN_TEST(test1);
//will invoke test suites here - see class notes
return UNITY_END();
}